So you want to remove Apache2 in favor of NGINX? You’ve come to the right place. This is a quick and to the point guide that should get you up and running with NGINX in no time. I am using Ubuntu 11.10 on a VPS, but this should work for most installations of Ubuntu. NOTE: This guide does not include how to install PHP. I did not need it so I did not end up installing it.
This first command will delete everything apache2 on the system. The second will delete the apache2 directory
The following commands will add NGINX’s repository so that you can install the most updated version.
1 2 3
If you get an error on the add-apt-repository command, execute the following command
Last thing we will need to do is to go to the configuration file for NGINX. It is located in
/etc/nginx/sites-available/default This section is only the first part of the config file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
You will need to change lines 5 and 6. Line 5 will need the path to the directory of your website, and line 6 will be the types of index files located in the directory, whether they are index.php, .html, .htm etc.
To restart NGINX and make your changes take effect, the command to restart the service is necessary.
There you have it. The simplest guide I can make that shows how to uninstall Apache2 and install NGINX.