NameVirtualHost *
<VirtualHost www.host1.com>
ServerName www.host1.com
ServerAlias host1.com *.host1.com
DocumentRoot /home/httpd/vhosts/host1.com/httpdocs/
PerlModule HTML::Mason::ApacheHandler
PerlAddVar MasonAllowGlobals $DBH
PerlAddVar MasonAllowGlobals $memd
PerlSetVar MasonCompRoot /home/httpd/vhosts/host1.com/httpdocs/
PerlSetVar MasonDataDir /etc/httpd/mason
<LocationMatch "(\.html|\.txt|\.pl)$">
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</LocationMatch>
<LocationMatch "(\.m(html|txt|pl)|dhandler|autohandler)$">
SetHandler perl-script
PerlInitHandler Apache::Constants::NOT_FOUND
</LocationMatch>
</VirtualHost>
<VirtualHost www.host2.com>
PerlSetVar MasonCompRoot /home/httpd/vhosts/host2.com/httpdocs/
PerlSetVar MasonDataDir /www/mason
SetHandler None
<LocationMatch "(\.php|\.php|\.html)">
SetHandler php-script
</LocationMatch>
ServerName www.host2.com
ServerAlias host2.com *.host2.com
DocumentRoot /home/httpd/vhosts/host2.com/httpdocs/
</VirtualHost>
I know many of these lines are nothing short of worthless. I've tried to make absolutely sure that mason would work on host1, but not on host2. I've swapped the order many times, but the outcome is the same. If you go to host1 first, it will generate an autohandler and an index.html in the cache. If you go to host2 after this, it will attempt to execute the autohandler, and quickly die from errors (calling nonexistant variables, etc). If host2 is accessed first, it will generate a index.html from the wrong site, and it will break host1. I've tried nearly everything I could think of, and none of my configurations have worked. Any help would be appreciated, and a definitive solution would be a nice add to the installation instructions webpage.
My system:
Fedora Core 2
apache 1.3.x
mod_perl 1
Any help would be appreciated,
Nathan Davis

