Skip to content

Instantly share code, notes, and snippets.

@insoul
Created March 26, 2012 09:29
Show Gist options
  • Save insoul/2204161 to your computer and use it in GitHub Desktop.
Save insoul/2204161 to your computer and use it in GitHub Desktop.
install nginx
#!/bin/sh
set -x
nginx_version=1.0.9
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=awteam \
--group=awteam \
--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
# https://gist.github.com/2204077/5ed76a26bd9bc75b535a49fb6064fe13846235ff
sudo wget https://raw.github.com/gist/2204077/01e3c4337e0f6d13b60642fbe84d9765c544303e/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 awteam:awteam /var/tmp/nginx
sudo mkdir /etc/nginx/sites-available
sudo mkdir /etc/nginx/sites-enabled
sudo wget https://raw.github.com/gist/1153356/3fa3b0eaef30402bcd05edf1baa1e79131b59116/nginx.conf -O /etc/nginx/nginx.conf
sudo wget https://raw.github.com/gist/1153361/c44ac59a34e3bc3a0bd74925f492344e809cc026/example_rack_app -O /etc/nginx/sites-available/example
echo 'Don'\''t forget '\''sudo ln -s /etc/nginx/sites-available/example /etc/nginx/sites-enabled/example'\'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment