• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

hostname and serverIP change via command line

izghitu

New Pleskian
Hi,

I have a VPS image of a Plesk install which I use to create new VPS'. Each time a new one is created I need to change its hostname and have it re-read the VPS IP, remove old broken IPs and regenerate apache configs.

How do I change the hostname of plesk/server via command line?
How do I have it re-read the IPs and remove the old ones via command line?

Please help
 
Plesk uses the system hostname, so basically you just change the system hostname with command

hostname <new_hostname>
 
Assuming your server runs Fedora Core or RedHat, you’ll have to make changes in the following locations:

/etc/hosts

Your current hostname should be here behind the server’s IP address, change this to the new hostname

/etc/sysconfig/network

You should have a HOSTNAME variable here, change this to your new hostname.

/var/qmail/control/me

This contains the old hostname, change it to your new hostname to make qmail identify itself as the new hostname.

/etc/httpd/conf/httpd.include

You should have a ServerName variable here, change it to your new hostname.

Change the servers hostname while it’s running, normally this is set at boot.

hostname <newhostname>

Set the new hostname inside Plesk’s database:

mysql -u admin -pcat /etc/psa/.psa.shadow use psa; update misc set val='NEWHOSTNAME' where param='FullHostName';

Now restart Plesk to activate your changes:

/etc/init.d/psa stopall
/etc/init.d/psa stop
/etc/init.d/psa start
 
what about the IP re-read and removal?

# /usr/local/psa/admin/bin/ifmng --help
Usage: ifmng [OPTIONS]...

-l, --list list all addresses in format: "<ipaddr> <netmask> <interface> <is-primary-ip>\n ..."
-a, --add <interface> <ipaddress> <netmask> add IP on <interface>
-d, --del <ipaddress> delete IP
-h, --help display this help and exit
-v, --vz-assigned-ip <ipaddress> determine if <ipaddress> was assigned to this VE
 
Back
Top