CentOS/RHEL:How To Uninstall Apache service
This article will guide you how to uninstall apache service on you centos or rhel system. if you setup apache server on you system, then you want to uninstall it. How Do I uninstall Apache service under centos or rhel operating system.
You need to remove all httpd* packages on your apache server,but before uninstalling it, you should be better to backup your old apache DocumentRoot content.
CentOS Uninstall Apache service
Type the following command to remove all httpd* and corresponding packages:
yum erase httpd httpd-tools apr apr-util
outputs:
[root@devops Desktop]# yum erase httpd httpd-tools apr apr-util Loaded plugins: fastestmirror, langpacks Resolving Dependencies --> Running transaction check ---> Package apr.x86_64 0:1.4.8-3.el7 will be erased --> Processing Dependency: libapr-1.so.0()(64bit) for package: subversion-1.7.14-6.el7.x86_64 --> Processing Dependency: libapr-1.so.0()(64bit) for package: subversion-libs-1.7.14-6.el7.x86_64 ---> Package apr-util.x86_64 0:1.5.2-6.el7 will be erased ---> Package httpd.x86_64 0:2.4.6-18.el7.centos will be erased --> Processing Dependency: httpd-mmn = 20120211x8664 for package: php-5.4.16-23.el7_0.3.x86_64 ---> Package httpd-tools.x86_64 0:2.4.6-18.el7.centos will be erased --> Running transaction check ---> Package php.x86_64 0:5.4.16-23.el7_0.3 will be erased ---> Package subversion.x86_64 0:1.7.14-6.el7 will be erased ---> Package subversion-libs.x86_64 0:1.7.14-6.el7 will be erased --> Finished Dependency Resolution Dependencies Resolved ================================================================== Package Arch Version Repository Size ================================================================== Removing: apr x86_64 1.4.8-3.el7 @anaconda 221 k apr-util x86_64 1.5.2-6.el7 @anaconda 194 k httpd x86_64 2.4.6-18.el7.centos @updates 9.3 M httpd-tools x86_64 2.4.6-18.el7.centos @updates 168 k Removing for dependencies: php x86_64 5.4.16-23.el7_0.3 @updates 4.4 M subversion x86_64 1.7.14-6.el7 @anaconda 4.6 M subversion-libs x86_64 1.7.14-6.el7 @anaconda 2.5 M Transaction Summary ================================================================== Remove 4 Packages (+3 Dependent packages) Installed size: 21 M Is this ok [y/N]: y .... complete!
Then you can use the following command to check if httpd* packages are uninstalled,type:
rpm -qa | grep httpd
done…