Ubuntu 12.04 - Install Nginx

Introduction

Nginx is used for one main reason, speed. It's ability to handle multiple clients per thread, through the use of non-blocking IO, allows it to perform much better than Apache when handling thousands of requests at a time. The task of installing nginx is actually so incredibly simple on Ubuntu 12.04 that it doesn't really need a tutorial, but here goes.

    To install nginx version 1.1.19 run this command (for version 1.4.2 skip this step):
    sudo apt-get update && sudo apt-get install nginx -y
    To install a more up-to-date version (1.4.2) instead, run these commands:
    sudo apt-get install python-software-properties -y
    sudo add-apt-repository ppa:nginx/stable
    sudo apt-get update && sudo apt-get install nginx -y
    You will get the following warning message:
    Don't worry, Ubuntu 12.04 is the 'Precise' distribution anyway.
    Start the nginx service as it does not start automatically.
    sudo service nginx start
    Ensure your nginx service starts up automatically after boot.
    update-rc.d nginx defaults

    Note: it's perfectly okay to see the following message:

    System start/stop links for /etc/init.d/nginx already exist.
    For all you apache users out there, the default location for your web files is not /var/www with nginx. It is actually at:
    /usr/share/nginx/www

References

No comments:

Post a Comment