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.

Cpanel keep using old hostname

Discussion in 'General Discussion' started by taydu, Feb 2, 2009.

  1. taydu

    taydu Member

    Joined:
    Oct 4, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    when the server first set up the host name was

    oldhost.providerx.com

    i then change the host to a fully qualify domain

    newhost.domainxyz.com

    I mannually check everything and it has update to the new host (newhost.domainxyz.com)

    when i login whm via http://ip.address/whm it redirect me too

    https://oldhost.providerx.com:2087 (and get error page)

    shouldn't it be

    https://newhost.domainxyz.com:2087 ???

    btw i have this option enable in whm

    Always redirect users to the ssl/tls ports when visiting /cpanel, /webmail, etc.

    what i'm i missing and how to fix this error?

    i also reboot the server to make sure every thing take change but still get that

    thanks
     
    #1 taydu, Feb 2, 2009
    Last edited: Feb 2, 2009
  2. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    I recommend rebuilding apache's config. After changing the hostnames about they'll probably find a bunch of left-overs in that file.

    Edit /usr/local/apache/conf/httpd.conf and look for occurances of your old hostname, or run
    /scripts/rebuildhttpdconf

    (Make sure /etc/wwwacct.conf has the right hostname before you do a rebuild of apache's config file though...).

    :) Hope it helps.
     
  3. taydu

    taydu Member

    Joined:
    Oct 4, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    i tried your suggestion and rebuilt the config file but still facing the same problem.

    any other suggestion on how to fix this problem ???

    thank you
     
  4. webenthusiast

    webenthusiast Member

    Joined:
    Aug 29, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    If the error you are speaking of is related to using ssl, then reloading the self signed ssl certs in manage service ssl certificates might help.
     
  5. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    What just about to suggest this.

    [Edit:] In case you are a little lost with the exact steps, it should be as simple as logging into WHM (use the IP of the server if you keep getting redirected incorrectly).
    Service Configuration -> Manage Service SSL Certificates
    On this page, Click "Reset Certificate" for each service listed there.
    You "may" need to generate the new certificate before hitting reset, but I don't think you will.
    See how you go.
     
    #5 darren.nolan, Feb 2, 2009
    Last edited: Feb 2, 2009
  6. accy

    accy Registered

    Joined:
    Jan 12, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    No, you don't. That feature regenerate a self-signed certifcate for selected service wiping any certificates you have previously installed!
     
  7. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    That's the idea. If your certificates have been generated for abc.domain.com - but your server isn't called abc.domain.com anymore you'll run into problems (cause the two don't match anymore...)

    Under tweak options in WHM, you'll see redirection on accessing /cpanel or /whm via SSL - usually redirects to the security certificate domain - not always what you enter.
     
  8. VanBond007

    VanBond007 Registered

    Joined:
    Nov 13, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Changing Hostname and Matching SSL: csr / crt / key

    We also changed our hostname.domain post-install of cPanel, and are having difficulty getting rid of the self-signed cert and properly redirecting whm/cpanel services from oldhost.olddomain.tld to newhost.newdomain.tld.

    Both olddomain and newdomain are also regular accounts with webfiles, mail, etc. in /home/olddomai and /home/newdomai.

    When following the procedure documented here:
    http://www.cpanel.net/support/docs/11/whm/ssl_tls_generate.html, the generation of the csr and crt get created for newdomain along with the key, and works, but it also recreates the csr/key for olddomain. I even deleted oldhost.olddomain references from /etc/ssl before following this procedure, but they won't go away:
    rw-r--r-- 1 root root 1339 Feb 8 17:46 /etc/ssl/certs/oldhost.olddomain.net.crt
    -rw-r--r-- 1 root root 1371 Feb 8 17:46 /etc/ssl/certs/newhost.newdomain.net.crt
    -rw-r--r-- 1 root root 761 Feb 8 17:46 /etc/ssl/certs/newhost.newdomain.net.csr
    -rw-r----- 1 root nobody 2225 Feb 8 17:46 /etc/ssl/private/oldhost.olddomain.net.key
    -rw-r--r-- 1 root root 887 Feb 8 17:46 /etc/ssl/private/newhost.newdomain.net.key

    Is it because of the 640 perms on oldhost.olddomain.net.key? Should the key be world-readable?

    In SSL Key/Crt Manager, none of the keys match up to the crt/csr pairs, and in the keys column it says "No Key" for the group of Signing Requests / Certificates. SSL Key/Crt Manager does not allow deletion of keys, either which means you have to shell down to rm the files from /etc/ssl.

    Main question is, how to get rid of oldhost.olddomain.tld? Is there a database entry somewhere that forces this key to come back to life, even after you delete it?

    What other knowledgebase articles are available to manage csr/crt/keys for whm / and what exist that are specific to cpanel and end-user certs?

    Regards,
    Van
     
  9. kazaa

    kazaa Member

    Joined:
    Apr 11, 2006
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    1
    I too am having the exact issue, the cert just keep getting recreated somehow.
     
  10. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    Have you guys created a new certificate for the new hostname?

    WHM -> SSL/TLS -> Generate a SSL Certificate & Signing Request
    Fill in the details. Create.

    WHM -> SSL/TLS -> Install a SSL Certificate and Setup the Domain
    Paste the new certificate details in.
    Make sure the username is nobody (if you run SuExec there are permission errors if you don't have the username as nobody from memory).

    Then try resetting the service certificates again as I mentioned above.
     
Loading...

Share This Page