Skip to content

Instantly share code, notes, and snippets.

@toddsby
Last active March 6, 2018 16:25
Show Gist options
  • Save toddsby/d3d68f3953bd00c9f0976f822b1ec016 to your computer and use it in GitHub Desktop.
Save toddsby/d3d68f3953bd00c9f0976f822b1ec016 to your computer and use it in GitHub Desktop.
osx mavericks - build nginx 1.10.3 from source - with http2
#!/bin/bash
# Build Nginx 1.10.3 on Mac OS X Mavericks (10.9)
# This script was created by Kevin Worthington - http://kevinworthington.com/ - 28 October 2013
# Original article at: http://kevinworthington.com/nginx-for-mac-os-x-yosemite-in-2-minutes/
# Modifed by Drew Toddsby - 2 February 2017
# 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 nginx
cd nginx-1.10.3
sudo ./configure --prefix=/usr/local --with-cc-opt="-Wno-deprecated-declarations" --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-pcre=../pcre-8.40
sudo make
sudo make install
# start nginx
sudo /usr/local/sbin/nginx
@toddsby
Copy link
Author

toddsby commented Feb 25, 2017

# Create /usr/local/src
mkdir -p /usr/local/src
# Download pcre 
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
# untar pcre
tar -xvf pcre-8.40.tar.gz && cd pcre-8.40
# configure pcre 
sudo ./configure --prefix=/usr/local
## configure with openssl
sudo ./configure --with-openssl=/usr/local/src/openssl-1.0.2k
# make and make install
sudo make
sudo make install
# Download latest openssl 
wget http://www.openssl.org/source/openssl-1.0.2k.tar.gz
# untar openssl
tar -xvf openssl-1.0.2k.tar.gz && cd openssl-1.0.2k
# Download nginx
wget http://nginx.org/download/nginx-1.10.3.tar.gz
# Create scripts folder in home directory
mkdir -p ~/scripts
# Copy script above and paste into
pico ~/scripts/osx-nginx-1.10.3-w-h2.sh
# Add execute perms to bash script
chmod +x  osx-nginx-1.10.3-w-h2.sh

@toddsby
Copy link
Author

toddsby commented Mar 1, 2017

added gzip_static module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment