The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Forgot to set FQDN

Discussion in 'General Discussion' started by UKDirectHost, Feb 9, 2011.

  1. UKDirectHost

    UKDirectHost Registered

    Joined:
    Feb 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
  3. UKDirectHost

    UKDirectHost Registered

    Joined:
    Feb 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Sorry, I tried that twice already.

    restarted cpanel, changed hostname via ssh as well as whm
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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?
     
  5. UKDirectHost

    UKDirectHost Registered

    Joined:
    Feb 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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:
    root@mail [/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.
     
Loading...

Share This Page