Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My CentOS 5.6 server's hostname was "centos" . And then i change it to my domain :

hostname domain.com

And i started to installing WHM / cPanel as explained in here : http://etwiki.cpanel.net/twiki/bin/view/AllDocumentation/InstallationGuide/InstallingCpanel

It's installed very well. And the i reboot my server.

After rebooting, i was execute this command for open WHM's 2087 port :

iptables -I RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 2087 -j ACCEPT

Now i'm trying to browse domain.com:2087 i'm getting Server (centos) not found .I noticed it's forwarding to my old hostname (centos) . And then execute this command to verify me hostname

hostname

it's returned "centos" again. I'm not sure, why it's returned to old hostname. (I think it returned to old hostname after rebooting) . I'm changed it one more time :

hostname domain.com

Finally, now my hostname is domain.com . BUt still i'm getting centos server not found error.

This is result of iptables -L command.

P.S. : domain.com/cpanel is working

share|improve this question

3 Answers 3

If you reestart your server again, your hostname will be changed to centos again. I recommend you, to change your hostname (permanently) by editing /etc/sysconfig/network (HOSTNAME parameter); and change /etc/hosts file too.

You can take a look in apache config (hostname parameter) to correct the error showing on browser.

You are trying to access cPanel from the server (local) or from other computer?

share|improve this answer
    
HEllo @Neto . I have changed /etc/sysconfig/network HOSTNAME parameter. Also, changed /etc/hosts files. BUt i couldn't found HOSTNAME parameter on httpd.conf file. I'm browsing cPanel remotely. –  Eray Sep 18 '11 at 23:33
    
Sorry I mistook.. the correct parameter is ServerName in httpd.conf. Did you try access by IP Address? –  Neto Sep 19 '11 at 0:08
    
ServerName is correct.WHen i tried to access via IP (MY_SERVERS_IP_ADDR:2087), i'm getting Server (MY_SERVERS_IP_ADDR) NOt Found. But i try just IP address without port, it's working. –  Eray Sep 19 '11 at 8:01
  1. You never set the domain name as hostname in a cPanel server. This will cause a lot of troubles with the internal operation cPanel and hence must be corrected. You can use something like server.yourdomain.com as the hostname. If you are on a VPS, ask your provider to change the hostname rather than making the change inside the server as it won't be persistent.

  2. Cpanel will install ssl for cpanel services and the login urls will be redirected to the SSL name as per the cPanel settings. To fix this, set the values cpredirectssl & cpredirect to "Origin Domain Name" (including the space) in the cpanel config file /var/cpanel/cpanel.config and then run

    /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings

This will keep the login url as it is without any redirections. Once logged in, make sure to reset the service SSL certificates, which can be done from WHM >> Service Configuration >> Manage Service SSL Certificates > reset option.

  1. Is your domain already started to resolve ? If not, try to login to WHM/cPanel using IP:PORT instead.
share|improve this answer
    
there aren't cpredirectssl and cpredirect on my cpanel.config file. And i added them to this file, manually. And then, execcute this code /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings but i got this error : pastebin.com/ZnsThjKw . And this is my config file : pastebin.com/WGCG7vMw –  Eray Sep 19 '11 at 8:11
    
and when i tried MYDOMAIN.com:2087 i'm getting Server (centos) Not FOund. But when i try MYSERVERIP:2087 i'm getting Connection Failed error. –  Eray Sep 19 '11 at 8:15
    
You can ignore the warning with the update command as it is only showing the warnings since there were no default settings saved before. If you check the conf file now, you can see that all other parameters are added automatically. As for the WHM error, the port 2087 is an SSL port, so you must connect using https server-ip:2087 or simply serverip:2086. –  SparX Sep 19 '11 at 18:04

Do this and it will work

cd ..
cd etc/sysconfig
chattr +i network
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.