• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Move vhosts with Transvhosts.pl -- Permissions Error -- Only if move outside of /var/vhosts/www

CerdanS

Basic Pleskian
Hi, I start a new thread based on a bug/issue with Transvhosts.pl

The problem appears on Linux Debian 9.13 and Plesk Obsidian Version 18.0.30 Update #2
It's a brand new server, and I reinstalled it already 3 times last 3 days for testing a lot of solutions to the case... without results :(

I take screenshots for every action and commented it bellow to help in resolve and help others with same problem, screenshots are at the bottom of the message.

putty_AEJOlSnqRZ.png

---

What I try to do is to move the VHOSTS folder to the /data partition (major hard disk space is on the /data) :
  • move from : /var/www/vhosts
  • to : /data/www/vhosts
To achieve my goal, I use the transvhosts.pl tool as suggested by Igor on other posts, the command is :

Code:
plesk bin transvhosts.pl --dest-dir /data/www/vhosts/ --correct-scripts

Everything works fine with the script, but once finished, I test next command to see if errors produced during the process :

Code:
plesk repair all -n

As a result, permission error to vhosts appears... see screen capture number 2 bellow for detail (error in red).

As suggested on the error line, I try the command :

Code:
plesk repair fs -verbose
and after press Y > it doesn't works...

The only solution is to get back the files to /var instead /data, if this is done, the problem disappears... I did it with the command :

Code:
plesk bin transvhosts.pl --dest-dir /var/www/vhosts/ --correct-scripts

In this case, no more errors... so I ask myself if the problem only occurs when VHOSTS is outside /var... so I tried this :
  • move from : /var/www/vhosts
  • to /var/www2/vhosts
The same problem with the permission error, and no chances to resolve it.
I read a tons of post, tried every single solution, no solutions.

---
So my questions are :
  • How to move /var/www/vhosts to /data/www/vhosts
  • How to move /var/qmail/mailboxes to /data/qmail/mailboxes
Without problems behind for creation of new acounts and hosts... and no skeleton problems too...

Thanks for reading and any kind of help.
There are my tests screenshots :

Code:
plesk bin transvhosts.pl --dest-dir /data/www/vhosts/ --correct-scripts
putty_8yX5ks5vPW.png

Code:
plesk repair all -n
putty_nw4PAPKQCT.png

Code:
plesk repair fs -verbose
putty_AEJOlSnqRZ.png
Tried few times, always the same result, and seen on another post that may come because of bad detection of OS, in my case I don't have the folder described as solution in another post)...

So the solution is to come back files to /var/www/vhosts

Code:
plesk bin transvhosts.pl --dest-dir /var/www/vhosts/ --correct-scripts
putty_M5KYSaoxtl.png

If Y did this, no more error...

Code:
plesk repair all -n
putty_ydr6ioJWfF.png

---

Thanks for reading, and if you have any idea ?

Cerdan, France / Serbia (in Serbia actually).
 
Last edited:
Have you seen the warning on SELinux in
?
Hi Peter,

Thanks for your reply.

I've just checked before to see what's the actual mode :
Code:
# sestatus | grep "Mode from config file"
-su: sestatus: command not found

When I try :
Code:
vi /etc/selinux/config

I got an empty file :
putty_0YRrQwkJbb.png

---

So I tried to add the line :
Code:
SELINUX=permissive

Restarted the server with :
Code:
service sw-engine restart && service sw-cp-server restart

Tried again to move to /data and same error...

Thanks for your help.
Cerdan
 
Last edited:
I'm thinking maybe to antoher solution, to move all folders with big data and create Sybolic links, like this :

Code:
MOVE :
mv /var/www/vhosts /data/plesk/www/vhosts

Create a symbolic link :
ln -s /data/plesk/www/vhosts /var/www/vhosts

or maybe better, the whole /var/www (not only vhosts), like this :
Code:
MOVE :
mv /var/www /data/plesk/www

Create a symbolic link :
ln -s /data/plesk/www /var/www

And did it for all folders bellow with big files inside that will make full my root partition in few months :
Code:
mv /var/qmail /data/plesk/qmail
ln -s /data/plesk/qmail /var/qmail

mv /var/lib/psa/dumps /data/plesk/lib/psa/dumps
ln -s /data/plesk/lib/psa/dumps /var/lib/psa/dumps

mv /usr/local/psa/tmp /data/plesk/usr/local/psa/tmp
ln -s /data/plesk/usr/local/psa/tmp /usr/local/psa/tmp

mv /usr/local/psa/PMM/tmp /data/plesk/usr/local/psa/PMM/tmp
ln -s /data/plesk/usr/local/psa/PMM/tmp /usr/local/psa/PMM/tmp

mv /var/lib/pgsql/data /data/plesk/lib/pgsql/data
ln -s /data/plesk/lib/pgsql/data /var/lib/pgsql/data

mv /var/lib/mailman /data/plesk/lib/mailman
ln -s /data/plesk/lib/mailman /var/lib/mailman

And finally edit the psa.conf file to give the /data/plesk/ folders... :
Code:
vi /etc/psa/psa.conf

What do you think ? is it a good idea ? maybe some error in my code ?

I'm actually reformatting the server for the fourth time, too many tries and manipulations, I'd like it to be clean on install before installing new vhosts...

Thanks.
 
Last edited:
Just to add, I'v just tested in root mode (if you're not root, type sudo su on Ubuntu or su - in Debian... and fill the Admin pwd) :

Code:
Create plesk folder in /data :
cd /data
mkdir plesk

MOVE :
mv /var/www /data/plesk/www

Create a symbolic link :
ln -s /data/plesk/www /var/www

No more errors (on existing domains transferred), but warnings incorrect ownership on every new domain created after, see 2 captures bellow, no permission... :
putty_gvEjYCzUCA.png

So I used the command :
Code:
plesk repair db -verbose

Result :
putty_GPTWIqF4Jj.png

So finally for the vhosts, it seems that it's fixed :
putty_D6Cow4mtYQ.png

I hope I'll not have serious issues with custommers folders, I'll make some tests, for first, I'll make same changes on all other folders like described in post above to move all folders with heavy files on my /data drive.

EDIT > ON EVERY NEW SUBSCRIPTION / DOMAIN...

Code:
Checking virtual hosts' file system

  There is incorrect ownership on some items in the WWW root directory
  of the domain 'domain.tld' ...................................... [ERROR]
  To see more details, run the command in the verbose mode: plesk repair fs -verbose

The : "plesk repair fs -verbose" works...
But I'll had to do it each time I add a new domain...

---

If it can help someone with same problem...

EDIT > No problems for the QMAIL folder too :
putty_50m6siRkND.png

Cerdan
 
Last edited:
Advice to other users...

You can move a lot of folders (vhosts, qmail)...
But don't try to MOVE the /var/lib/mysql to another location/partition... plesk will not found the "psa" database...
If it can help someone... a lot of problems after.

---

It would be nice to add a feature in Plesk to easilly edit locations (fot the customers MySQL files, not plesk internals), vhosts, qmail, backup files...

Not only in the psa.conf file, maybe create a tool for move automatically and without bugs later in services some folders... with small config file like move_services.conf (like transvhosts.pl) but for multiple services (those who saturates storage in root), or if not, create a clear guide (for beginner users...) with indication step by step to move desired services on other partitions...

Today a lot of servers comes with partitions with /data for store user data and tiny root partition... classical scheme is :
  • /Boot (tiny space)
  • /Swap (tiny space, depends of RAM)
  • / (root, few gb, generally 20-40)
  • /data (literally whole hard drives space)
And major place is on the /data partition... tools given by datacenters to setup server give generally 20<>40 gb for / root... at least my datacenter.

In this case if you host a lot of files and make backups or something like this, the root will very quickly be full.

I read the advice on ideal partition for Plesk :
>> Not easy with my datacenter tool for partition server to use this scheme.

I think this will be more and more complicated for novice users to setup a server... and they'll saturate the space very quickly on root.

I found thousands of posts for this case on google, and it will be nice to create something or at least create a step by step guide...

Thanks.
Cerdan
 
Conclusion - Too many problems with :

Code:
Create plesk folder in /data :

cd /data
mkdir plesk

MOVE :
mv /var/www /data/plesk/www

Create a symbolic link :
ln -s /data/plesk/www /var/www

And QMAIL + PSA Dumps to /data instead /var

So I decided to stop this way, don't use the codes above, they work, but too many problems after, after every action in PLESK interface you'll have to run correction scripts in Putty in root mode, and sometimes no solutions...

I'll continue searching other way, don't use scripts above, except for try, not on production server...

Cerdan
 
Hey guys!
I had the same problem with CerdanS and my sites were out. I have a 300Gb block storage and I want to migrate my vhosts to it, since my main hd has only 50Gb...

I'm waiting for the solution, because I've tried everything to solve this and I didn't find anything that would help me.
 
Back
Top