Two vhosts with one directory

4 posts / 0 new
Last post
#1 Wed, 07/22/2015 - 09:56
stefankittel

Two vhosts with one directory

Hello,

I'm currently trying Virtual instead of webmin only.

Currently I have a situation that don't seems to work at all. I want to run a multistore magento. So I can't use redirects.

Two hostnames, two SSL, one public_html.

When I set up two vhosts, I get two public_html dirs with different users. So I can't create a link because of the wrong user.

When I set up a subserver it's got the wrong public_html.

Anything I can do?

Thanks

Stefan

Wed, 07/22/2015 - 11:26
andreychek

Howdy,

What you're looking to do is a bit tricky, unfortunately. Though it may be possible to accomplish something like that.

This hasn't really come up before recently, though just a few days ago someone asked about this for Joomla.

But as things stand now, if you want multiple domains to share the same DocumentRoot, the second domain would typically need to be an alias of the first.

In that case though, the alias domain can't have it's own SSL certificate.

You could instead create the second domain as a Sub-Server, give it an SSL certificate, and enable proxying. That can be setup in Server Configuration -> Edit Proxy Website.

It's not the same as having two domains both pointed at one DocumentRoot, but it should provide the same functionality.

Virtualmin doesn't support having multiple Virtual Servers point at the same DocumentRoot though, unless they're aliases.

In a pinch, you could always edit the Apache config and manually change the DocumentRoot and related directories to point at the same path as your first domain -- that will cause validation issues and warnings in Virtualmin though. However, it should work in spite of the warnings.

-Eric

Wed, 07/22/2015 - 11:51
stefankittel

Hello Eric,

thanks. I'm solving this right now using a multidomain certificate. This way I have multiple certificates in one file and can add the other domains as alias.

Stefan

Wed, 07/22/2015 - 12:03
andreychek

Ah yes, that would work too -- glad to hear you have a solution!

-Eric

Topic locked