Just an update. Thanks to those who responded. Read permissions were
OK, verified by mv'ing the directories to swap between them. Doesn't
seem to be a DNS problem, as the "%v" entry in the Apache access log is
correct, but there may still be some subtle interplay between DNS and
Apache somewhere, as I have confirmed it on another host in the same DNS
domain (the development host is in another DNS domain). But it does
seem to be an Apache problem, as it continues even when Mason is
configured out of the virtualhosts. For now I have made the
ridgecrestherbals.com server the default server, so when Apache doesn't
find the right virtual host, it still serves the right content, but its
an ugly workaround. I'll take the problem to an Apache list, though.
Thanks again for the input.
Matt Warnock, President
RidgeCrest Herbals, Inc.
Tel: 801-978-9633
Fax: 801-978-9650
------------------------------------------------------------------------
Subject:
[Mason] Mason unwanted redirect problem
From:
Matt Warnock <[EMAIL PROTECTED]>
Date:
Thu, 16 Aug 2007 02:15:08 -0600
To:
[email protected]
To:
[email protected]
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>
------------------------------------------------------------------------
Subject:
Re: [Mason] Mason unwanted redirect problem
From:
Sherrard Burton <[EMAIL PROTECTED]>
Date:
Thu, 16 Aug 2007 08:57:46 -0400
To:
Matt Warnock <[EMAIL PROTECTED]>
To:
Matt Warnock <[EMAIL PROTECTED]>
CC:
[email protected]
a few suggestions:
strip the apache config down to the bare minimum. no mason setup, no
directory and location directives, just ServerName, ServerAlias and
DocumentRoot, restart apache, and see if it still happens. this would
eliminate mason and it's configs as a culprit.
pull up ethereal/wireshark and check the host request headers and the
location response headers and see if there is some significant
difference between what is happening on the development server vs the
production server. i'm guessing that whatever method you are using for
name resolution (/etc/hosts, bind, etc.) may be producing a request
that your apache setup thinks is for a non-existent virtual host.
what happens if you request a plain html that actually does exist? do
you get the same behavior?
good luck
Subject:
Re: [Mason] Mason unwanted redirect problem
From:
Malcolm <[EMAIL PROTECTED]>
Date:
Thu, 16 Aug 2007 09:23:57 -0400
To:
[email protected]
To:
[email protected]
CC:
Matt Warnock <[EMAIL PROTECTED]>
On Thursday 16 August 2007 4:15:08 am Matt Warnock wrote:
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?
Have you checked the permissions on the directory? If apache can't read it,
you'd get the symptoms you describe. (Probably obvious, but sometimes the
obvious things are the ones you forget to check).
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users