git clone https://gist.github.com/2312669.git nginx-build
cd nginx-build
./build.sh
Last active
October 2, 2015 20:18
-
-
Save rafaelss/2312669 to your computer and use it in GitHub Desktop.
Script to build nginx with some modules configured
This file contains 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
#!/usr/bin/env bash | |
version="1.5.10" | |
pcre_version="8.34" | |
set -e | |
rm -rf nginx-$version* | |
# download nginx | |
wget http://nginx.org/download/nginx-$version.tar.gz | |
tar -zxvf nginx-$version.tar.gz | |
# compile pcre | |
cd nginx-$version/contrib | |
wget -O pcre-$pcre_version.tar.gz "http://downloads.sourceforge.net/project/pcre/pcre/$pcre_version/pcre-$pcre_version.tar.gz?r=&ts=1367323585&use_mirror=ufpr" | |
tar -zxvf pcre-$pcre_version.tar.gz | |
# clone extensions | |
cd .. | |
mkdir ext | |
cd ext | |
git clone --depth 1 git://github.com/simpl/ngx_devel_kit.git | |
git clone --depth 1 git://github.com/agentzh/set-misc-nginx-module.git | |
git clone --depth 1 git://github.com/agentzh/nginx-eval-module.git | |
git clone --depth 1 git://github.com/agentzh/echo-nginx-module.git | |
git clone --depth 1 git://github.com/chaoslawful/lua-nginx-module.git | |
# configure | |
cd .. | |
./configure --prefix=/opt/nginx --with-http_ssl_module \ | |
--without-http_autoindex_module \ | |
--without-http_geo_module \ | |
--without-http_scgi_module \ | |
--without-http_ssi_module \ | |
--without-http_uwsgi_module \ | |
--with-http_gzip_static_module \ | |
--with-http_spdy_module \ | |
--with-http_stub_status_module \ | |
--add-module=ext/ngx_devel_kit \ | |
--add-module=ext/set-misc-nginx-module \ | |
--add-module=ext/echo-nginx-module \ | |
--add-module=ext/lua-nginx-module \ | |
--with-pcre=contrib/pcre-$pcre_version | |
make | |
sudo make install | |
# cleanup | |
cd .. | |
rm -rf nginx-$version* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment