Remove Apache2 from linux server

Here we are,

I’m leaving Apache for Nginx which is a faster asynchronous http server.
If you need more informations about it, please go here http://www.wikivs.com/wiki/Apache_vs_nginx.

So, to start with a clean base, I’ve had to first remove apache from my server, this is how to deal with it.

//Stop apache server
sudo service apache2 stop 

//Uninstall Apache2 and its dependent packages
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common

//By precaution
apt-get purge apache2

//remove any other dependencies that were installed with Apache2, but are no longer used by any other package
sudo apt-get autoremove

//Delete apache2 directory manually
sudo rm -rf /etc/apache2

Thank you for reading.

Remove Apache2 from linux server

Debian // Could not reliably determine the server’s fully qualified domain name

When you try restarting your apache server and get this error:

    [....] Restarting web server: apache2apache2: apr_sockaddr_info_get() failed for "yourdomain"
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

 

You have this error because you didn’t specified the server name to which your web server will respond to.

To solve this, open “/etc/apache2/apache2.conf” file.

    nano /etc/apache2/apache2.conf

 

Add at the end of the file, add a server name

    ServerName "yourdomain.com"

 

Now restart your apache server:

    service apache2 restart

 

PS: If you’re not admin, use “sudo” command before any of these instructions.
That’s all :).

Debian // Could not reliably determine the server’s fully qualified domain name