Well, there shouldn't be need for that. If none of the other VirtualHosts
match the hostname, the server will use the default virtualhost, which is the first virtualhost in the configuration. Therefore the default virtualhost is usually named 000-default
; just to become first in /etc/apache2/sites-enabled
.
So you can achieve the same outcome by renaming the symlink in sites-enabled
to be the first. Or you could make the 000-default
to be a redirection to your actual domain.
I don't think there's currently any known vulnerability in Apache that could use just HTTP_HOST
. However, it depends on the applications you are running on the default virtualhost, e.g. a PHP script that allows to modify some exploitable variable through HTTP_HOST
. Actually by making the 000-default
just a redirection you could also prevent that (minor) risk.