• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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