Skip to content

Instantly share code, notes, and snippets.

@thurloat
Created November 23, 2011 12:11
Show Gist options
  • Save thurloat/1388525 to your computer and use it in GitHub Desktop.
Save thurloat/1388525 to your computer and use it in GitHub Desktop.
install nginx
#!/bin/sh
set -x
nginx_version=1.0.10
sudo apt-get install gcc
sudo apt-get install libpcre3-dev
sudo apt-get install libssl-dev
mkdir install_nginx && cd install_nginx
wget http://nginx.org/download/nginx-$nginx_version.tar.gz
tar zxvf nginx-$nginx_version.tar.gz
cd nginx-$nginx_version && ./configure --prefix=/usr/local/nginx-$nginx_version \
--with-sha1=/usr/lib \
--with-sha1-asm \
--with-http_ssl_module \
--with-http_gzip_static_module \
--user=milely \
--group=milely \
--conf-path=/etc/nginx/nginx.conf \
--http-log-path=/var/log/nginx/access_log \
--error-log-path=/var/log/nginx/error_log \
--pid-path=/var/run/nginx.pid \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \
--with-http_realip_module \
--with-http_stub_status_module && make && sudo make install
sudo ln -s /usr/local/nginx-$nginx_version /usr/local/nginx
sudo wget https://gist.github.com/raw/e6af197fa0bc65c9c076/260ac2a22a9bf4bee12bd5290baebc490da0dcd5/nginx -O /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults
mkdir /var/tmp/nginx
chown milely:milely /var/tmp/nginx
sudo mkdir /etc/nginx/sites-available
sudo mkdir /etc/nginx/sites-enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment