Skip to content

Instantly share code, notes, and snippets.

@chriswain
Last active August 18, 2016 16:56
Show Gist options
  • Save chriswain/615889c5903edbe5031f3d6b081c3369 to your computer and use it in GitHub Desktop.
Save chriswain/615889c5903edbe5031f3d6b081c3369 to your computer and use it in GitHub Desktop.
install nginx on ubuntu 16.04
do-release-upgrade // run this if ubuntu is not at current version
sudo apt-get update
sudo wget http://nginx.org/keys/nginx_signing.key //get signing key to be able to use nginx repo
// make sure enablednshostnames and enablednssupport is set to yes or next line will not work
sudo apt-key add nginx_signing.key add signing key
// add the sources from where the nginx packages can be obtained
sudo vi /etc/apt/sources.list
//add thes lines to sources
//this is for stable version add mainline after packages for opensource most up to date version
deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx
//after you have saved previous file
sudo apt-get remove nginx-common
sudo apt-get update
sudo apt-get install nginx
//run nginx
sudo nginx
//verify nginx is running
curl -I 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment