1.安装
sudo apt-get install nginx
2.启动
systemctl start nginx.service
如果和apache2的80端口冲突了,修改一下apache2的port
sudo vim /etc/apache2/ports.conf
冲突的话,日志/var/log/nginx/error.log中将会报
2019/10/12 14:25:31 [emerg] 23836#23836: listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
修改成8080
重启apache2
systemctl restart apache2
再启动nginx,成功