2016年3月22日 星期二

nginx for Mac

Ref : https://coolestguidesontheplanet.com/installing-homebrew-os-x-yosemite-10-10-package-manager-unix-apps/

1. Install Brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
password was needed and not shown on the screen

2. brew doctor

3. Install nginx
Ref:http://learnaholic.me/2012/10/10/installing-nginx-in-mac-os-x-mountain-lion/

3. Start nginx
bash$ ngix
Chrome localhost:8080
4. Stop nginx
$nginx -s stop
4. Re-Start nginx
==> Pouring nginx-1.8.1.yosemite.bottle.tar.gz
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx at login:
  ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
Then to load nginx now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Or, if you don't want/need launchctl, you can just run:
  nginx

==> Summary
Ref:http://flylib.com/books/en/2.97.1.54/1/

沒有留言:

張貼留言