Ubuntu18.04安裝Nginx

pengjielee發表於2019-10-29

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  
複製程式碼

參考

linuxize.com/post/how-to…

相關文章