0

How is it possible for an Apache web server to not have any entries in its /etc/apache/sites-enabled directory but still serve websites?

I am running an Apache web server on Ubuntu 14.04.2 LTS. I have more than 20 websites responding correctly on this server. Recently I decided to implement a Drupal multisite and that took me to /etc/apache/sites-available to edit the 000-default.conf. It is the only .conf file available and has the following content:

<VirtualHost *:80>    
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www

            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined                  
</VirtualHost>

This handles serving for all the websites on my server but in attempting to debug why a second .conf file does not work, I altered the DocumentRoot to /var/www2, a directory which does not exist.

Once I had saved the document and restarted Apache, I found my websites still loading successfully.

I disabled the 000-default.conf virtualhost, expecting that my websites would stop loading, but they still worked.

Just to be certain, I stopped Apache and all my websites stopped responding, but right now all my websites are responding from an Apache server which has no entries in the sites-enabled directory?

Appreciating that getting things to STOP working is the very opposite of what forums are for, I am trying to understand why my websites are still loading even with all virtualhosts disabled so I can begin solving other problems.

halfer
  • 19,824
  • 17
  • 99
  • 186
sisko
  • 9,604
  • 20
  • 67
  • 139

1 Answers1

0

The main server configuration acts like a catch-all virtual-host, until an actual VirtualHost override it. IOW, Explicit virtual hosts are not required to process requests.

covener
  • 17,402
  • 2
  • 31
  • 45