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