Virtual server alias not working as intended

Hi,

I have a single IP server hosting multiple website. I set up a new virtual server “domain.com” and it’s working as intended. I created an alias “domain.org” for this server using virtualmin -> create virtual server -> Alias of domain.com and enabling “Setup DNS Zone” feature only.

Problem:

  • [1] - When users type domain.org on their browser, the first virtual server in my Webmin->Servers->Apache Webserver list is rendered.
  • [2] - emails going to @domain.ca bounce back and are not routed to @domain.com

Questions:
While using the alias:

  • [a] - How do I go about getting domain.org to serve domain.com directly?
  • [b] - How to route emails sent to domain.org to domain.com?

Note: I know I can do it the hard way and set it up as virtual server, create a redirect and just forward emails but I’d love to do it the right way rather than mickey mouse style. Thanks!!

Howdy,

Well, domain.org is setup as an alias of domain.com – that implies that they should both point to the same website.

An alias should be the same as the domain it’s the alias of.

Now, regarding why the emails don’t work, that is certainly a problem.

If you look in Edit Virtual Server -> Enabled Features for the alias domain, is the “Mail for Domain” feature enabled?

-Eric

Hi Eric,

Thanks for the reply. That’s what I thought the alias would do but unfortunately it doesn’t. As I mentioned, the alias domain.org returns the first website I have in my Apache Webserve. As a test, in the Apache Directives I switched the order of the 1st and 2nd website. As I suspected, the new top website in the list shows up when domain.org is entered in a browser. It feels as if when the alias doesnt know where to point, it just defaults to the top website in Apache Webserver list.

In regards to your second question, no “Mail for Domain” is not enabled. However, I just turned it on and the email routing works. Thank you for that.

So the only thing left is why isn’t domain.org pointing to domain.com? : )

Howdy,

Ah, I think I misunderstood what you were saying regarding the website. Or actually, I probably just wasn’t thinking right when I read what you described, as my point doesn’t make any sense :slight_smile:

Let’s try again!

It sounds like Apache doesn’t know about your alias.

The simplest possibility here is that the “Apache website” option isn’t enabled.

Can you verify that it is indeed set for the alias?

If it is enabled – what distro/version is it that you’re using there?

-Eric

The simplest possibility it was indeed. It’s working now Eric. Thank you very much!

For anyone reading this, while having the alias virtual server selected, I ticked Apache Website in virtualmin -> Edit Virtual Server -> Enabled Features