Skip to content

Instantly share code, notes, and snippets.

@zmts
Last active March 1, 2019 16:29
Show Gist options
  • Select an option

  • Save zmts/758e678b17ede8ae8fbce630d84a794f to your computer and use it in GitHub Desktop.

Select an option

Save zmts/758e678b17ede8ae8fbce630d84a794f to your computer and use it in GitHub Desktop.
NGINX OS X El Capitan

Install NGINX OS X El Capitan (from sources)

https://kevinworthington.com/nginx-for-mac-os-x-el-capitan-in-2-minutes/

#!/bin/bash

# Build Nginx 1.9.6 on Mac OS X El Capitan (10.11)
# This script was created by Kevin Worthington - http://kevinworthington.com/ - 07 November 2015
# Original article at: http://kevinworthington.com/nginx-for-mac-os-x-el-capitan-in-2-minutes/

# This useful script is provided for free, but without warranty. Use at your own risk.
# By downloading this script you agree to the terms above.

# create, then go into the build directory
sudo mkdir -p /usr/local/src
cd /usr/local/src

# download, build, and install pcre
sudo curl -OL ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
sudo tar xvzf pcre-8.38.tar.gz
cd pcre-8.38
sudo ./configure --prefix=/usr/local
sudo make
sudo make install
cd ..

# download, build, and install nginx
sudo curl -OL http://nginx.org/download/nginx-1.9.6.tar.gz
sudo tar xvzf nginx-1.9.6.tar.gz
cd nginx-1.9.6
sudo ./configure --prefix=/usr/local --with-cc-opt="-Wno-deprecated-declarations" --with-pcre=../pcre-8.38
sudo make
sudo make install

# start nginx
sudo /usr/local/sbin/nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment