「Mac/インストール/nginx」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「==インストール== sudo brew install nginx ==起動・停止== sudo nginx sudo nginx -s stop ==httpアクセス== ttp://localhost:8080/ ==設定ファイルの...」) |
(→設定ファイルの追加) |
||
| (同じ利用者による、間の13版が非表示) | |||
| 行1: | 行1: | ||
==インストール== | ==インストール== | ||
| − | + | brew install nginx | |
| − | == | + | ==起動・停止・再起動== |
| − | sudo nginx | + | sudo nginx #起動 |
| − | sudo nginx -s stop | + | sudo nginx -s stop # 停止 |
| + | sudo nginx -s reload # 再起動 | ||
==httpアクセス== | ==httpアクセス== | ||
| − | ttp://localhost: | + | ttp://localhost:80/ |
==設定ファイルのドキュメントルート変更== | ==設定ファイルのドキュメントルート変更== | ||
| 行13: | 行14: | ||
location / { | location / { | ||
root html; | 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]] [ショートカット] | ||
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 [ショートカット]
