Webhosting Blog

Changing hostname for plesk server on linux.


Following are the steps to be followed in order to update the hostname on plesk server installed in linux environment.

1) Open the file /etc/hosts and edit the hostname entry as follows in the file (Eg: hostname= server.example.com)

# Auto-generated hostname. Please do not remove this comment.

127.0.0.1 localhost.localdomain localhost
XX.XX.XX.XX server.example.com server

XX.XX.XX.XX — servers IP.

2) Now open the file /etc/sysconfig/network and edit the hostname entry in this file:

NETWORKING=”yes”
HOSTNAME=”server.example.com”
GATEWAY=”xx.xx.xx.xx”
GATEWAYDEV=”eth0″
FORWARD_IPV4=”yes”

3) Now open the file /var/qmail/control/me  which contains the old hostname. Alter it to new hostname to make qmail identify itself  with  the new hostname.

server.example.com

4)Set the servers hostname in the plesk database with the following commands:

# mysql -u admin -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 181
Server version: 5.1.50 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> use psa;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update misc set val=’server.example.com’ where param=’FullHostName’;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> quit

5) Now restart Plesk  service to activate the changes:

# /etc/init.d/psa stopall

# /etc/init.d/psa stop

# /etc/init.d/psa start

Now check the servers hostname. It should now be configured with the new hostname.

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s