facebook twitter hatena line email

「Mac/インストール/nginx」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(設定ファイルの追加)
 
(同じ利用者による、間の12版が非表示)
行1: 行1:
 
==インストール==
 
==インストール==
  sudo brew install nginx
+
  brew install nginx
  
==起動・停止==
+
==起動・停止・再起動==
  sudo nginx
+
  sudo nginx #起動
  sudo nginx -s stop
+
  sudo nginx -s stop # 停止
 +
sudo nginx -s reload # 再起動
  
 
==httpアクセス==
 
==httpアクセス==
  ttp://localhost:8080/
+
  ttp://localhost:80/
  
 
==設定ファイルのドキュメントルート変更==
 
==設定ファイルのドキュメントルート変更==
行16: 行17:
 
==参考==
 
==参考==
 
http://phiary.me/mac-nginx-install/
 
http://phiary.me/mac-nginx-install/
 +
 +
==自動起動==
 +
ln -s /usr/local/opt/nginx/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
 +
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
 +
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
 +
 +
自動起動確認
 +
brew services list
 +
 +
==設定ファイルの追加==
 +
vi servers/default.conf
 +
以下参照
 +
 +
[[linux/nginx]] [ショートカット]

2017年1月17日 (火) 16:21時点における最新版

インストール

brew install nginx

起動・停止・再起動

sudo nginx #起動
sudo nginx -s stop # 停止
sudo nginx -s reload # 再起動

httpアクセス

ttp://localhost:80/

設定ファイルのドキュメントルート変更

vi /usr/local/etc/nginx/nginx.conf
       location / {
           root   html;

参考

http://phiary.me/mac-nginx-install/

自動起動

ln -s /usr/local/opt/nginx/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

自動起動確認

brew services list

設定ファイルの追加

vi servers/default.conf

以下参照

linux/nginx [ショートカット]