0

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

Eray
  • 139
  • 2
  • 12

3 Answers3

1
  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.
SparX
  • 1,924
  • 12
  • 10
  • 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 : http://pastebin.com/ZnsThjKw . And this is my config file : http://pastebin.com/WGCG7vMw – Eray Sep 19 '11 at 08: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 08: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
0

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?

Netum
  • 461
  • 4
  • 5
  • 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? – Netum Sep 19 '11 at 00: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 08:01
-5

Do this and it will work

cd ..
cd etc/sysconfig
chattr +i network
sysadmin1138
  • 133,124
  • 18
  • 176
  • 300