Home Directory

I have installed virualmin on to webmin created virtual hosts and noticed that they are put into the home directory.
I have now added a second harddrive with a directory called hosts, how can do I make virtualmin
use the hosts directory by default when creating new virtual hosts.
I always prefer to use a seperate harddrive the OS and WEBSITES

Howdy,

Well, Virtualmin uses suexec to call PHP and friends, and it’s generally hardcoded in the suexec Virtualmin provides to use /home for executing files. It tends to be a lot simpler to go with /home for all your files if you can :slight_smile:

Would it be possible to mount your second hard drive on /home?

-Eric

Hmmm… Sorry, but - Eric, I think your comment might be potentially “dangerous”, in light of the fact that VMin offers the option to change the base directory where it creates its user homes. :slight_smile:

Check out System Settings → Virtualmin Configuration → Defaults for new domains : Home directory base. If it constitutes an suexec-related problem to enter something else than “/home” there, I think the documentation should contain a definitive warning about that. Currently, it reads:

This is the top-level directory where home directories will be created. If your Virtualmin installation shares a server with many other services or standard system users, it may be useful to use something other than /home. The default is gathered from the Users and Groups Webmin module, which defaults to /home. The Users and Groups module allows for complex extensions to this convention, such as “/home/v/virtualmin”, which can make directories easier to navigate if you have many domains on a single server. The Users and Groups module documentation in either of the Webmin books covers this feature in more detail.

in light of the fact that VMin offers the option to change the base directory where it creates its user homes.

Well, while Virtualmin does indeed offer the ability to change where home directories are generated – changing that doesn’t actually update suexec.

The suexec binary on distros such as CentOS is hard coded to only allow programs to run from /home.

So if you change the Virtualmin setting away from /home, suexec stops working. And then CGI and FCGID generate 500 errors on every request, it gets messy fast! :slight_smile:

That said, newer versions of Debian and Ubuntu have begun removing the hard coded nature of that setting, and instead allow it to be configured from the “/etc/apache2/suexec/www-data” config file.

So if Ubuntu or Debian users with that config file wish to move where Virtualmin puts web files, it’s a lot simpler than for CentOS users.

There’s some documentation on the website that goes into a lot of that (I think, I can’t seem to find it ATM), though if it doesn’t say that in the Virtualmin documentation itself, I suppose it should, I’ll ask Jamie to pop that in there :slight_smile:

-Eric

Yep, indeed /etc/apache2/suexec/www-data exists in my Ubuntu 10.04, with the intended content. I agree about putting info about that in the documentation. I would sure have fallen for that, had I tried to move the homes elsewhere. :slight_smile:

Thanks for all of your help.
New to Linux got fedup with the windows box