cloudswave/blog

Termux通过ubuntu安装宝塔面板

Opened this issue · 0 comments

Termux下Atilo安装ubuntu

ubuntu或者debian支持64或者32位架构cpu
参考:https://www.jianshu.com/p/a9b30ea2ae66

安装宝塔

uname -m查看cpu架构,aarch64代表64位
参考:https://gitee.com/pdusb/pdusb-fast-btpanel
64位ubuntu下:

git clone https://gitee.com/pdusb/pdusb-fast-btpanel.git
cd pdusb-fast-btpanel
./pdbolt-inst-bt-acel.sh
bash /tmp/btp/pdbolt-bt-install/install.sh

/etc/init.d/bt restart
# 进入宝塔工具面板,可查看修改端口和密码
bt

32位ubuntu或者debian只能安装5.9版面板, python2.7:

apt-get install python-setuptools
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh

参考宝塔(BT-Panel) Linux 面板 5.9 开心版教程
玩客云安装宝塔面板5.9

错误处理记录

  • ERROR: cannot verify download.bt.cn's certificate, issued by ‘CN=sslTrus (RSA) OV CA,O=sslTrus,C=CN’: Unable to locally verify the issuer's authority. To connect to download.bt.cn insecurely, use `--no-check-certificate' ERROR: Download python env fielded.
    关闭证书验证:echo "check_certificate = off" >> ~/.wgetrc

  • 报错chmod: cannot access '/tmp/btp/pyenv/bin/python3.7': Operation not permitted...

...
root@localhost:~/pdusb-fast-btpanel# chmod 777 /tmp/btp/pyenv/bin/ -R
chmod: cannot access '/tmp/btp/pyenv/bin/python3.7': Operation not permitted
chmod: cannot access '/tmp/btp/pyenv/bin/.l2s.python3.70001': Operation not permitted
chmod: cannot access '/tmp/btp/pyenv/bin/python3.7m': Operation not permitted
...

解压pyenv-ubuntu2004-3.7.8-aarch64.tar.xz出错导致,重新解压后替换出错文件

  • 宝塔启动失败
...
Traceback (most recent call last):
  File "/www/server/panel/BT-Panel", line 27, in <module>
    from BTPanel import app,sys,public
  File "/www/server/panel/BTPanel/__init__.py", line 11, in <module>
    import json
ModuleNotFoundError: No module named 'json'
...

权限修复:chmod 777 -R /www

  • ubuntu bash报错:groups: cannot find name for group ID ***
groups: cannot find name for group ID 1015
groups: cannot find name for group ID 1028
groups: cannot find name for group ID 3003
groups: cannot find name for group ID 9997
groups: cannot find name for group ID 50062

termux在安装ubuntu运行的时候出现了goups: cannot find name for group ID,由于termux安装ubuntu后没有给原本Android的系统用户组赋予名称导致, 解决办法:

echo "1015:x:1015:
1028:x:1028:
3003:x:3003:
50062:x:50062:
9997:x:9997:" >>/etc/group

参考

  • 宝塔安装报错:ImportError: No module named setuptools
    阅读install.sh脚本,把已经执行过的命令注释,排查哪行命令报错,执行的时候发现宝塔需要使用python2.7的pip,而apt命令安装的pip会安装到python3里了。
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py 
python2 get-pip.py
然后将pip命令链接到bin目录下
  • 启动宝塔成功,但是无法显示登录页,显示500错误
    查看宝塔的/etc/init.d/bt 脚本,尝试找到错误日志保存路径如下,cat /tmp/panelBoot.pl ,发现cp: cannot create regular file '/dev/shm/session.db',修改/www/server/panel/main.py, 把/dev/shm/session.db路径修改成/tmp/session.db
nohup python main.pyc `cat data/port.pl` > /tmp/panelBoot.pl 2>&1 & 

image

image