termux搭建服务器方式
pkg install vim
apt update
安装debian系统
apt install proot-distro
proot-distro install debian
proot-distro login debian
df -h 查看磁盘空间
安装linux
pkg install proot
termux-chroot
pkg install wget
mkdir CentOS && cd CentOS && pkg install wget openssl-tool proot -y && hash -r && wget https://raw.fastgit.org/EXALAB/AnLinux-Resources/master/Scripts/Installer/CentOS/centos.sh && sed -i 's/githubusercontent.com/fastgit.org/' centos.sh && bash centos.sh && rm centos.sh
ls
./start-centos.sh
exit退出
使用ssh连接
apt install openssh
sshd
cp storage/dcim/公钥文件名.pub ./.ssh
cat .ssh/公钥文件名.pub >> .ssh/authorized_keys
whoami
ifconfig
ssh连接时候需要连接同一个,都可以上网的wifi
echo "sshd" >> ~/.bashrc
安装jdk
yum install java-1.8.0-openjdk* -y
java -version
安装tomcat
https://tomcat.apache.org/download-80.cgi
/data/data/com.termux/files/home/CentOS/centos-fs/usr
/usr/local/tomcat8
直接将本地tomcat考到termux中,然后解压
yum install unzip
unzip tomcat
或者tar zxvf apache-tomcat-8.0.53.tar.gz
启动tomcat时如果无法启动提示权限不足,需要执行命令:chmod u+x *.sh
ls -l 文件名,查看文件权限
/data/data/com.termux/files/home/CentOS/centos-fs/usr/lib
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.aarch64/
修改环境变量
配置vim ~/.zshrc,增加如下内容:
#JDK8
export JAVA_HOME=/data/data/com.termux/files/home/java/jdk8
export PATH=$PATH:$JAVA_HOME/bin:.
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
java 安装目录 /data/data/com.termux/files/home/CentOS/centos-fs/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.aarch64/
tomcat 安装目录 /data/data/com.termux/files/home/CentOS/centos-fs/usr/local/apache-tomcat-8.0.26/bin/startup.sh
安装postgresql
pkg install postgresql
PGDATA=/data/data/com.termux/files/var/lib/pgsql/data
export PGDATA
initdb --encoding=utf-8
修改postgresql.conf,pg_hba.conf允许Navicat连接
pg_ctl start
pg_ctl restart重启数据库
createuser postgres
createdb mydb
psql mydb
访问外部存储卡
termux-setup-storage
CentOS 同目录的storage 中的3233-3434目录就是外部存储卡
进入外部存储卡的方式:
全目录地址为:/storage/3233-3434/Android/data/com.termux/files
也是目录地址:/data/data/com.termux/files/home/storage/external-1
也是目录地址:~/storage/external-1
ln -s ~/storage/external-1 CentOS/centos-fs/usr/local/external-1
termux中的linux 访问termux文件
https://blog.csdn.net/qq_35425070/article/details/8604119
nginx
pkg install nginx
nginx
nginx -s reload
nginx -s stop
nginx -s quit
kill -9 `pgrep nginx`
nginx配置,参考:
vim $PREFIX/etc/nginx/nginx.conf
https://www.sqlsec.com/2018/05/termux.html?tdsourcetag=s_pctim_aiomsg
cp -r /data/data/com.termux/files/usr/share/nginx/html /storage/3233-3434/Android/data/com.termux/files/html
创建文件软连接
ln -s /data/data/com.termux/files/home/storage/shared/tencent/QQfile_recv QQ
~ $ cd
~ $ ls
访问win10共享文件
apt install samba*
使用时提示smb.conf文件,需要手动创建
smbclient -L "\\192.168.1.101\Downloads" -U 账号%密码
smbclient //192.168.1.101/Downloads -U 账号%密码 -W domain
安装mariadb
pkg isntall mariadb
mysql_install_db
You can start the MariaDB daemon with:
cd '/data/data/com.termux/files/usr' ; /data/data/com.termux/files/usr/bin/mysqld_safe --datadir='/data/data/com.termux/files/usr/var/lib/mysql'
You can test the MariaDB daemon with mysql-test-run.pl
cd '/data/data/com.termux/files/usr/mysql-test' ; perl mysql-test-run.pl
关闭数据库
mysqladmin shutdown -p
查看mysql状态
mysqld status
查看mysql进程
ps aux|grep mysql
mariadb 刚创建的时候没有密码,无法登录,需要先执行mysql进入命令,
然后执行 SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
alter user 'root'@'localhost' IDENTIFIED BY 'YourPassword';
启动mysql
mysqld
直接使用php内置服务发布
php -S 0.0.0.0:8080 -t ./www
启动php
php-fpm
关闭php
killall php-fpm
查看端口占用情况
netstat -tunlp |grep 8000
termux搭建服务器方式的更多相关文章
- 利用ADSL拨号上网方式如何搭建服务器
序:搭建服务器需要两个条件硬件服务器和固定公网IP,随便一台个人电脑都可以作为硬件服务器,就剩下一个问题,如何获得一个固定公网IP. 第一章 扫盲:ADSL拨号上网方式,本地IP与公网IP的区别 一. ...
- 【Node.js】利用node.js搭建服务器并访问静态网页
node.js是一门服务端的语言,下面讲讲如何利用node.js提供给我们的api来搭建服务器,并且访问静态网页 项目结构如下 ------------------------------------ ...
- koa2搭建服务器+使用mongoose链接mangodb
使用node搭建服务器,用到了现在比较流行的框架koa. 1.初始化package.json npm init -y 2.安装koa2 npm i koa --save 3.搭建服务器 const K ...
- 10分钟学会windows中iis搭建服务器集群实现负载均衡和nginx代理转发
前言 我们之前聊过 10分钟搭建服务器集群--Windows7系统中nginx与IIS服务器搭建集群实现负载均衡:https://www.cnblogs.com/xiongze520/p/103087 ...
- nginx+tomcat+memcached搭建服务器集群及负载均衡
在实际项目中,由于用户的访问量很大的原因,往往需要同时开启多个服务器才能满足实际需求.但是同时开启多个服务又该怎么管理他们呢?怎样实现session共享呢?下面就来讲一讲如何使用tomcat+ngin ...
- Telegraf+InfluxDB+Grafana搭建服务器监控平台
Telegraf+InfluxDB+Grafana搭建服务器监控平台 tags:网站 个人网站:https://wanghualong.cn/ 效果展示 本站服务器状态监控:https://statu ...
- SSR搭建服务器
SSR搭建服务器一站式教程:https://ssr.tools/252
- node学习笔记2——搭建服务器
搭建服务器关键词: require('http') —— 请求 node 里面的 http 模块 createServer —— 创建一个服务器 request —— 请求 response—— 响应 ...
- Linux系统——搭建FTP方式的本地定制化Yum仓库
(1)搭建公网源yum仓库 安装wget aliyun源 # wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epe ...
- SpringBoot项目以服务器方式启动
SpringBoot项目,如果未引入Web相关依赖,不会以服务器方式进行启动,会以应用的方式启动并结束 <dependency> <groupId>org.springfram ...
随机推荐
- 【STM32】串口收发驱动Drv_Uart|学习笔记
一.什么事串口? 大家常说串口,其实串口有很多种UART,SPI,IIC都是串口,一般大家口中的串口就是UART(Universal Asynchronous Receiver/Transmitter ...
- 服务器做bond,交换机做port-channel
端口绑定的种类(具体介绍网上很多参考) balance-rr or 0 active-backup or 1 balance-xor or 2 broadcast or 3 802.3ad or 4 ...
- Win10微软官方镜像iso文件下载
1.转到下载页面2.按F12后点击小窗口左上角的手机图标3:刷新页面开始下载(win10.iso:链接)
- 记录坑:Chrome谷歌浏览器最小化和页面遮挡后JS代码不稳定
问题:用定时器 setInterval()做个滚动通知的动画,浏览器最小化时,定时器 setInterval()失效了,导致滚动条重叠了 可能原因: js代码不稳定 Chrome谷歌浏览器最小化和页面 ...
- C++时间日期相关
// 计时 #pragma once #include <iostream> #include <thread> #include <chrono> #includ ...
- 图片转成gif 变成base64
html2canvas 截屏的插件 http://jnordberg.github.io/gif.js/ GIF.js官网 <script src='https://imgss.githu ...
- [OC] APP唤醒,URL Scheme,工程中的 URL Types 和 LSApplicationQueriesSchemes
1.网页唤醒APP: 假设我们有一个APP,名字叫做 "APP甲",需要通过网页唤起 APP甲,我们首先需要在 APP甲的工程文件里配置参数 URL Types: 在 info.p ...
- Unity 简易聊天室(基于TCP)(2)
客户端用Unity开发,主要就是搭建一下聊天室的UI界面:输入框,聊天内容显示框,发送按钮 灰色背景的就是Message,也就是聊天内容的显示框,是一个Text类型,这里创建UI方面就不多讲了 在Ca ...
- MVC+EF API 跨域
MVC+EF API --2 一. MVC+EF 不管是MvcHAIS Ef 都有文件夹Controller 二.Link查询 多表联查 匿名类型 三.Postman使用 四.mvc访问使用API 跨 ...
- 国内 IoT 物联网平台终局的思考:未来只会有 3家
随着物联网成为国家十四五规划的新型基础设施,许多企业纷纷投资物联网赛道,希望能提前布局物联网平台,打造一个新的生态出来. 十年后,那些投入重金的物联网平台最终能存活下来几家呢? 01. 公有云IoT平 ...