Last active
July 30, 2017 02:38
-
-
Save atma/034b64bed424f0b68feaae412ce1ec63 to your computer and use it in GitHub Desktop.
Mac OS X nginx installation from source
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
# download PCRE and nginx source | |
sudo mkdir -p /usr/local/src | |
cd /usr/local/src | |
# copy PCRE to directory | |
# eg. cp /tmp/pcre-8.20.tar.gz /usr/local/src/ | |
tar xzvf pcre-8.20.tar.gz | |
cd pcre-8.20 | |
./configure --prefix=/usr/local | |
make && sudo make install && make clean | |
cd .. | |
# install openssl | |
brew update | |
brew install openssl | |
cd /usr/local/include | |
ln -s ../opt/openssl/include/openssl . | |
cd /usr/local/src | |
# copy nginx to directory | |
tar xzvf nginx-1.0.11.tar.gz | |
cd nginx-1.0.11 | |
./configure --with-http_ssl_module --prefix=/etc/nginx --conf-path=/var/log/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/local/bin/nginx --with-ld-opt=-L/usr/local/opt/openssl/lib | |
make && sudo make install && make clean | |
# edit your PATH variable, make sure it include /usr/local/sbin | |
vim ~/.profile | |
. ~/.profile | |
which nginx | |
# start nginx | |
sudo nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment