依赖: nginx-common (= 1.14.0-0ubuntu1) 但是它将不会被安装

1.apt --fix-broken install
2.sudo apt-get remove nginx nginx-common # 卸载删除除了配置文件以外的所有文件。
3.sudo apt-get purge nginx nginx-common # 卸载所有东东,包括删除配置文件。
4.sudo apt-get autoremove # 在上面命令结束后执行,主要是卸载删除Nginx的不再被使用的依赖包。
5.sudo apt-get remove nginx-full nginx-common #卸载删除两个主要的包。
6.sudo service nginx restart  #重启nginx

 然后安装

sudo apt-get update
sudo apt-get install nginx

 安装 uwsgi

sudo apt install build-essential python3-dev 
install uwsgi
uwsgi --version

 启动 nginx

/etc/init.d/nginx start  #启动
/etc/init.d/nginx stop  #关闭
/etc/init.d/nginx restart  #重启

注意要修改端口请移步到

/etc/nginx/conf.d/

网上大多人给的路径是错的很烦人,没试过还误导人

路径下找到 

sudo gedit default.conf 

修改

server {
    listen       8080;    # 修改端口号
    server_name  localhost;

    #charset koi8-r; 

    #access_log  logs/host.access.log  main;

    location / {
        root   html;
        index  index.html index.htm;
    }

这时候 打开 127.0.0.1:8080就可以看到启动页了

no internal routing support, rebuild with pcre support !!!

 ubuntu下不要尝试使用 yum ,依赖关系无法解决 请使用apt-get vm被替换为 gedit会好用点

apt-get install libpcre3 libpcre3-dev    

来解决 pcre找不到问题,不要使用 yum

进入目标文件夹 建立一个测试网页 在该路径输入

进入非root用户不然会提醒不安全

uwsgi --http :8001 --wsgi-file test.py
原文地址:https://www.cnblogs.com/polar-lights/p/9135315.html