一、安裝
分別執行以下命令:
$ sudo apt-get update
$ sudo apt-get install nginx
檢查是否安裝成功:
$ nginx -v
如果出現類似:nginx version: nginx/1.12.1,則表明安裝成功
二、基本命令
查看配置文件路徑:$ nginx? -t
啟動: $ nginx -c 配置文件
訪問:http://localhost:8080?
重啟:$ nginx -s reload (重新加載配置文件)
快速停止:$ nginx -s stop
優雅地停止(等待工作進程處理完請求):$ nginx -s quit
殺死進程:$ pkill -9 nginx