• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • 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.

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