宣告:以下只是簡單介紹nginx的安裝,還沒有深入講解nginx的相關配置以及功能
1.安裝nginx
brew install nginx如果出現一下結果 就證明已經安裝了
warning: nginx 1.12.0_1 is already installed
安裝路徑
➜ ~ ls /usr/local/cellar/nginx/1.12
.0_1
changes license bin html
install_receipt.json readme homebrew.mxcl
.nginx
.plist share
2.nginx 的配置
ls /usr/local/etc/nginx
fastcgi.conf fastcgi_params.default mime.types nginx.conf
.default servers win-utf
fastcgi.conf
.default koi-utf mime.types
.default scgi_params uwsgi_params
fastcgi_params koi-win nginx.conf scgi_params.default uwsgi_params.default
主要是nginx.conf
504 /50x.html; #定義服務錯誤顯示的頁面
2.啟動nginx
➜ ~ brew services start nginx
==> successfully started `nginx` (label: homebrew.mxcl.nginx)
訪問 localhost:9990
3.停止nginx
➜ ~ brew services stop nginx
stopping `nginx`... (might take a while)
==> successfully stopped `nginx` (label: homebrew.mxcl.nginx)
4.重新啟動nginx
➜ ~ brew services restart nginx
stopping `nginx`... (might take a while)
==> successfully stopped `nginx` (label: homebrew.mxcl.nginx)
==> successfully started `nginx` (label: homebrew.mxcl.nginx)
在Mac上安裝nginx
首先,你得安裝好homebrew.然後在命令列終端執行 brew install nginx 通過homebrew,nginx預設被安裝在 usr local cellar nginx 1.6.2,conf檔案預設被安裝在 usr local etc nginx nginx.conf 然後再瀏覽器中...
Nginx在Mac上的安裝配置
在mac上使用macport安裝和配置nginx非常方便,首先安裝nginx sudo port install nginx 安裝完成後啟動nginx會說沒有nginx.conf檔案,到 opt local etc nginx目錄下看到以下幾個檔案 fastcgi params.example ko...
nginx在MAC上的安裝 啟動 重啟和關閉
一 安裝 執行如下命令 brew search nginx brew install nginx 安裝完以後,可以在終端輸出的資訊裡看到一些配置路徑 usr local etc nginx nginx.conf 配置檔案路徑 usr local var www 伺服器預設路徑 usr local c...