Ubuntu18.04安裝Nginx
檢視80埠
$ lsof -i tcp:80
複製程式碼
更新apt
$ sudo apt update
複製程式碼
安裝nginx
$ sudo apt install nginx
複製程式碼
管理nginx
$ sudo systemctl status nginx
$ sudo systemctl start nginx
$ sudo systemctl stop nginx
$ sudo systemctl restart nginx
$ sudo systemctl reload nginx
$ sudo systemctl enable nginx
$ sudo systemctl disable nginx
複製程式碼
檢視nginx配置檔案
$ nginx -t
複製程式碼
設定防火牆
$ sudo ufw allow 'Nginx Full'
$ sudo ufw status
複製程式碼