How to disable httpd on RHEL and CentOS servers

I installed nginx on RHEL 8 server. But boot time Apache (HTTPD) starting. How can I disable httpd without deleting package on boot time? Same problem with CentOS 8 test server.

Disabling HTTPD is simple. Type the following commands to disable HTTPD (Apache 2 webserver) on RHEL or CentOS Enterprise Linux server

  1. Mask httpd service i.e. completely disable it so that no other service can activate httpd:
    sudo systemctl mask httpd
  2. Disable the httpd service
    sudo systemctl disable httpd
  3. Stop running httpd service
    sudo systemctl stop httpd

See my guide


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki