使用 Linux deploy 搭建属于自己的Nginx+PHP-Web服务器,FRP内网穿透,可获取用户真实IP

本文详细介绍了如何在Android手机上通过Busybox和Linuxdeploy安装Linux环境,包括CentOS7的配置、软件安装、编译安装所需依赖包、Pure-ftpd、Nginx、PHP7等,实现手机上的Web服务器搭建。

前言

第一次写文章,有问题请见谅,文章有错误请指出,本文末尾会贴出所有用到的文章,感谢各位大佬。

所需软件: Busybox,Linux deploy 本文所用均为最新版 (都需要ROOT完整权限,没有root建议别浪费时间了)
测试环境: Mi6 — MIUI 11 开发版,Android 9.0,MagiskSU,6GB物理内存,64GB存储空间,32GB分配空间

Linux deploy 下载地址: https://github.com/meefik/linuxdeploy/releases
Busybox 去某安搜索就行了 第一个就是
本文以CentOS7作为演示

1.软件安装与配置

首先打开busybox 安装位置选择 /system/xbin 点击 install 安装 (当然别的位置也行 与Linux deploy的位置一致就行)

然后就是Linux deploy了 打开软件 选择左上角三道杠 点击配置文件 写一个你喜欢的名字就行


然后点击设置 勾选 锁定wifi,cpu唤醒 ,联网更新,ENV目录不用管它,path变量设置为busybox的安装目录,然后点击一次更新操作环境,最下面有个调试模式最好也勾选上,方便看信息


然后我们回到主界面选择右下角三道杠 如图设置即可
源地址设置为阿里云:https://mirrors.aliyun.com/centos-altarch/
镜像大小根据所需设置 我这里是32GB
至于安装类型,,,基本用不到,(其他安装类型一个也没成功…)
用户名密码自己设置就行了 (ps:截图的源地址打错了)

勾选启用挂载和启用ssh 添加一个挂载点方便访问sd卡


至此基本配置就完成了

2.基本系统安装与调试

回到主界面 选择右上角三个点 点击安装 然后等待安装完毕即可 理论应该不会出现什么问题
安装完毕回显 <<<deploy 就可以了

然后我们点击启动 再用ssh工具连接 就和普通的没什么两样了 qwq

设备内网IP:22

用户名密码为软件中设置的密码

更换YUM软件源

cd /etc/yum.repos.d/
mkdir old
mv * old
vi CentOS-Base.repo  #添加如下代码
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
enabled=1
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
vi epel.repo		#添加如下代码
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
 
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/debug
failovermethod=priority
enabled=0
gpgkey
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值