About Linux under uninstall Apache after installing Apache

Source: Internet
Author: User

Facts show that good memory is inferior to bad writing, not to mention that there is no good memory on the need to do some necessary records, because with the passage of time, a lot of things will gradually forget, then if you look at the notes before you can do more with less!


Previously configured under Linux a system monitoring software Zabbix, the overall use is also good, because the need to display on the web side, so need to set up the lamp environment, and then configure APACHE2 to open the local page to display that as the home page, no longer touched, and did not record, At that time the configuration files and information has been forgotten, and later messed up a pass, found that the Apache service can not run, open the inside of the configuration file found inside are empty, there is no information, so I started the apache2 reload.


The first simple remove and then install Apache2, start to find the error can not start, the configuration file or empty, so to search the internet, solve the problem, the next online method integration.


First, run a few commands:

sudo apt-get--purge Remove apache2
sudo apt-get--purge Remove Apache2.2-common
sudo apt-get autoremove


Then, locate the profile that was not deleted and delete it.

sudo find/etc-name "*apache*"-exec rm-rf {} \;

sudo rm-rf/var/www


After running the above command, you may also need to delete the MySQL database information, anyway, I am the database all unloaded before running the above command, do not uninstall the MySQL line I do not know, first uninstall MySQL operation written down.

    1. sudo apt-get autoremove --purge mysql-server-5.0
    2. sudo apt-get remove mysql-server
    3. sudo apt-get autoremove mysql-server
    4. sudo apt-get remove mysql-common //This is important
sudo apt-get install mysql-server (reload)

In fact, I would like to re-install the MySQL database, the previous time did not know why the root user password forgotten, and then tragedy, after the reload will let you enter the root user password, and then I lost my common password. But open the database later found that the previously built tables and database is still in, it may be the data is not deleted, but this is good, do not have to re-create the table and database.


Finally reinstall the APACHE2, run the sudo apt-get install apache2, and then you can install, open the configuration file to see is initialized, and then enter localhost in the browser, found it works show that Apache installation is complete, Of course, the premise is that you have installed the lamp environment.



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.