Applicable to:
- Plesk for Linux
Question
How to change virtual hosts locations in Plesk for Linux?
Answer
Warning: Plesk Onyx with SELinux enabled does not support custom vhosts directory, that would break your sites. This bug PPPM-6521 will be fixed in future Plesk updates.
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, transvhosts.pl utility can be used to change the location for all virtual hosts:
# /usr/local/psa/bin/transvhosts.pl --help
In the following example, the location is changed to /home directory:
# /usr/local/psa/bin/transvhosts.pl --dest-dir /home --correct-scripts
Note: All the vhosts' content will be automatically moved into the new location.
Note: If there is no transvhosts.pl utility, download it from the attachment.
Comments
3 comments
hello i get error message 502 Bad Gateway and 503 on domains client after using this guide. Version Plesk Onyx v17.5.3_build1705170317.16 os_CentOS 7
@web studio,
I suppose that you have faced the bug from the "Warning" message (Plesk Onyx, enabled SELinux).
Contact Plesk support to assist you in resolving the issue: https://www.plesk.com/contact-support
Thank you!!! Muchas gracias, estaba buscando esta solución hace 1 mes, y con este script pude cambiar de carpeta el virtual host.
Thank You!!!
Please sign in to leave a comment.