httpd-wiki-changes mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Httpd Wiki] Update of "VirtualHostAlias" by jink
Date Thu, 13 Dec 2007 13:08:38 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The following page has been changed by jink:

New page:
If you want to host several development projects at once, but are tired of creating hostnames
and directories for every single project, use a setup like this.  It uses mod_vhost_alias
and requires a wildcard DNS entry, like * for example.  For completeness,
create too.

Redirect to  That will put it in the catch-all vhostalias

<VirtualHost *:80>
  Redirect permanent /

A virtualhost needs a valid server name, so we put that here.  Include the wildcard here,

<VirtualHost *:80>
  ServerAlias *

  # %-4+ gives you the 4th part of the hostname from the end, and everything preceding that.
  # becomes www
  # becomes sub.domain
  VirtualDocumentRoot /www/
  CustomLog /var/log/apache2/ combined
  ErrorLog /var/log/apache2/

  # like above, %-4+ gives you the 4th part of the hostname from the end, plus everything
before that.
  # this will setup a /cgi-bin/ ScriptAlias for every vhostalias.
  VirtualScriptAlias /www/

  # specify options and overrides here.
  <Directory /www/>
    Options None
    AllowOverride None
    Order deny,allow

Now, all you need to do is create /www/ and /www/
to get started.
>>From then on, whenever you need a new hostname, just create the appropriate directories.

View raw message