create a _default_ virtual host for aegir that returns a 404

anarcat - June 20, 2009 - 23:25
Project:Provision
Version:6.x-0.2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Right now, using the default INSTALL.txt instructions, all that is hooked into the apache configuration is an include of config/vhost.d. That will mean that the default vhost on a Aegir install when no vhost is specified will be the first site in alphabetical order.

So let's say I have a misconfigured site that for some reason lost its vhost config file. Or it could be a dangling DNS record pointing to Aegir. For whatever the reason, someone requests foo.example.com from the Aegir-managed Apache server. Apache will look if there's a ServerName that matches it, otherwise it will serve the "default" vhost for that port. The default is either the server defined using: <VirtualHost _default_:80>or the first <VirtualHost> defined in the configuration. Since config files are loaded in alphabetical order, that will be the first vhost in alphabetical order.

That is rather annoying and makes things really much weirder than needs to be when something is wrong.

So I think we should create a VirtualHost for the "Aegir" platform (which should be treated specially anyways):

<VirtualHost _default_:80>
  DocumentRoot /var/aegir/drupal-5.18-aegir
   
  ServerName aegir.koumbit.net

# Extra configuration from modules:

    # Error handler for Drupal > 4.6.7
    <Directory "/var/aegir/drupal-5.18-aegir/sites/default/files">
      SetHandler This_is_a_Drupal_security_line_do_not_remove
    </Directory>

</VirtualHost>

... that's just a duplication of our original vhost, but it gives a good idea of the issue.

 
 

Drupal is a registered trademark of Dries Buytaert.