软件安装
安装git
安装mysql
安装redis
安装python
安装虚拟环境
安装uwsgi
安装nginx
centos安装常见软件_骑台风走的博客-CSDN博客一 卸载mysql### 1 查看mysql的安装情况 rpm -qa |grep -i mysql # -i表示忽略大小写 ''' mysql80-community-release-el7-7.noarch mysql-community-common-8.0.32-1.el7.x86_64 mysql-community-clie…Centos7上安装Mysql5.7--Mysql8的四种方案 - 知乎。https://blog.csdn.net/qq_52385631/article/details/131576514?spm=1001.2014.3001.5501
步骤
前端发送的请求网址,向8000发请求被nginx捕获转发
http://10.0.0.100:8000/api/v1/banner/s
部署步骤
# 本地收集static dist 上传
python manage.py collectstatic
# 拉项目
https://gitee.com/yqmc/t_api.git
# 切换(生成)虚拟环境
workon t_env
# 安装模块
pip3 install -r requirement.txt -i https://pypi.douban.com/simple
pip3 install uwsgi -i https://pypi.douban.com/simple
# uwsgi配置(配置在后面) 在项目根路径
vim t_api.xml
# nginx配置
cp /usr/local/nginx/conf/nginx.conf   /home/back.conf
vim /usr/local/nginx/conf/nginx.conf 
t_api.xml
<uwsgi>    
           <socket>127.0.0.1:8888</socket>
           <chdir>/home/t_api</chdir>       
           <module>t_api.wsgi</module>
           <processes>4</processes>
           <daemonize>uwsgi.log</daemonize>
</uwsgi> 
nginx.conf
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    server {
        listen 80;
        server_name  127.0.0.1;
        charset utf-8;
        location / {
            root /home/dist;
            index index.html;
            try_files $uri $uri/ /index.html;
        }
    }
    server {
            listen 8000;
            server_name  127.0.0.1;
            charset utf-8;
            location / {
               include uwsgi_params;
               uwsgi_pass 127.0.0.1:8888;
               uwsgi_param UWSGI_SCRIPT luffy_api.wsgi; 
               uwsgi_param UWSGI_CHDIR /home/project/luffy_api/;
            }
            location /static {
            alias /home/static;
        	}
        }
}  
启动
nginx
uwsgi -x t_api.xml 
杀死
pkill -9 -f nginx
pkill -9 -f uwsgi
 
过滤
 ps -aux |grep nginx
 ps -aux |grep uwsgi 
                



















