Fully uninstall Apache2 from Ubuntu

Source: Internet
Author: User
One-click installation, very simple apt-getinstallapache2 these two days want to configure a lighttpd, but has been unable to succeed, today in the company with the Virtual Machine Ubuntu configuration lighttpd succeeded, it is suspected that something in conflict with apache2. You are about to uninstall apache2 and reconfigure lighttpd. Result & ldquo; after uninstalling & rdquo;, restart and access http: // loc.

One-click installation during installation is simple

Apt-get install apache2

I want to configure a lighttpd in the past two days, but it has never been successful. Today I have successfully configured lighttpd with Ubuntu in the company's virtual machine. I suspect it is in conflict with something in apache2.

You are about to uninstall apache2 and reconfigure lighttpd. After the result is "uninstalled", restart it and access http: // localhost is still accessible. Have you uninstalled it ?!

Enter apache2 in the terminal, and the prompt is not installed. Run apt-get remove apache2, and the prompt is still not installed. Ah!

I suddenly thought that some "apache2" was not uninstalled ???

Thus, run

Apt-get remove apache *

Undoubtedly, for a long message, enter y and press Enter. Then access localhost again,

Bad! Google Chrome cannot connect to localhost
Suggestion:
Go to localhost. net
Enter localho. ­ st
Enter localhostr. com
Try to reload: localhost
Search on Google:

Haha, it looks like it succeeded.

 

It should be the reason why apache2 is still "contributing" because it is not completely deleted.

---------------------------------------------- Split line ----------------------------------------------

Recently, I have been changing projects. I am working on the environment, deleting unnecessary items, and sometimes loading errors. Below I will post the complete uninstall command of apache2 for your reference!

1. Delete apache

Code:

$ Sudo apt-get -- purge remove apache-common

$ Sudo apt-get -- purge remove apache

2. Find and delete the configuration file that has not been deleted.

Code:

$ Sudo find/etc-name "* apache *" | xargs rm-rf

$ Sudo rm-rf/var/www

$ Sudo rm-rf/etc/libapache2-mod-jk

3. Delete the association so that you can use apt-get install apache2 to reinstall it again.

# Dpkg-l | grep apache2 | awk '{print $2}' | xargs dpkg-P

My OK! You can try it !!!

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.