Skip to content

Instantly share code, notes, and snippets.

@scottjbarr
Created January 12, 2010 03:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save scottjbarr/274883 to your computer and use it in GitHub Desktop.
Save scottjbarr/274883 to your computer and use it in GitHub Desktop.
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