About how to install apache and linuxapache after uninstalling apache in linux
Facts show that good memory is not as bad as a pen, not to mention that there is no good memory, so we need to make some necessary records, because as time passes, many things will gradually be forgotten, now, if you take a look at the previous notes, you can get twice the result!
In the past, a system monitoring software zabbix was configured in linux. The overall use of zabbix is good. Because it needs to be displayed on the webpage, a lamp environment needs to be set up, then configure apache2 to enable the local webpage to display the page as the home page, which will not be touched and recorded. The configuration files and information at that time were forgotten, and later I made a chat, I found that the apache service could not run. I opened the configuration file and found that it was empty without any information. So I started to reinstall apache2.
For the first time, simply remove and install apache2. When it was started, it was found that the startup failed or the configuration file was empty. So I searched the internet and solved the problem, next, we will integrate the online methods.
First, run the following commands:
Sudo apt-get -- purge remove apache2
Sudo apt-get -- purge remove apache2.2-common
Sudo apt-get autoremove
Then, find the configuration file that has not been deleted and delete it together.
Sudo find/etc-name "* apache *"-exec rm-rf {}\;
Sudo rm-rf/var/www
After running the preceding command, you may need to delete the information about the mysql database. Anyway, I first unmount all the databases before running the preceding command, I don't know if I can't uninstall mysql. I just wrote down the uninstalling mysql operation first.
- SudoApt-getAutoremove-- PurgeMysql-server-5.0
- SudoApt-getRemoveMysql-server
- SudoApt-getAutoremoveMysql-server
- SudoApt-getRemoveMysql-common// This is very important
Sudo apt-get install mysql-server (reinstall)
In fact, I have long wanted to reinstall the mysql database. I didn't know why I forgot the password of the root user during the previous installation. Then, the tragedy occurs. After the reinstallation is complete, you will be asked to enter the password of the root user, then I lost my frequently used password. However, after opening the database, you can find that the previously created tables and databases are still there. It may be because the data has not been deleted, but this is also good. You do not need to create a new table or database.
Finally, reload apache2, run sudo apt-get install apache2, and then install apache2. After you open the configuration file, it will be initialized, and then enter localhost in the browser, it works indicates that apache has been installed, provided that you have installed the LAMP environment.
Apache already exists in linux. I want to reinstall it and uninstall it.
Update to overwrite the new version.
How can I uninstall apache in Linux?
To delete a file, you must first find out how it is installed.
Install a software. You can use opt-get (commonly used in ubuntu), rpm package (frequently used in redhat), or source code installation (professional usage)
You can easily Delete opt-get and rpm commands by checking their respective deletion commands. Generally, there is no problem.
If the source code is installed, you can directly find the file to delete it (linux does not have a registry or something, directly delete it)
If you don't understand and want to solve this problem quickly, you can find someone to solve it. Otherwise, you should first learn the basic commands, learn a little about linux, and then perform operations.
In fact, no matter how apache is installed, you can use the source code to install another one. You do not need to delete it, as long as it is not started. It is emphasized that the source code is installed because it is free. If you use RPM, it will prompt that you have installed apache.