Skip to content

Instantly share code, notes, and snippets.

@ikennaokpala
Created July 17, 2011 23:36
Show Gist options
  • Save ikennaokpala/1088243 to your computer and use it in GitHub Desktop.
Save ikennaokpala/1088243 to your computer and use it in GitHub Desktop.
install and start up nginx automaically on a mac
sudo mkdir -p /usr/local/src
sudo curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.02.tar.gz
cd /usr/local/src
tar xvzf pcre-8.02.tar.gz
cd pcre-8.02
./configure --prefix=/usr/local
make
sudo make install
cd ..
sudo mkdir -p /usr/local/nginx
sudo curl http://nginx.org/download/nginx-1.0.4.tar.gz
tar xvzf nginx-1.0.4.tar.gz
cd nginx-1.0.4
./configure --prefix=/usr/local/nginx --with-http_ssl_module
make
sudo make install
which nginx
/usr/local/sbin/nginx
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>nginx</string>
<key>Program</key>
<string>/usr/local/sbin/nginx</string>
<key>KeepAlive</key>
<true/>
<key>NetworkState</key>
<true/>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>
sudo chown root /System/Library/LaunchDaemons/org.nginx.nginx.plist
sudo launchctl load /System/Library/LaunchDaemons/org.nginx.nginx.plist
sudo launchctl start org.nginx.nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment