I have a strange problem, I hope someone can help. It seems to lie at
the intersection of apache and mason, so I'm hoping a knowledgeable
Mason user can at least point me in the right direction.
I have a server with several named virtualhosts, including one for
"sbrx.com" and another for "ridgecrestherbals.com". Each is pointed at
a separate directory installed under /srv/www. Unknown named virtual
hosts should get redirected to a third directory called
"apache2-default", which sends an appropriate "virtual host not found"
error message. The first host works fine, mason does its thing, but the
second gets redirected to the error directory, even if the document root
directory is empty and the data cache is cleared. There is nothing in
the error log, but the access log shows a GET to "/" with a 302
response, then a new GET to "/apache2-default/" with a 200 response.
This is what I would expect if the virtualhost dir didn't exist. But it
does the same thing, even if I swap the two directories in /srv/www
(with mv), so it seems to be in the Apache config files somewhere.
The really weird thing is that this happens ONLY on my would-be
deployment/production server, not on my development server. Both
machines are configured EXACTLY the same (as far as apache goes) via an
rsync of the /etc/apache2 directory. Both run Debian stable,
Apache/2.2.3 (Debian) mod_fastcgi/2.4.2 mod_python/3.2.10 Python/2.4.4
PHP/4.4.4-8+etch4 mod_apreq2-20051231/2.6.0 mod_perl/2.0.2 Perl/v5.8.8
Server.
I am stumped. Any suggestions on how to approach this problem? The
production machine is not only a webserver, but runs several other
tasks, so blowing it off and reinstalling is not an easy option, and in
any event, would not explain the weirdness. Any ideas where I should be
looking, or how to get Mason or apache to give more info about WHY it
doesn't see any code in /srv/www/ridgecrestherbals.com/html, at least on
this machine?
I am relatively new to Mason, so any pointers or tips would be
appreciated. The relevant config files follow. But like I said, they
work on my development machine.
/etc/apache2/sites-available/sbrx.com:
<VirtualHost *>
ServerName www.sbrx.com
ServerAlias sbrx.com *.sbrx.com
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /srv/www/sbrx.com/html
<LocationMatch "\.html$">
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</LocationMatch>
</VirtualHost>
/etc/apache2/sites-available/ridgecrestherbals.com:
<VirtualHost *>
ServerName www.ridgecrestherbals.com
ServerAlias ridgecrestherbals.com *.ridgecrestherbals.com
ServerAlias ridgecrestherbals.net *.ridgecrestherbals.net
ServerAlias ridgecrestherbals.org *.ridgecrestherbals.org
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /srv/www/ridgecrestherbals.com/html
# This is a Mason site, see Mason Admin guide for more info
# Load Mason (multiple loads can't hurt)
PerlModule HTML::Mason::ApacheHandler
PerlModule MasonX::Request::WithApacheSession
PerlModule Apache::Session::File
PerlModule Digest::MD5
# Mason needs its directories declared with PerlSetVar
PerlSetVar MasonCompRoot /srv/www/ridgecrestherbals.com/html
PerlSetVar MasonDataDir /srv/www/ridgecrestherbals.com/mason
# you can add an item to a perl list with PerlAddVar
PerlAddVar MasonAllowGlobals $dbh
PerlAddVar MasonAllowGlobals %sql
# set up the session module
PerlSetVar MasonRequestClass MasonX::Request::WithApacheSession
PerlSetVar MasonSessionCookieDomain .ridgecrestherbals.com
PerlSetVar MasonSessionUseCookie 1
PerlSetVar MasonSessionCookieName ridgecrestherbals
#PerlSetVar MasonSessionCookieExpires +2m
#PerlSetVar MasonSessionCookieExpires +7d
PerlSetVar MasonSessionCookieExpires session
PerlSetVar MasonSessionClass Apache::Session::File
PerlSetVar MasonSessionDirectory
/srv/www/ridgecrestherbals.com/session/data
PerlSetVar MasonSessionLockDirectory
/srv/www/ridgecrestherbals.com/session/lock
PerlSetVar MasonStaticSourceTouchFile
/srv/www/ridgecrestherbals.com/html/updated.txt
# configure the document directory
<Directory /srv/www/ridgecrestherbals.com/html>
Options FollowSymLinks
AllowOverride None
# autohandler and dhandler should not appear in directory indexes
IndexIgnore autohandler dhandler syshandler *.m(html|txt|pl)
AddIcon (TXT,/icons/text.gif) .m
</Directory>
# these Mason extensions are externally visible
<LocationMatch "(\.html|\.txt|\.pl)$">
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</LocationMatch>
# these Mason extensions are NOT externally visible
<LocationMatch "(\.m(html|txt|pl)|dhandler|autohandler)$">
SetHandler perl-script
PerlInitHandler Apache::Constants::NOT_FOUND
</LocationMatch>
# Any other extensions get Apache standard treatment
# Mason shouldn't handle gzips, images, or other items
</VirtualHost>
--
Matt Warnock, President
RidgeCrest Herbals, Inc.
Tel: 801-978-9633
Fax: 801-978-9650
begin:vcard
fn:Matt Warnock
n:Warnock;Matt
email;internet:[EMAIL PROTECTED]
tel;work:801-978-9633
tel;fax:801-978-9650
x-mozilla-html:TRUE
version:2.1
end:vcard
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users