My set up.
Virtualmin with its DNS handling internal domains such as
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.
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?
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
Virtualmin has several methods of creating the alias domain. You can configure them in the Server Template, section “Apache Website”:
[code]Create alias websites by…
- Creating Redirect virtual host
- Creating permanent Redirect virtual host
- Creating ProxyPass virtual host
- Adding ServerAlias to parent[/code]
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.