- Plesk for Linux
How to change virtual hosts locations in Plesk for Linux?
How to replicate website vhost and root document path during migration from a non-Plesk server?
Warning: These actions may incur on website downtime depending on the number of domains and data to be copied to the new location. It is recommended to apply this during maintenance hours.
Warning: Changing vhosts directory with the SELinux enabled on Plesk Onyx will break websites. This is due to SELinux limitation: it stores absolute paths in its policies.
As a workaround, set SELinux to permissive mode before applying steps below.
After changing vhosts folder, SELinux should be kept in the permissive mode for correct websites working capacity. As an alternative workaround, mount new partition as /var/www/vhosts.
Warning: Websites which have absolute file paths in the code might not work with the errors described in this article after vhosts location changing.
Check it before applying the steps below.
In Plesk for Linux, the
transvhosts.pl utility can be used to change the location for all virtual hosts:
# plesk bin transvhosts.pl --help
In the following example, the location is changed to the
# plesk bin transvhosts.pl --dest-dir /home --correct-scripts
Note: All the vhosts' content will be automatically moved into the new location.
Note: Changing virtual host location will not affect backup restore functionality. Content from backups will be restored to current custom location.