Skip to content

Instantly share code, notes, and snippets.

@philiparthurmoore
Forked from Globegitter/nginx-latest.sh
Created October 26, 2015 03:11
Show Gist options
  • Save philiparthurmoore/3bff87ddfd2a267fa728 to your computer and use it in GitHub Desktop.
Save philiparthurmoore/3bff87ddfd2a267fa728 to your computer and use it in GitHub Desktop.

Revisions

  1. @markusdap markusdap revised this gist Sep 21, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Possibly easier but untested method to install nginx:
    # Automatically instal the latest nginx
    wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -

    #Make a backup copy of your current sources.list file
  2. @markusdap markusdap revised this gist Sep 21, 2014. 1 changed file with 14 additions and 5 deletions.
    19 changes: 14 additions & 5 deletions nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,23 @@
    # Possibly easier but untested method to install nginx:
    wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -

    #Now open ` /etc/apt/sources.list ` and add following repositories at the end
    #Make a backup copy of your current sources.list file
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

    deb http://nginx.org/packages/ubuntu/ trusty nginx
    deb-src http://nginx.org/packages/ubuntu/ trusty nginx
    #Now copy the following repositories to the end of ` /etc/apt/sources.list`
    echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
    echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list

    #If you want to use the 'stable' branch take:
    #echo "deb http://nginx.org/packages/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
    #echo "deb-src http://nginx.org/packages/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list

    ## Tested method to install the latest version of nginx ##
    ## If you follow the instructions below ignore above ##
    #update to get the new repository
    sudo apt-get update
    sudo apt-get install nginx

    ## Longer way ##
    ## Manually build and install the latest nginx ##

    #Install the PCRE library needed by nginx
    sudo apt-get install libpcre3 libpcre3-dev
  3. @markusdap markusdap revised this gist Sep 2, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -37,7 +37,9 @@ sudo chmod +x /etc/init.d/nginx
    # Add nginx to the system startup
    sudo /usr/sbin/update-rc.d -f nginx defaults

    ## Make sure to add the nginx.conf into /etc/init/nginx.conf
    # This automatically adds the nginx.conf from below into /etc/init/nginx.conf
    # If something doesn't work, just copy it manually
    sudo wget -O /etc/init/nginx.conf https://gist.github.com/Globegitter/685e3739c0f181bda3ec/raw/6ec0def52ed49d29b2f00cae70d28689371d0230/nginx.conf

    #This will make sure you get the following commands
    #sudo service nginx start
  4. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -43,4 +43,6 @@ sudo /usr/sbin/update-rc.d -f nginx defaults
    #sudo service nginx start
    #sudo service nginx stop
    #sudo service nginx restart
    #sudo service nginx status
    #sudo service nginx status

    ##Now you can modify your nginx.conf in /usr/local/nginx/conf
  5. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ deb-src http://nginx.org/packages/ubuntu/ trusty nginx


    ## Tested method to install the latest version of nginx ##
    ## If you follow these instructions ignore above ##
    ## If you follow the instructions below ignore above ##

    #Install the PCRE library needed by nginx
    sudo apt-get install libpcre3 libpcre3-dev
  6. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #Possibly easier but untested method:
    # Possibly easier but untested method to install nginx:
    wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -

    #Now open ` /etc/apt/sources.list ` and add following repositories at the end
    @@ -8,6 +8,7 @@ deb-src http://nginx.org/packages/ubuntu/ trusty nginx


    ## Tested method to install the latest version of nginx ##
    ## If you follow these instructions ignore above ##

    #Install the PCRE library needed by nginx
    sudo apt-get install libpcre3 libpcre3-dev
  7. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,14 @@
    #Possibly easier but untested method:
    wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -

    #Now open ` /etc/apt/sources.list ` and add following repositories at the end

    deb http://nginx.org/packages/ubuntu/ trusty nginx
    deb-src http://nginx.org/packages/ubuntu/ trusty nginx


    ## Tested method to install the latest version of nginx ##

    #Install the PCRE library needed by nginx
    sudo apt-get install libpcre3 libpcre3-dev

  8. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ sudo chmod +x /etc/init.d/nginx
    # Add nginx to the system startup
    sudo /usr/sbin/update-rc.d -f nginx defaults

    ##Make sure to add the nginx.conf into /etc/init/nginx.conf
    ## 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
  9. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ 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
    #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
    @@ -25,7 +25,7 @@ sudo chmod +x /etc/init.d/nginx
    # Add nginx to the system startup
    sudo /usr/sbin/update-rc.d -f nginx defaults

    ##make sure to add the nginx.conf into /etc/init/nginx.conf
    ##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
  10. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,18 @@ make

    sudo make install

    #make sure to add the nginx.conf into /etc/init/nginx.conf
    # Download nginx startup script
    wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh

    # Move the script to the init.d directory & make executable
    sudo mv init-deb.sh /etc/init.d/nginx
    sudo chmod +x /etc/init.d/nginx

    # Add nginx to the system startup
    sudo /usr/sbin/update-rc.d -f nginx defaults

    ##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
  11. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -13,4 +13,11 @@ cd nginx-1.7.4

    make

    sudo make install
    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
  12. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 24 additions and 0 deletions.
    24 changes: 24 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    #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
  13. @markusdap markusdap revised this gist Aug 30, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion nginx-latest.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,8 @@ tar -xvf nginx-1.7.4.tar.gz

    cd nginx-1.7.4

    ./configure
    ##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

  14. @markusdap markusdap renamed this gist Aug 30, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  15. @markusdap markusdap created this gist Aug 30, 2014.
    15 changes: 15 additions & 0 deletions nginx-latest
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #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

    ./configure

    make

    sudo make install