Articles

Install nginx on Ubuntu 14.04

In howto on Jan 30, 2016 by theoryl Tagged: , , , ,

This is yet another guide about how to install nginx on Ubuntu 14.04. nginx is an open source web server that has recently gained popularity. It’s particularly well suited for serving static content.

nginx ver 1.4.6 is available from the official Ubuntu repository, so:

sudo apt-get install nginx

is all you have to do. The configuration file nginx.conf is located at /etc/nginx/nginx.conf. The default configuration is good enough so you don’t have to change anything there. To start serving a static site, just modify /etc/nginx/sites-enabled/default to set the ip address, the root directory, and the domain. See Ubunto nginx doc.

After that, reload nginx by doing either

sudo service nginx reload

or

sudo nginx -s reload

Put an index.html file in the root directory. Then, point your browser to the ip address to see it. Voila!

References:
* Ubuntu nginx doc: https://help.ubuntu.com/community/Nginx
* Official nginx doc: https://www.nginx.com/resources/admin-guide/serving-static-content/
* Introduction to Nginx and LEMP on Ubuntu 14.04 by Justin Ellingwood: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-14-04-lts

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: