I noticed Symbiosis has /etc/apache2/sites-available/000-default.conf, which has <VirtualHost *:80> and serves /var/www/html.
I created the required symlink in /etc/apache2/sites-enabled for this conf to be enabled and restarted apache, but if I point a random hostname to the machine I still see a 404, and the 404 is logged in zz-mass-hosting.access.log instead of access.log as 000-default.conf would suggest.
I think this part of zz-mass-hosting.conf is catching everything not explicitly defined in another vhost and resulting in a 404 for unknown hostnames:
# We need a wildcard server alias, so Apache knows to check
# where when names don't match elsewhere.
# The document root + CGI-directories.
This agrees with the documentation at http://symbiosis.bytemark.co.uk/docs/ch-webreference.html in section 3.1: “If this directory does not exist, a 404 Not Found error will be returned.”
I just want to change the behaviour so that if the directory doesn’t exist, a default site gets served instead.
@hostsharp, thanks for the suggestion but in my use-case the machine doesn’t know in advance all hostnames pointing to it.