LAMP 2.0 allows you to specify your own Apache virtualhost include file that will be used by your LAMP instance.  This is an experimental feature and can cause a site to become unavailable if mis-configured.  This is recommended for ADVANCED users only that are comfortable with changing server settings that may affect the stability of a website.

How it works

When a VirtualHost is configured to allow a custom VirtualHost include (not on by default) you will see a new directory under your "instance" directory at the same level as your "htdocs" folder.

Within the folder you should see files that are tied to your VirtualHost name.  File names that begin with "https." will only apply to the HTTPS portion of the site, while files without "https" will only apply to the HTTP portion.

You can modify this file to add directives that are only available within a VirtualHost config, i.e. Alias

You WILL want to test any changes immediately to verify that you have not mis-configured your site.  A VirtualHost include is only read when an instance starts or is graceful (graceful tells apache to re-read configuration without stopping).  If you do not test it is possible to have your site working fine until the instance is restarted and then everything breaks horribly.

One way to test your config is to use phpShell and test directly:

The first time the configtest returns "OK", the second time is a bad configuration that would cause the instance to fail if restarted.

Once you're happy with the config you can do a "graceful" to make the change take effect.  If you're using phpShell make sure you're using a different instance than the one that you're updating!!!

  • No labels