• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question getting Plesk to setup sites on 2nd drive.

Martin Porter

New Pleskian
Hi Everyone..
My first post and I wouldn't think it will be my last :) - I got Plesk Onyx working on my VPS with very little problems and found I needed a extra drive to host the forthcoming sites. But I haven't got any ideas on how I can get this setup! I can see the Partition "/mnt/data" which I setup last night and can also view the details of the drive within Plesk.

I am now hitting a wall - I dont know how to get Plesk to start using the new Partition for setting up new sites.
could anyone help with this? btw.. I forgot to say I have two test sites i have been playing around with on the current Partition but they can be dropped once the new Partition springs into life.

thanks for reading and hope someone can stop me hitting my head against the wall :confused:

kind regards
Martin.
 
You can't separate sites location in Plesk. But you can change default sites location from /var/www/vhosts/ to anything else with transvhosts.pl utility:

Code:
# plesk bin transvhosts.pl --help
You should specify destination directory.
Utility to transfer vhosts content from HTTPD_VHOSTS_D directory to new place.

Usage:
        --dest-dir   <path>  Destination path. Path to new vhosts directory.
                             Example: /path/to/new/vhosts.
                             If directory does not exist it will be created.

        --correct-scripts    Changes user scripts.
                             Old vhost path is replaced to new path in content of all files.
 
You can't separate sites location in Plesk. But you can change default sites location from /var/www/vhosts/ to anything else with transvhosts.pl utility:

Code:
# plesk bin transvhosts.pl --help
You should specify destination directory.
Utility to transfer vhosts content from HTTPD_VHOSTS_D directory to new place.

Usage:
        --dest-dir   <path>  Destination path. Path to new vhosts directory.
                             Example: /path/to/new/vhosts.
                             If directory does not exist it will be created.

        --correct-scripts    Changes user scripts.
                             Old vhost path is replaced to new path in content of all files.

thanks IgorG... will this also transfer the rights to the new drive as well ?
 
Can you clarify what you mean by "transfer the rights"? Are you referring to file permissions?
 
Hi Mark..
within transvhosts.pi it says "If directory does not exist it will be created" so will it create the
the file / folder permissions once its reset the vhost

thanks
Martin...
 
Correct, you can also pass the correct-scripts argument to update any user scripts that have the old path.

Before you do this though, can you check to see if your root is setup on a logical volume. If so, it would make more sense to add the second disk to the existing LV.

[root@plesk ~]# lvdisplay | grep 'LV Path'
 
That be a negative then :) Just follow Igor's solution, that will take care of the issue as well.
 
Mark.. can you show me a simple "plesk bin transvhosts.pl" command line since all I keep getting is when you use the "--help" option
I have a 100GB drive and when I list the drives using fdisk -l its listed as /dev/sdb1 within plesk it's named as Partition "/disk2"

thanks & regards
Martin...
 
found some thing interesting is this true? "The new directory must exist even though the script help says it will create missing directories it did not work for me. The correct script option will change all the vhost configs for you. Watch out for trailing slashes or you will have incorrect paths in your vhost configs. Another thing i noticed some of our vhosts had double slashes in there path names to correct this issue"
 
Pardon my ignorance, but wouldn't it be enough to move/copy-delete the entire /var/www/vhosts/* hierarchy to a new directory in the new file system, and then create /var/www/vhosts as a link to the new directory in the new file system?

Of course that should be done maintaining file permissions (cp -rp, rsync, whatever...) and after having stopped all processes accessing it...
 
well you would think Sergio but I have just used the transvhosts.pi and I ended up with too many errors
just glad that I'm working on is a new install, its faster to rebuild the VPS then it would be trying to sort out the errors
will need to read up more on this. But I'm always open for anyone to give me advice being so new to Linux :)
 
Last edited:
@Martin Porter if you google around it seems that the universal wisdom is to use transvhosts.pl and thus I think there must be some very good reason for that and you did the sensible thing using it.

On the other hand I don't see why the "link" solution, at the OS level, couldn't work. But maybe I'm just extremely naive and I'm missing something obvious.

It would be nice if Plesk could confirm in some form that the "link solution" is not viable...
 
^ Sergio has a good point. Moving the directory and then creating a symlink would be a good solution. Maybe even better. Let's say you use transvhosts using the
correct-scripts argument. What happens when the average Joe Developer makes edits to a local copy and uploads the changes. BAM, it's dead.
 
Last edited:
if we are making a wish list - then why not have a simply extension that A) list the current location of the vhosts and then B) A browse button where you can select the new file location.. Job complete, don't you think? but until that time we have the wonderful transvhosts.pi to play russian roulette with. just my thoughts.
 
Last edited:
Back
Top