Nginx本地項目啟動日記


啊哈哈哈哈哈哈

首先在mac中安裝brew,通過它來安裝nginx

brew install nginx
  • 安裝成功后 對應如下幾個命令行
nginx  #啟動nginx
nginx -s quit  #快速停止nginx
nginx -V #查看版本,以及配置文件地址
nginx -v #查看版本
nginx -s reload|reopen|stop|quit   #重新加載配置|重啟|快速停止|安全關閉nginx
nginx -h #幫助
nginx安裝文件目錄
open   /usr/local/Cellar/nginx
nginx配置文件目錄
open  /usr/local/etc/nginx
config文件目錄
open  /usr/local/etc/nginx/nginx.conf
系統hosts位置
open  /private/etc/hosts

如果報如下的錯誤,表示你沒有權限,加上 sudo 便可

Nginx啟動報錯:could not open error log file: open() "/usr/local/nginx/logs/error.log" failed

如果發現安裝成功了能打印版本但是依舊不能運行,嘗試找到 cd 到 nginx下運行


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM