How to Uninstall Apache Server

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.
Use a command line tool to remove the Apache HTTP Web Server software.
Image Credit: scanrail/iStock/Getty Images

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.

Advertisement

Uninstall from Windows

Video of the Day

Step 1

Type "command" in the Windows Charms bar Search box and then click the "Command Prompt" link when it appears, to open a terminal window.

Video of the Day

Step 2

Type the following command at the prompt and then press the "Enter" key to stop the Web service:

Advertisement

net stop apache2.2

Step 3

Type the following command and press "Enter" to change the working directory:

cd apache2\bin\

Advertisement

Step 4

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

Advertisement

Uninstall from Linux

Step 1

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

Advertisement

Advertisement

Step 2

Type the following command and press "Enter" to uninstall the Apache software.

sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common

Step 3

Type the following command and press "Enter" to uninstall any remaining dependencies.

Advertisement

sudo apt-get autoremove

Step 4

Type "whereis apache2" and press "Enter" to check for any remaining Apache files or directories. You can manually delete these remnants.

Advertisement

Advertisement

references

Report an Issue

screenshot of the current page

Screenshot loading...