Permanently fixing broken subdomain

Oldiesmann

Active Member
Dec 30, 2008
30
0
56
Cincinnati, Ohio, USA
cPanel Access Level
Root Administrator
I've been having this problem off and on for close to a year now, but just now realized that cPanel was likely the cause.

I have three domains. When I moved from shared hosting to VPS, I decided to split each of the two addon domains to their own separate accounts just to make things easier to manage. However, I forgot to delete a subdomain from the original domain before doing this.

Original domain: Oldiesmann's ApologetiX Site
Subdomain in question: wiki.archiefans.com

This leads to wiki.archiefans.com basically being an alias for oldiesmann.us. My solution to this is to just edit httpd.conf to remove any references to wiki.archiefans.com, then re-add the subdomain from cPanel under the "archie" account.

However, I can't get it to stay this way, no matter how many httpd.conf and httpd.conf.bak files I edit. Every few months or so, the changes revert, and I have to spend 5-10 minutes editing httpd.conf again, then re-adding the subdomain.

I really don't want to go to the trouble of moving things back to an addon domain, then deleting the original subdomain, moving things back to a regular account and adding the subdomain again. Is there a way I can prevent cPanel from reverting these changes?
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Please consider submitting a support request; this will allow us to properly investigate and assist in determining the best resolution. Please let me know the ticket number when available so that I may review the specific details and follow-up internally. Thank you. :)
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Thanks for the suggestion. I've filed a support ticket. ID is 569602.
Thank you for the report and information. The ticket notes indicated that entries for the sub-domain were found in the cPanel users file and cPanel userdata for the account that was transferred (that owned the same sub-domain on the previous server). After ensuring that only one account contained entries for the sub-domain in the cPanel users file and cPanel userdata the issue was then alleviated. Please note that the Apache configuration of virtual hosts is built largely in part using information from cPanel userdata, thus it was necessary to ensure it was checked and corrected.

For reference, here are the two directory paths involved:
Code:
/var/cpanel/users/
/var/cpanel/userdata/
For the cPanel users file, here is an example path:
Code:
/var/cpanel/users/username
For cPanel userdata, here are a few example paths:
Code:
/var/cpanel/userdata/username/
/var/cpanel/userdata/username/main
/var/cpanel/userdata/username/domain.tld
/var/cpanel/userdata/username/domain.tld_SSL
Warning: Extreme caution must be exercised when auditing the aforementioned files and configuration data, ensuring to always save fresh backups before attempting any corrective measures.

Here are two different examples of how to save a fresh backup of the entire cPanel users directory and the entire cPanel userdata directory:

Save via an archival copy of the directory:
Code:
# cp -av /var/cpanel/users /var/cpanel/users_backup
# cp -av /var/cpanel/userdata /var/cpanel/userdata_backup
Save via a bzip2-compressed tar archive:
Code:
# cd /var/cpanel
# tar -cjvf users_backup.tar.bz2 users/
# tar -cjvf userdata_backup.tar.bz2 userdata/
 
Last edited: