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,成功日誌