Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Install nginx on Debian
#!/bin/bash
#
# Install nginx on Debian.
#
# Author : Scott Barr
# Date : 7 Jan 2010
#
VERSION=0.7.64
# install required packages
sudo apt-get install build-essential libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev sysv-rc-conf
cd /usr/local/src
if [ ! -f nginx-${VERSION}.tar.gz ]; then
wget http://nginx.org/download/nginx-${VERSION}.tar.gz
fi
if [ -d nginx-${VERSION} ]; then
rm -rf nginx-${VERSION}
fi
tar -zxf nginx-${VERSION}.tar.gz
cd nginx-${VERSION}
./configure \
--sbin-path=/usr/local/sbin \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_ssl_module \
--http-client-body-temp-path=/tmp/nginx_client \
--http-proxy-temp-path=/tmp/nginx_proxy \
--http-fastcgi-temp-path=/tmp/nginx_fastcgi
# --add-module='/usr/local/src/passenger-2.2.7/ext/nginx'
make
sudo make install
wget http://gist.github.com/raw/271062/0c90225766c62009010a8394f3cffc66da9e172a/nginx
sudo mv nginx /etc/init.d/nginx
sudo chmod u+x /etc/init.d/nginx
sudo /etc/init.d/nginx start
sudo sysv-rc-conf --level 2345 nginx on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment