[cgiapp] Re: CGI::Application::Dispatch help

Ron Savage ron at savage.net.au
Sun Jan 18 18:25:11 EST 2009


Hi fREW

On Sat, 2009-01-17 at 12:09 +1100, Ron Savage wrote:
> Hi fREW
> 
> >So I guess my question is why is it ignoring that first directory and
> >how do I get it to stop?
> 
> I have an unreleased module CGI::Application::Test::Dispatch, which I've
> been playing with trying to reproduce your problems.
> 
> I've only tested it under Debian and Apache 2.2.
> 
> I'll try Windows later today.
> 
> So far, I don't have this specific problem of a directory being ignored.
> 
> For instance, this works: http://127.0.0.1/test.dispatch/Phase1
> 
> where as this fails: http://127.0.0.1/test.dispatch/xxxcvvv/Phase1
> as you'd expect, with this error: The requested
> URL /test.dispatch/xxxcvvv/Phase1 was not found on this server.
> 
> httpd.conf contains:
> 
> <Location /test.dispatch>
> 	SetHandler perl-script
> 	PerlResponseHandler CGI::Application::Test::Dispatcher
> 	Order deny,allow
> 	Deny from all
> 	Allow from 127.0.0.1
> </Location>
> 
> More later.

Under Windows, I don't have mod_perl, so I used a CGI script.

Also, this is Apache 2.2, Strawberry Perl 5.10.0.

The code behaves exactly as under Debian, and exactly as expected.

A deliberate failure, e.g. by using
http://127.0.0.1/cgi-bin/test.dispatch.pl/xsld/Phase2
results in a 404 Not Found.

There is no directory c:\apache\htdocs\xsld.

My dispatcher is:

sub dispatch_args
{
	return
	{
		prefix => 'CGI::Application::Test::Dispatch',
		table  =>
		[
		 ''         => {app => 'main-menu', rm => 'menu'},
		 ':app/'    => {rm => 'one'},
		 ':app/:rm' => {},
		],
	};

} # End of dispatch_args.

You'll notice the first rule used '' and not '/'. I wonder if this is
the cause of your problems.

If you have a directory such as $doc_root/xyz, and under mod_perl use
http://127.0.0.1/xyz/something, apache will match the xzy of course.

Since you are using '/', which is just $doc_root, and $doc_root
obviously exists, I think you should try as I have done above, without
the / in '/'.

Let us know what happens.

I assume you are doing that in order to get the dispatcher to control
the whole web site, but perhaps you need to do things differently.

-- 
Ron Savage
ron at savage.net.au
http://savage.net.au/index.html




More information about the cgiapp mailing list