How to Uninstall Apache Server
The Apache HTTP Web server software is installed using the standard installation procedures for both Linux and Windows operating systems. However, you cannot uninstall the server software using the standard methods of software removal for each of the respective operating systems. You must first stop the Apache Web service from the command line in both Windows and Linux or the removal operation will fail. You can then run a special command to remove the server application and all configuration files.
Uninstall from Windows
Type “command” in the Windows Charms bar Search box and then click the “Command Prompt” link when it appears, to open a terminal window.
Type the following command at the prompt and then press the “Enter" key to stop the Web service:net stop apache2.2
Type the following command and press “Enter” to change the working directory:cd apache2\bin\
Type the following command and press “Enter” to uninstall the Apache software and configuration files. The "-k" operation is used to stop, restart and uninstall the Apache service.httpd.exe -k uninstall
Uninstall from Linux
Open a terminal window and then type the following command at the prompt to stop the Apache service. Press “Enter.” Type your password when prompted.sudo service apache2 stop
Type the following command and press “Enter” to uninstall the Apache software. sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
Type the following command and press “Enter” to uninstall any remaining dependencies. sudo apt-get autoremove
Type “whereis apache2“ and press “Enter” to check for any remaining Apache files or directories. You can manually delete these remnants.
Tips & Warnings
- Attempting to uninstall Apache using the Windows Control Panel will result in an incomplete removal of the application. You must use the removal process specified in the steps.
- Information provided in these steps applies to Apache HTTP Server, version 2.2 for Windows and version 2.x for Linux distributions using APT to manage packages. Instructions may vary for other versions of Apache or other package-management solutions.
- Removal of Apache Server software may affect other processes, services or applications. Uninstall the software with care.