簡單的寫了下mac下的nginx的安裝和配置
確認你的電腦是否安裝homebrew,打開電腦終端 輸入:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
確認homebrew是否安裝成功,在終端輸入:
brew -v
image.png
安裝nginx,在終端輸入:
brew install nginx
檢查nginx是否安裝成功,在終端輸入:
nginx -v
image.png
啓動nginx,在終端輸入:
brew services start nginx
檢查nginx是否啓動成功,在瀏覽器輸入:
localhost:8080
image.png
nginx常用命令小結
//檢查是否安裝nginx及對應的目錄
find /|grep nginx.conf
//啓動Nginx
service nginx start
//重啓nginx
service nginx restart
作者:一個被程序員耽誤的廚師
鏈接:https://www.jianshu.com/p/fae1c72e2b6e
來源:簡書
著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。