httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <>
Subject Re: [users@httpd] mod_frontpage state of the art
Date Wed, 03 Aug 2005 13:55:27 GMT
OK, I think I have solved getting mod_frontpage to work with a mod_rewrite
virtual host configuration. For the benefit of the archives, here's what I

(1) The CGIs make use of the SERVER_NAME environment variable
(2) They then look this up in the httpd.conf pointed to by
    and look for a <VirtualHost> container to find the DocumentRoot

So I needed a small patch to mod_frontpage to set SERVER_NAME from HTTP_HOST
(or HTTP_X_FORWARDED_HOST in my proxy environment), and I also needed to
generate a plaintext mini-httpd.conf purely for frontpage to read:

Port 80 
ServerRoot "/usr/local"
ResourceConfig /dev/null
AccessConfig /dev/null
DocumentRoot /usr/local/www/data

<VirtualHost _default_>
DocumentRoot /usr/local/www/data-example

Then point /usr/local/frontpage/ at that:


Doing it this way, rather than driving Apache from the <VirtualHost>
containers, means I can add and remove sites dynamically without having to
restart Apache; mod_rewrite looks them up in a separate dbm file.

One other point to note: you should put
AddModule mod_frontpage.c
at the *end* of the AddModules. This is so that it processes the request
first; it looks at the pathname and sets the magic MIME type automatically,
but returns DECLINED so that other modules can perform the actual URI to
Filename translation. As a result, I no longer have to mess with MIME types
in mod_rewrite: just

RewriteCond %{ENV:HOSTMAP} ^(/[^,]+)
RewriteRule ^(/_vti_bin/?.*)$ \
        %1$1 [L]

is all I need, where the HOSTMAP environment variable has been set up from a
previous RewriteMap lookup giving the path to the site's root dir.



View raw message