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