I was having some problem with one of my VPS recently running Ubuntu 14.04 to host BitcoinDark block chain explorer. Every time server restarts it starts using Nginx server instead of the Apache2. When I wanted to uninstall it using sudo apt-get remove nginx
nothing happened as the terminal is replying that this package is not installed. However, I’m able to stop the service and restart Apache2. Once it restarts it goes back again. Today I started looking into it and found that somehow I’ve got nginx-core
package installed, that is the reason earlier nginx removing command didn’t work. In this article I will explain the steps I have taken to completely remove Nginx from my system and re-activate Apache2 server on Ubuntu 14.04 server. This is a little note to myself as well, if I mess it up again in the future.
# Stopping Nginx service
sudo service nginx stop
# Removing only Nginx
sudo apt-get remove nginx
# Remove only Nginx-core
sudo apt-get remove nginx-core
# Completely remove Nginx package
sudo apt-get remove nginx-* sudo apt-get purge nginx-*
# If you don’t have Apache2 installed in your system use this command. If Apache2 is installed then skip to the next step.
sudo apt-get install apache2
# Restart / re-activate Apache2
sudo apache2ctl restart
Nginx server has been completely removed and Apache2 restarted and it should be fully working as you set it up.