Apache default host

When I enter a web host name, which is not defined within Apache like xyz.domain.tld, the request is automatically redirected to the first lexicographical domain available. I were not able to find the directive, where this behaviour has its origin. What do I have to change in order to show the user an error page?

Status: 
Active

Comments

Howdy -- what you're seeing there is what Apache does when receiving a request for a domain it doesn't host -- it will always show the default website.

The default website is the first website defined in it.

What you can do is design a page that you want to be seen in cases like that, and then make that one the default.

You can make a page the default by going into Server Configuration -> Website Options, and there set the Default Website for IP Address option to Yes.

Thank you for the explanation. I still think, that something is misconfigured on my server. I do have a "000-default" site, which is enabled and should from my understanding be loaded. I also see "default web site" in my Apache configuration, but clicking on it first gave me a warning and on second attempt displayed the details. Trying to save the default website raised a path error. The content of 000-default.conf is currently "# vim: syntax=apache ts=4 sw=4 sts=4 sr noet" which does not look like a website configuration.

My goal would be to make "000-default" a real default web site. Any ideas how to get this fixed?

I would not want to manually configure a default web site for every virtual domain and rather stick with the defaults.

My suggestion would be to remove the 000-default file, and then configure Virtualmin to use one particular website as the default for a given IP address.

That is, just go into Server Configuration -> Website Options, and there you can set a default. You will only ever need to do that once per IP address.

The 000-default file is actually something we're looking at removing by default on new installatons, as it's not used by Virtualmin, and points to a set of directories that Virtualmin doesn't manage.