宝塔面板拒绝访问的问题修复

宝塔面板发现无法启动,网页提示拒绝连接。那首先要看服务器端口是否开启,默认8888。

如果端口没问题,则要判断宝塔面板程序是否运行中。

测试:

/etc/init.d/bt  status

提示:

Bt-Panel not running
Bt-Task (pid 2019) already running

说明宝塔面板没有启动,那我们手动开启宝塔:

/etc/init.d/bt  start

提示:

Starting Bt-Panel..........failed
------------------------------------------------------
Traceback (most recent call last):
  File "/www/server/panel/BT-Panel", line 14, in <module>
    from BTPanel import app,sys,public
  File "/usr/lib64/python2.7/site-packages/gevent/builtins.py", line 96, in __import__
    result = _import(*args, **kwargs)
  File "/www/server/panel/BTPanel/__init__.py", line 31, in <module>
    from flask_compress import Compress
  File "/usr/lib64/python2.7/site-packages/gevent/builtins.py", line 96, in __import__
    result = _import(*args, **kwargs)
ImportError: No module named flask_compress
Traceback (most recent call last):
  File "/www/server/panel/BT-Panel", line 14, in <module>
    from BTPanel import app,sys,public
  File "/usr/lib64/python2.7/site-packages/gevent/builtins.py", line 96, in __import__
    result = _import(*args, **kwargs)
  File "/www/server/panel/BTPanel/__init__.py", line 31, in <module>
    from flask_compress import Compress
  File "/usr/lib64/python2.7/site-packages/gevent/builtins.py", line 96, in __import__
    result = _import(*args, **kwargs)
ImportError: No module named flask_compress

找到原因:

ImportError: No module named flask_compress

flask_compress模块缺失,然后:

似乎是python的问题,但是网上重装python的办法都无效,所以使用宝塔官方命令:

bt

出现

===============宝塔面板命令行==================
(1) 重启面板服务           (8) 改面板端口
(2) 停止面板服务           (9) 清除面板缓存
(3) 启动面板服务           (10) 清除登录限制
(4) 重载面板服务           (11) 取消入口限制
(5) 修改面板密码           (12) 取消域名绑定限制
(6) 修改面板用户名         (13) 取消IP访问限制
(7) 强制修改MySQL密码      (14) 查看面板默认信息
(22) 显示面板错误日志      (15) 清理系统垃圾
(23) 关闭BasicAuth认证     (16) 修复面板(检查错误并更新面板文件到最新版)
(24) 关闭谷歌认证          (17) 设置日志切割是否压缩
(25) 设置是否保存文件历史副本  (18) 设置是否自动备份面板
(0) 取消
===============================================
请输入命令编号:

选择16,等待完成

===============================================
正在执行(16)...
===============================================
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3154  100  3154    0     0   1930      0  0:00:01  0:00:01 --:--:--  1930
--2021-12-07 15:08:06--  http://download.bt.cn/install/public.sh
Resolving download.bt.cn (download.bt.cn)... 42.157.129.47, 240e:a5:4200:89::143
Connecting to download.bt.cn (download.bt.cn)|42.157.129.47|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4560 (4.5K) [application/octet-stream]
Saving to: ‘Tpublic.sh’

100%[======================================>] 4,560       --.-K/s   in 0s

2021-12-07 15:08:06 (541 MB/s) - ‘Tpublic.sh’ saved [4560/4560]

正在选择下载节点...
curl: (52) Empty reply from server
--2021-12-07 15:08:26--  http://123.129.198.197/install/update/LinuxPanel-7.7.0.zip
Connecting to 123.129.198.197:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5611390 (5.4M) [application/zip]
Saving to: ‘/tmp/panel.zip’

100%[======================================>] 5,611,390   2.15MB/s   in 2.5s

2021-12-07 15:08:29 (2.15 MB/s) - ‘/tmp/panel.zip’ saved [5611390/5611390]

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pymysql in /usr/lib64/python2.7/site-packages (0.9.3)
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pycryptodome
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/0c/6f/62a193146d79ee209ea3adf4261f3092ded16fe6e12a3760a1fa0e4c0eb2/pycryptodome-3.12.0-cp27-cp27mu-manylinux2010_x86_64.whl (2.0 MB)
     |████████████████████████████████| 2.0 MB 4.6 MB/s
Installing collected packages: pycryptodome
Successfully installed pycryptodome-3.12.0
=====================================
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Bt-Panel..     done
Starting Bt-Tasks... Bt-Tasks (pid 2019) already running

 

可以看到程序自动发现是python的问题,并且已经自动修复完成,这样就可以正常访问了

 

标签TAGS

与标签相关的文章

Sign up for our Newsletter

iPhone

Lorem ipsum dolor sit amet

MacBook

Sed do eiusmod tempor incididunt

iPad

Tempor incididunt ut labore et dolore