1.在官网上下载最新的包
2.tar -zxvf 下,mv 到/urs/local/nginx里 sudo mv nginx-1.13.3.tar.gz /usr/local/ngnix/
3.sudo apt-get install libpcre3 libpcre3-dev 和 sudo apt-get install openssl libssl-dev
4.sudo ./configure –prefix=/usr/local/nginx (或进到该目录下执行./configure)
5.sudo make install
6.sudo /usr/local/nginx/sbin/nginx 启动,然后就可以在浏览器里查看了http://127.0.0.1:8080/
Nginx启动报错: could not open error log file: open() 解决:
1.修改conf/nginx.conf 端口改为8080
2.新建文件夹nginx/logs
could not get lock /var/lib/dpkg/lock -open错误:
1.sudo rm /var/cache/apt/archives/lock
2.sudo rm /var/lib/dpkg/lock