Created
July 17, 2011 23:36
-
-
Save ikennaokpala/1088243 to your computer and use it in GitHub Desktop.
install and start up nginx automaically on a mac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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