Manually edit vhost file on WHM-Cpanel server

If you need to manually edit the vhost file on a server that is running WHM and cPanel then you need to edit the include files which are used to build the vhost file. The include files for each account are held in the following location:


The main file would be


Parked domains and subdomains are held in the "main" file in the same folder. For an account, "yourdomain" and the URL yourdomain,com you would edit:


After editing the file you need to run the following three commands to rebuild the vhost file.

/usr/local/cpanel/bin/apache_conf_distiller --update
/etc/init.d/httpd restart