Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


And i started to installing WHM / cPanel as explained in here :

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 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


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 :


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

This is result of iptables -L command.

P.S. : is working

share|improve this question

closed as off-topic by HopelessN00b Jan 13 '15 at 22:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – HopelessN00b
If this question can be reworded to fit the rules in the help center, please edit the question.

  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 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 : . And this is my config file : – Eray Sep 19 '11 at 8:11
and when i tried 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

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

Do this and it will work

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

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