linux报错整理
————————————————————————
问题:访问服务器页面一直访问不到
解决办法:
## 开启防火墙
systemctl start 服务名
# 关闭防火墙(服务器重启后还会自动开启防火墙)
systemctl stop firewalld
# 禁止防火墙开机启动
systemctl disable firewalld
————————————————————————
问题:pip 下载项目需要的包时报错
#报错信息
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-b5grrrir/cryptography/setup.py", line 17, in <module>
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
解决办法:
pip3 install -U pip setuptools
—————————————————————————————————
问题:pip下载东西的时候包的时候报错 Python中的SSL模块不可用
#报错信息
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
解决办法:
# mkdir:如果存在上级目录不存在的情况,会无法创建下级目录, 会提出ERROR
# mkdir -p:递归创建目录,即使上级目录不存在,会按目录层级自动创建目录
mkdir -p ~/.pip
vim ~/.pip/pip.conf
然后输入内容
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com
————————————————————————————
问题:客户端连接不到服务器数据库报错
#报错信息 无法连接到服务器Mysql
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '***.***.****' (timed out)")
解决办法
设置服务器的防火墙 允许所有源访问
——————————————————————————————
问题:重启服务器后访问页面 显示无法访问此网站拒绝连接
#提示找不到nginx的启动文件
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
解决办法
#告诉服务器你的nginx的启动文件
#如果不知道你的nginx启动文件可以查找一下
find / -name "nginx"
#告诉服务器你的nginx启动文件地址
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
后续遇到报错还会继续添加