导出本地的 pip 列表
pip freeze > req.txt
clone 项目到服务器,在对应 python 环境下安装项目的 pip 包
pip install -r req.txt
关联项目文件:
ln -s /home/unlock_channel/unlock_channel/conf/product/nginx_unlock_api.conf unlock_api.conf
检测文件语法是否正确:
nginx -tc /etc/nginx/nginx.conf
柔和重启 nginx :
systemctl reload nginx.service
安装 mysqlclient 时报错解决:
For MacOS 最快的临时解决方法:
export PATH=$PATH:/usr/local/mysql/bin
For CentOS
yum install -y python-devel mysql-devel
For Ubuntu
sudo apt-get install libmysqlclient-dev
updatedb
locate mysql_config
CentOS 安装 nginx:
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
sudo yum install -y nginx
# 启动
sudo systemctl start nginx.service
# 开机运行
sudo systemctl enable nginx.service