Everytime rebuild httpdconf, a sub domain missing.

sodapopinski

Well-Known Member
Aug 13, 2001
90
2
308
In one server, there's an account let's say abc.com and it's sub domain let's say http://subdomain.abc.com
Everytime I restore other account (some new client want their files restored automatically) which is mean cpanel run rebuild httpdconf script, the http://subdomain.abc.com config always missing from httpd.conf, I should add it manually.

Any idea why it happened and how to fix it permanently?

Thanks alot in advance.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Even distilling httpd.conf will not allow VirtualHost entries to be kept in that file. This is because the VirtualHost sections are built from /var/cpanel/userdata location. VirtualHost entries cannot be manually added to /usr/local/apache/conf/httpd.conf file. When you do add them manually, they won't be maintained on httpd.conf rebuilds. This is why the following appears above each of the VirtualHost entries:

# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
The distiller is only intended to be used for entries that build the /var/cpanel/conf/apache/main file. The VirtualHost sections are not in that file. Entries such as MaxClients and ServerAliasMatch are in that file.

To correct the subdomain entry missing, it would either need to be added in /var/cpanel/userdata/username/sub.domain.com and /var/cpanel/userdata/username/main files, or added via an include in either /usr/local/apache/conf/includes/post_virtualhost_global.conf location or /usr/local/apache/conf/userdata/std/2/username location. Please note that username is the cPanel username, while sub.domain.com is the subdomain's name for all instances of those mentioned.