Results 1 to 21 of 21
  1. #1
    Join Date
    Feb 2007
    Posts
    274

    HOW TO: Change the hostname and not get cpanels licence error

    I have found over the years that it is anoying when you update the hostname on a server running cpanel and cpanel gives you an invalid licence error, if you want to change the hostname on a cpanel server then

    1)log into shell with root

    2)type "hostname (then at the end put anything you want as your hostname, but it must be something.yourdomain.xxx please be aware that the something will show as the server name in cpanel

    3)type /usr/local/cpanel/cpkeyclt

    then just load cpanel as you would normaly, but dont forget to add an a entry for the new hostname

  2. #2
    Join Date
    Oct 2005
    Posts
    517
    Very useful. I have a few VPS accounts whose hostnames I have changed several times to reflect the changes in my business strategy and each time, I had to ask my hosting company to take care of the cPanel licence issue.

    When you say, "then just load cpanel as you would normaly", do you actually mean WHM?

  3. #3
    Join Date
    Dec 2004
    Location
    New York, NY
    Posts
    10,710
    If you change hostnames on a Virtuozzo/OpenVZ VPS, you should also ensure that your host has updated the hostname from their side as well...else your hostname will be reset the next time your VPS reboots. There are ways around that too, but its simpler just provide your host with the up to date info.

  4. #4
    Join Date
    Feb 2007
    Posts
    274
    you could load cpanel or whm normally, it is just to test that it has worked correctly

  5. #5
    I have always had this problem. Now, i just type in /usr/local/cpanel/cpkeyclt in command promt, and it works great! No problem at all, as it updates with cpanel.net automatically when you type it.
    - PennFoster Exam Answers pfAnswers.com

  6. #6
    Thanks it helped.

    Great info,
    Last edited by SoftWareRevue; 09-21-2007 at 10:44 PM. Reason: posts merged

  7. #7
    Join Date
    Feb 2007
    Posts
    274
    Glad to be able to help
    Master Reseller Accounts
    Shared Hosting
    VPS hosting
    ToastHosts.com support{at}toasthosts.com

  8. #8

    Thanks.

    LOL thanks mate.. i was kinda struggling with this..
    Sam Johan,
    Founder - CEO,
    PureInsure - Insuring The Hosting Industry.

  9. #9
    Join Date
    Oct 2007
    Posts
    112
    Easy and well known stuff to do.

  10. #10
    Join Date
    Feb 2007
    Posts
    274
    it may be easy and well known however some people still dont know this stuff and this sort of forum is the perfect place to learn
    Master Reseller Accounts
    Shared Hosting
    VPS hosting
    ToastHosts.com support{at}toasthosts.com

  11. #11
    Join Date
    Jul 2004
    Location
    Athens, Greece
    Posts
    209
    /usr/local/cpanel/cpkeyclt re-downloads the license from cPanel's site which is s required if you change mainIP (requires license adjustment from cPanel's side too) or hostname. However, changing hostname with "hostname <new.host.name>" without setting it in O/S's configuration, will be reverted at the next reboot giving you the unlicensed error again.

    So there should be another step to change it on the O/S startup configuration (depending the O/S or type of server: dedicated/vps), not just using hostname command

    Thank you.
    SharkTECH Internet Services
    http://www.sharktech.net
    DDOS Firewalled Dedicated Servers
    Managed Services / IRC Allowed

  12. #12
    Join Date
    Feb 2007
    Posts
    274
    I will post how to do this when i have the time
    Master Reseller Accounts
    Shared Hosting
    VPS hosting
    ToastHosts.com support{at}toasthosts.com

  13. #13
    Join Date
    Feb 2007
    Posts
    274
    ok, sorry it has taken me so long to post the final pice to this thread i have been kind of busy recently.

    first pico /etc/hosts

    type something similar to

    <your server shared ip here> <chosen hostname here>.<your domain here>.<extension>

    the below that have

    127.0.0.1 localhost


    then you can use the hostname command to set your hostname to the same as it is in your /ect/hosts configuration.
    Master Reseller Accounts
    Shared Hosting
    VPS hosting
    ToastHosts.com support{at}toasthosts.com

  14. #14
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    14,134
    if you want to change the hostname on a cpanel server then
    Use CPanel to manage cpanel and related materials. Don't make it more complicated than it has to be. WHM no longer gives you a 'license error'.

    first pico /etc/hosts
    /etc/hosts is NOT a valid place to change a hostname, nor is it any sort of relevant place for your system's hostname to be changed. 2 places require changing, but NOT /etc/hosts

    #1:
    /etc/sysconfig/network needs to be updated
    #2:
    /proc/sys/kernel/hostname needs to be updated

    Now, since you're using Cpanel, it's best to use CPanel to manage Cpanel's things (backups, etc), because otherwise it'll try to rewrite system files (ie: hostname)

    This brings us to the question:
    what is /etc/hosts for

    Well, that's answered in the man pages:
    This file is a simple text file that associates IP addresses with hostnames, one line per IP address. For each host a single line should be present with the following information:
    In english (layman's terms):
    /etc/hosts is a 'dns' of sorts. It doesn't rely on dns running, the resolvers running, or anything of the like. It is NOT used to control the system's hostname, though it CAN be used to look up the system's hostname. You can add multiple ip host combinations in there and they will ALWAYS be available to the system, REGARDLESS of whether your dns is running or not

    The files needed to edit the hostname are listed above, though, again, if you're using a control panel (CPanel), or even a VPS (virtuozzo, etc), you'll want to use THEIR setup to change and manipulate your hostname so that you can be sure it doesn't go right back where you don't want it to go
    Tom Whiting, WHMCS Guru extraordinaire
    Linux problems? WHMCS Problems? Give me a shout
    Check out my WHMCS Addons

  15. #15
    Join Date
    Feb 2007
    Posts
    274
    Thanks for this, i have allways used cpanel to change the hostname so have never had to do it manualy, just update the licence.

    Thanks.
    Master Reseller Accounts
    Shared Hosting
    VPS hosting
    ToastHosts.com support{at}toasthosts.com

  16. #16
    Join Date
    Jan 2008
    Location
    St. John's, NL
    Posts
    2,201
    Quote Originally Posted by Ben James View Post
    I have found over the years that it is anoying when you update the hostname on a server running cpanel and cpanel gives you an invalid licence error, if you want to change the hostname on a cpanel server then

    1)log into shell with root

    2)type "hostname (then at the end put anything you want as your hostname, but it must be something.yourdomain.xxx please be aware that the something will show as the server name in cpanel

    3)type /usr/local/cpanel/cpkeyclt

    then just load cpanel as you would normaly, but dont forget to add an a entry for the new hostname
    Using the Hostname function in WHM, I have never had any errors with regards to an invalid license. It has always "just worked".
    Cpanel/WHM • PHP • Perl • Ruby • Full Time Support
    LCWSoft - Canada web hosting (based in Newfoundland) since 2007
    Servers based in the US and Canada (Uptime Report)

  17. #17
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    14,134
    Back when this was written (IE: before CP11 was stable), there was a strong chance that it would do what the OP was talking about. You'd change the hostname in Cp/WHM and then have to run cpkeyclt . Now, it's a no-brainer, they've setup the script to either automatically run it (possible), or done some other sort of licensing check (possible too). Either way, it did used to be a rather annoying issue that would come up every time the hostname was changed
    Tom Whiting, WHMCS Guru extraordinaire
    Linux problems? WHMCS Problems? Give me a shout
    Check out my WHMCS Addons

  18. #18
    my cpanel doesn't support php-cli and I can't manually install, centos OS. please somebody help me with that

  19. #19
    Join Date
    Mar 2009
    Posts
    654
    Quote Originally Posted by op3l View Post
    my cpanel doesn't support php-cli and I can't manually install, centos OS. please somebody help me with that
    Start a new thread with an appropriate topic, instead of reviving a long-dead thread that isn't even related to your question.
    [GB ≠ GiB] [MB ≠ MiB] [kB ≠ kiB] [1000 ≠ 1024] [Giga ≠ gram] [Mega ≠ milli] [Kelvin ≠ kilo] [Byte ≠ bit]
    There is no millibit. There is no gram-bit. There is no Kelvin-Byte.

  20. #20
    I'm new member can't start new topic so I looking thread under cpanel title, please forgive me

  21. #21
    Thank you...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •