How can I direct an external domain to multiple different internal domains

3 posts / 0 new
Last post
#1 Tue, 07/19/2011 - 12:38
sefs

How can I direct an external domain to multiple different internal domains

Hi all,

My set up.

Virtualmin with its DNS handling internal domains such as

me.dev you.dev they.dev etc....

I have an external domain called externaldomain.com

What I want to do is when someone types in externaldomain.com it comes to one of the internal domains, and the only differentiators I can think to use are port numbers like this...

externaldomain.com:1111 -> me.dev externaldomain.com:2222 -> you.dev externaldomain.com:3333 -> they.dev

Is this possible to achieve via the virutalmin gui?

I would like to stay away from programmatic redirection and have it operate more like a serveralias where externaldomain.com:1111 would actually be a true representative of me.dev for instance.

Thank you.

Tue, 07/19/2011 - 19:43
sefs

What I have done so far.

Signed up for a dynamic ip that supports wild cards.

created x.dynamic.ip, y.dynamic.ip, z.dynamic.ip

and in /etc/apache2/sites-enabled/me.dev.conf I inserted a serveralias x.dynamic.ip

and in /etc/apache2/sites-enabled/you.dev.conf I inserted a serveralias y.dynamic.ip

and in /etc/apache2/sites-enabled/they.dev.conf I inserted a serveralias z.dynamic.ip

This works but I had to manually edit each conf.

When I tried to create an alias via the interface it did not insert any serveralias line. It did create an un-needed directory under /home/me.dev/domains. Should it have also inserted the serveralias line for me as well?

Thu, 07/21/2011 - 05:07
Locutus

When reading your first post, I was also going to suggest subdomains under your "externaldomain.com" to differentiate, instead of port numbers, yes. :) Port numbers would have worked too, but you'd have to make manual modifications to your sites then, adding mod_rewrite directives.

Virtualmin has several methods of creating the alias domain. You can configure them in the Server Template, section "Apache Website":

Create alias websites by...
  * Creating Redirect virtual host
  * Creating permanent Redirect virtual host
  * Creating ProxyPass virtual host
  * Adding ServerAlias to parent

So if you don't see a ServerAlias directive in the parent after creating an alias server, you probably have some other method selected there. :)

The "un-needed" directory you mentioned was discussed in another thread just a few days ago. It is/was meant for possible email redirects that the alias domain might have, but Jamie noticed that it's not really necessary to create that directory and will remove that behavior in a future Virtualmin version. For now though, you should keep the directories there, since Virtualmin might expect them to exist.

Topic locked