I have heard Nginx for several years and finally i got the motive to start playing with it. Here the steps to install Nginx on Ubuntu 12.04.01 LTS server (Ubuntu Precise).
1. Update the repositories with the root privilege.
2. Install Nginx.
apt-get install nginx
3. Unlike Apache, the default Nginx webroot is located @ /usr/share/nginx/www. I would like to move the webroot directory to /srv/www.
cd /srv mkdir www chown -R www-data:www-data /srv/www chmod -R 775 /srv/www
4. The www-data user and group are automatically created after the Nginx installation. Next, we go to /etc/nginx where you could find the nginx.conf. Like Apache, Nginx also has the sites-available and sites-enabled folders for managing the VirtualHost.
6. Create the /srv/www/index.html.
<h1>Hello Nginx! - <a href="http://eureka.ykyuen.info">Eureka!</a></h1>
7. Reload the Nginx config using the following command.
9. Nginx does not come with commands like a2ensite and a2dissite in Apache for managing VirtualHost. If you want to add new VirtualHost, you need to create the symbolic link in the /etc/nginx/sites-enabled folder.
ln -s /etc/nginx/sites-available/<virtualhost-file> /etc/nginx/sites-enabled
10. Reload the Nginx for the new settings to take effect. On the other hand if u want to remove the VirtualHost, just remove the symbolic link in /etc/nginx/sites-enabled.