Setting up Apache to support multiple websites on one host. My server already does that for my public websites.
However I want to control what is returned to the browser if a site isn’t available for some reason. So I’ve set up a virtual server with multiple sites. Each site works when enabled. However if the site is set up to be unavailable, disabled, no index file, etc. the default page returned to the browser is not what I’d like.
Need to identify a few fail conditions, see what the server returns when the condition exists, see if what’s returned for a given condition is the same regardless which site the failure is generated by, then figure out why the webserver is sending back the page it does.
Reasons not available:
- site not being served, e.g. not enabled on server
- site setting wrong, e.g. DocumentRoot invalid
- site content wrong, no index file
Answers that might be returned:
- site not available
- …other’s I’ve seen but don’t remember now
From what I’ve read it seems whatever’s in 000-defalut.conf should control which page/site loads when a site isn’t available. That’s not the result I’m getting.
Either I’m doing it wrong or I’m just not understanding what’s supposed to happen and how to make it happen.