How to uninstall Apache on Centos 8
- Last updated: Nov 3, 2023
- Views: 326
- Author: Admin
In today's article, we will talk about how you can quickly and safely remove the Apache web server from your Linux server, in our case it will be Centos 8 Stream.
If you have the Apache web server installed and running on your system, then if you want to install some other web server such as Nginx or OpenLiteSpeed, you will get an Address already in use error. This error means that ports 80 or 443 are already occupied by the Apache web server and another web server simply cannot use these ports.
Of course, you can use other ports for other web servers, but this is not the best idea, and it is better to simply remove the web server that you do not need.
The first thing we will start with is to stop the Apache web server and remove it from startup.
Apache web server stop command:
$. systemctl stop httpd
The command to remove the Apache web server from startup:
$. systemctl disable httpd
In the second step, we will remove Apache itself, for this we will execute a simple command:
$. dnf remove httpd
As a last step, we will remove the remaining directories that are said to Apache:
$. sudo rm -Rf /etc/httpd/*
Done, we have successfully removed the Apache web server from our system.
Thank you all, I hope my article was of some help to you.