Informational Website publish


News about our company, tutorials about IT and much more you will find in this page.

How to rebuild httpd.conf when using cPanel/WHM

Janeiro 30th, 2018

The rebuild httpd conf (rebuildhttpdconf) Script

You can use the /usr/local/cpanel/scripts/rebuildhttpdconf script to rebuild Apache’s main configuration file.

Sometimes it can happen that your httpd.conf file got damaged, or you edited your file in a wrong way and now your Apache Web Server is unable to start, or even you just want to revert back to the default configuration. If you are using cPanel/WHM there is a way to rebuild the httpd.conf file using a simple shell script, and that is what you are going to learn in this tutorial.

/usr/local/cpanel/scripts/rebuildhttpdconf --preview --nolock


If the script succeeds, it will return output similar to the following example:

# /scripts/rebuildhttpdconf
info [rebuildhttpdconf] Missing IP for domain, using
info [rebuildhttpdconf] Missing ServerName for domain, using
info [rebuildhttpdconf] Missing port for domain, using 80
info [rebuildhttpdconf] Missing user for domain, using nobody
info [rebuildhttpdconf] Missing owner for domain, force lookup to root
info [rebuildhttpdconf] Missing group for domain, using nobody
Built /etc/apache2/conf/httpd.conf OK

Login to your server SSH with root access and run the following command to rebuild the httpd.conf file to it’s default configuration:

You should now be able to restart your Apache service via your cPanel/WHM panel with the newly rebuilt httpd.conf file!

That is all!