How to change virtual hosts location in Plesk for Linux?

Follow

Comments

13 comments

  • Avatar
    web studio (Edited )

    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

    0
    Comment actions Permalink
  • Avatar
    Artyom Baranov

    @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

    0
    Comment actions Permalink
  • Avatar
    Diego Alvarez

    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!!!

    0
    Comment actions Permalink
  • Avatar
    Jean Poulain

    Hi ! 
    Is this problem now corrected by updates ?

    Thanks

    0
    Comment actions Permalink
  • Avatar
    Nikita Nikushkin (Edited )

    Hi @Jean Poulain,

    The bug "#PPPM-6521" is not fixed yet

    As a workaround, before changing the vhosts folder, set SELinux to permissive mode:

    How to enable/disable SELinux on a server?

    For correct websites working capacity, SELinux has to be in the permissive mode even after changing websites vhosts directory

    I also updated the article with this information

    0
    Comment actions Permalink
  • Avatar
    Giorgio Monticelli

    When you write "As an alternative workaround, mount new partition as /var/www/vhosts." what is the procedure?

    I just have my domain in var/www/vhosts and if I mount the additional hard disk the data I think disappear.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Giorgio,

    Generally, the procedure is similar to steps described here (just mount new partition to /var/www/vhosts):

    https://www.tecmint.com/move-home-directory-to-new-partition-disk-in-linux/

    Let me warn you that this is an administrative task and misconfiguration during following the steps may lead the server to stop booting.

    As you already have content at /var/www/vhosts I would recommend to change the virtual hosts location, as proposed in this article.

    0
    Comment actions Permalink
  • Avatar
    Karol Kwiecien

    Hi,

    I followed this procedure on 3 instances and at 1 I have the following:

    Error 1146 (42S02) at line 1: Table 'psa.ServiceInstanceProperties' doesn't exist and system hangs on Correct user scripts.

    Any idea what to do? I have a problem with 1 of the websites which gets now 503 error.

    SElinux was disabled (and still is)

    regards

    Karol

    0
    Comment actions Permalink
  • Avatar
    Ekaterina Babenko

    Hello Karol,
    The 'psa.ServiceInstanceProperties' message can be safely ignored. This database existed in Plesk 12.x only. As script applicable for all Plesk versions the error appears.

    The website error is too generic and to be addressed properly it should be investigated in ticket:
    https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-

    0
    Comment actions Permalink
  • Avatar
    Lenor

    Hi Ivan Postnikov, 

    > "Warning: Websites which have absolute file paths in the code can become broken after vhosts location changing."

    Can't i SYMLINK the OLD Path to new in order to prevent all CMS go down? 

    Joomla for example always has absolut path to tmp and cache DIR. 

    Anything to make this smoother? 

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Lenor

    > Can't i SYMLINK the OLD Path to new in order to prevent all CMS go down? 

    Yes, that could be a solution.

    > Anything to make this smoother? 

    The best suggestion for such changes is to check them on a test server 1st in order to avoid production downtime.

    0
    Comment actions Permalink
  • Avatar
    Rodrigo Martinez

    I used plesk bin transvhosts.pl --dest-dir /mnt/sdb --correct-scripts to move my sites to an external disk (200Gb). Now I want to move them back to the local disk (50Gb) on the server. What command should I use?

    0
    Comment actions Permalink
  • Avatar
    Francisco Garcia

    Hi Rodrigo Martinez,

    The original directory is the next one:

    # egrep HTTPD_VHOSTS_D /etc/psa/psa.conf
    HTTPD_VHOSTS_D /var/www/vhosts

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request