Skip to content

Instantly share code, notes, and snippets.

@Mbitzg
Forked from Globegitter/nginx-latest.sh
Last active August 29, 2015 14:25
Show Gist options
  • Save Mbitzg/c283eafe9cd5ea17b172 to your computer and use it in GitHub Desktop.
Save Mbitzg/c283eafe9cd5ea17b172 to your computer and use it in GitHub Desktop.
Install the latest nginx from source for Ubuntu 14.04
#Install the PCRE library needed by nginx
sudo apt-get install libpcre3 libpcre3-dev
#Replace by the latest version number found on http://nginx.org/
wget http://nginx.org/download/nginx-1.7.4.tar.gz
tar -xvf nginx-1.7.4.tar.gz
cd nginx-1.7.4
##these flags make sure to put nginx somewhere that is usuall in PATH and to activate the https module
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
make
sudo make install
#make sure to add the nginx.conf into /etc/init/nginx.conf
#This will make sure you get the following commands
#sudo service nginx start
#sudo service nginx stop
#sudo service nginx restart
#sudo service nginx status
#nginx
description "nginx http daemon"
author "Philipp Klose <me@'thisdomain'.de>"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/local/sbin/nginx
env PID=/usr/local/nginx/logs/nginx.pid
expect fork
respawn
respawn limit 10 5
#oom never
pre-start script
$DAEMON -t
if [ $? -ne 0 ]
then exit $?
fi
end script
exec $DAEMON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment