[Virtualmin] Adding another HDD

4 posts / 0 new
Last post
#1 Thu, 04/21/2011 - 23:49
Checkmate

[Virtualmin] Adding another HDD

Note:

If you have free time, please read the complicated version, otherwise, please skip it and read the simple one

The really simple version:

My /home directory is nearly full, and I have added a new hard disk that I'd like to use some virtual server account.

How do I create a virtual server and put it to the new HDD instead of the old one?

How to do I move the content from the old HDD to the new one?

================

The more complicated version:

I have no idea about Linux, but I've been using them for some server for 2 years.

I'm used to Cpanel. But I've realized the license fees are too much, so I'm moving away, to virtualmin.

Recently, I've noticed one of my site (let's call that virtual server account Andy) that host full of thumbnails is being bottleneck by an old slow 7200 rpm, so I decided to buy an SSD.

How do I move Andy's content from the old HDD to the new SSD? Also, if any chance I create a new Mary virtual server, how do I specify virtualmin to put Mary into the old HDD, or the new one?

These tasks were done fairly easy in cpanel, but I have no idea how to do it with virtualmin

=================

Sat, 04/23/2011 - 10:36
andreychek

By default, Virtualmin uses the "suexec" program, which causes all applications to run as the owner of the website, rather than as the Apache user.

That provides a more secure shared web hosting environment, but comes with a requirement that all websites be hosted out of /home.

If you aren't concerned about the security of this particular website, you could always setup this new Virtual Server to run under mod_php rather than as the more secure CGI or FCGID, and you could run it off of your new disk.

If your new disk is mounted at, for example, /mnt/new_disk -- you could move one of your home directories to it by running this command as root:

mv /home/USER_WITH_MANY_FILES /mnt/new_disk

Then, create a symlink from /home to the new location so that it still looks like the user's home directory is in /home:

ln -s /mnt/new_disk/USER_WITH_MANY_FILES /home/USER_WITH_MANY_FILES

After doing that, you'd need to go into Server Configuration -> Website Options, and set the PHP Execution mode to use mod_php.

But, remember that mod_php is a less secure setup.

A better long-term fix would be to use this new drive for all of your websites, and mount it at /home.

-Eric

Sun, 04/24/2011 - 12:11
Checkmate

I understand. I wouldn't be using suexec since I want XCache for my site (a relatively very busy one).

The setup seem to be complicated if in the near future I have to manage a dozen of sites, thus, I might as well as setup and use new drive instead.

Thanks for your help, much appreciated.

Sun, 04/24/2011 - 13:16
Locutus

You could mount the new HDD under your existing home, e.g. as /home/newdrive. Then the suexec requirement to run under home should be met.

You can then reconfigure Virtualmin, in System Settings -> Virtualmin Configuration -> Defaults for new domains to put the home directories of servers that you createa from that point on in your "newdrive" directory.

Topic locked