How to Rebuild Apache Config (httpd.conf)

Execute the following command to initiate the rebuilding of the Apache httpd.conf file in cPanel:

/scripts/rebuildhttpdconf

This command reconstructs the httpd.conf file using cPanel templates located at /var/cpanel/templates/.

After the reconstruction, it is crucial to restart Apache to apply the changes. This can be done safely either within WHM (Web Host Manager) by navigating to:

Restart Services -> HTTP Server (Apache) -> Restart

Alternatively, you can use an SSH command:

/scripts/restartsrv_apache

If the above commands prove ineffective, attempt the following (note that the process may take 2-5 minutes):

yum reinstall ea-apache24-config-runtime -y

In case the reinstallation fails due to Imunify360's hardened PHP, particularly if it was previously installed, and you encounter an error similar to:

Installed package ea-apache24-config-runtime-2:1.0-191.el8.cloudlinux.noarch (from imunify360-ea-php-hardened) is not available.
Error: No packages marked for reinstall.

Resolve this issue by removing the package using:

rpm -e --nodeps ea-apache24-config-runtime

Then, reinstall the package to address the problem:

yum install ea-apache24-config-runtime -y
  • apache, httpd, centos, cpanel
  • 13 Users Found This Useful
Was this answer helpful?

Related Articles

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...

How to Secure a cPanel/WHM Web Server

Here are a few basic steps that you should keep in mind for keeping a server secure. 1) Strong...