Saturday, March 1, 2008

Changing hostname for plesk

1) SSH to your box
2) login as root
3) type pico /etc/hosts
4) modify the line that says

216.40.226.??? ensim.rackshack.net ensim
to
216.40.226.??? srv01.yourdomain.com srv01

Substitue the above ip for your own and same with the server name. Change that to your own. It can be anything but it must contain at least 2 periods in the name and preferably ending in com or your ext, net, cc, tv or whatever. See my example above!

type cntrl-x and save your file.

5) type pico /etc/sysconfig/network and modify the second line in file network to match the address of your server name as you did in step 4:

NETWORKING=yes
HOSTNAME="ensim.rackshack.net"
GATEWAY="216.40.226.1"
GATEWAYDEV="eth0"
FORWARD_IPV4="yes"

So you would change the line
HOSTNAME="ensim.rackshack.net"
to
HOSTNAME="srv01.yourdomain.com"

Save with a ctrl-x

6)
You need to change it with following command:

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e "update misc set
val='new.domainname.com' where param='FullHostName'"

Where 'new.domainname.com' is the name to set as hostname in Plesk. Note that it should be typed as one line.


Now reboot your system. You must reboot for the server names to propagate throught the system.

DO NOT do anything to DNS till after the system reboots because all this will be changed when the server comes back online.


For more information please refer to
http://forum.plesk.com/showthread.php?s=84e937a10aecb08e8d5aa55f01467b4d&threadid=9523

No comments: