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:
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.
4)Set the servers hostname in the plesk database with the following commands:
# mysql -u admin -p
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
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
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.