UKDirectHost

Registered
Feb 9, 2011
3
0
51
Hey all, I setup cpanel today on a server, something that I have done numerous times before.

Unfortunately, I was in a rush, and forgot to change the hostname to a FQDN.
Remembered halfway through, so I changed it after cPanel install.

Logged in via :2087 and went through the wizard, set A records, etc.

Hostname shows the correct one I set, DNS edit zones shows same, however, if I go to IP Usage, it still shows the original one, which was localhost.localdomain

How do I change this again?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

You could simply do WHM > Change Hostname and change it again. Even if it shows the full hostname there, it should reset it properly.

Thanks.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Can you check /var/cpanel/userdata/nobody location to see what is listed in main file for the domain name there? If it is not the right one, then put the right name as well as copying the localhost.localdomain file at /var/cpanel/userdata/nobody/ location to the new domain name and replacing the entries to match the new hostname.

After correcting the entries, then do the following:

Code:
cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110209
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart
Also, can you take a screen print of what you are seeing in WHM?
 

UKDirectHost

Registered
Feb 9, 2011
3
0
51
Ok, tried to upload screenshot, but it kept on failing. What I was seeing was the following:

In Show IP Address Usage:


Ip Address Http Usage Ftp Usage Mail Usage
XX.xX.XX localhost.localdomain

So I did the following as per your suggestion:

cd /var/cpanel/userdata/nobody
"ls" showed the following files:

main main.cache

So, using nano:

Code:
nano main
I found the following:

Code:
---
addon_domains: {}

main_domain: localhost.localdomain
parked_domains: []

sub_domains: []
So I edited the localhost.localdomain to the FQDN I wanted, saved. Then Ran
Code:
/scripts/rebuildhttpdconf
This gave me the following errors:
Code:
[email protected] [/var/cpanel/userdata/nobody]# /scripts/rebuildhttpdconf
info [rebuildhttpdconf] Missing IP for domain MUNGED DOMAIN, using xxx.xxx.xxx.xxx
info [rebuildhttpdconf] Missing port for domain MUNGED DOMAIN, using 80
info [rebuildhttpdconf] Missing user for domain MUNGED DOMAIN, using nobody
info [rebuildhttpdconf] Missing group for domain MUNGED DOMAIN, using nobody
info [rebuildhttpdconf] Missing ServerName for domain MUNGED DOMAIN, using MUNGED DOMAIN
info [rebuildhttpdconf] Missing IP for domain MUNGED DOMAIN, using XXX.XXX.XXX.XXX
info [rebuildhttpdconf] Missing port for domain MUNGED DOMAIN, using 80
info [rebuildhttpdconf] Missing user for domain MUNGED DOMAIN, using nobody
info [rebuildhttpdconf] Missing group for domain MUNGED DOMAIN, using nobody
info [rebuildhttpdconf] Missing ServerName for domain MUNGED DOMAIN, using MUNGED DOMAIN
Built /usr/local/apache/conf/httpd.conf OK
Note: I've changed FQDN with munged domain and my IP with xx.xx.xxx

then as per your instruction I did:
Code:
/etc/init.d/httpd restart
Hit reload on WHM and navigated to show IP usage and voila, the correct FQDN is now showing instead of localhost.localdomain

Thank you very much for your help. Hopefully if someone else has this problem, this post will help them.