How can I use /srv/www/vhosts instead of /home/DOM

The title names it all: When I create a new virtual host I’d like to put everything into /srv/www/vhosts instead of the default place (/home/mydomain).

I’ve tried to use Server Templates, but there are so many options that all the files are put in the home-directory, no matter what I do.

The reason is, that I want to use several test-websites on my private PC without having one Linux-User per website.

Is there a possibility to use virtual hosts without creating a new user every single time?

Hi there,

Well, the first thing is that there are some gotchas to putting a virtual server outside of /home.

Virtualmin’s suexec is compiled to work on /home – so either you’d have to not use Suexec or FastCGI (which you can set in the Apache section of the Server Templates), or you’d need to compile Apache’s suexec on your own.

Though, perhaps you can accomplish what you’re after by not moving things out of /home.

Let’s say that you create a new Virtual Server (example.com) with a new system user (example_user). The home directory, by default, would be /home/example_user, and the website goes in /home/example_user/public_html.

Now, when you’re ready to setup a new website (say, example2.com), rather than creating a new top-level Virtual Server, you can create a “sub-server”. It’s a website of it’s own, but owned by your existing user, example_user.

It would reside in /home/example_user/domains/example2.com/.

So at that point, as many domains as you’d like would be owned by that one user.

Would that do what you’re after?
-Eric

Thank you very much, I prefer the solution with the subservers. I now have one account only, and I can live with that.

Thx!!!

OK, so this thread is about two completely orthogonal questions. Sub-servers have no relation to where users live (/home, or somewhere else).

You can configure Virtualmin to create users in another location on the Module Configuration:Defaults for new domains page. The option is labeled “Home directory base”. This, I believe, defaults to using the Users and Groups module default…so it could also be changed there, if you don’t use Webmin’s Users and Groups module for any other purpose than working with Virtualmin.

And, Sub-servers are the correct way to do what you’re after with regard to servers owned by an existing user. That is the entire purpose of the sub-server account type.