• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

How to change the vhosts location

ProWebS

Regular Pleskian
Hello,

I want to install Plesk 10.x in a new server in which most of the disk space is in the partition /home/
and in my experience plesk saves the vhosts at /var/www/vhosts/

How can I install plesk 10.x to use /home/www/vhosts/ or /home/vhosts/ instead of /var/ ?
 
Use /usr/local/psa/bin/transvhosts.pl utility. For more details use --help option.
 
Well I did that:

[root@home]# /usr/local/psa/bin/transvhosts.pl --dest-dir /home/www/vhosts/
Moving files to new directory...
Correct psa configuration file...
Correct passwd file...
Correct database...
Update hosting settings...
done
Update subdomains settings...
done
Update system users settings...
done
The service node 'local' was successfully updated.

and after I tried to created a test site from Plesk I got the error:

Error: hosting update is failed: Execution failed. Command: skelmng Arguments: Array ( [0] => --setup-skel [1] => --vhost-name [2] => domain.tld [3] => --id [4] => 0 [5] => --www-root [6] => /home/www/vhosts/domain.tld/httpdocs [7] => --cgi-bin-path [8] => /home/www/vhosts/domain.tld/cgi-bin ) Details: Empty error message from utility.

Any ideas?
 
As I see the problem is in the skelmng execution, so I did try to run the command manually, the ouput is:

[root@]# /usr/local/psa/admin/sbin/skelmng --setup-skel --vhost-name domain.tld --id 0 --www-root=/home/www/vhosts/domain.tld/httpdocs --cgi-bin-path=/home/www/vhosts/domain.tld/cgi-bin
Unexpected error: Directory /home/www/vhosts/domain.tld does not represent a virtual host
 
Ok I've found the problem, it was the slash at the end of the path:

[root@/]# grep HTTPD_VHOSTS_D /etc/psa/psa.conf
HTTPD_VHOSTS_D /home/www/vhosts/

I did change it to :
[root@/]# grep HTTPD_VHOSTS_D /etc/psa/psa.conf
HTTPD_VHOSTS_D /home/www/vhosts

and now everything works great.
 
I hate trailing slashes :) Sometimes you need them, sometimes you don't, and it can be impossible to tell unless the script or app tells you one way or the other.

For people visiting this topic in the future:

Thanks to ProWebS, when using transvhosts.pl we know you need to exclude the trailing slash.

For example, to change from the default location of /var/www/vhosts to the old-style /home/httpd/vhosts location, you'd need to use the following syntax:


CORRECT:
Code:
/usr/local/psa/bin/transvhosts.pl --dest-dir /home/httpd/vhosts

INCORRECT:
Code:
/usr/local/psa/bin/transvhosts.pl --dest-dir /home/httpd/vhosts/
 
Last edited:
Back
Top