[Catalyst] Lighttpd and fastcgi

Nigel Metheringham nigel.metheringham at dev.intechnology.co.uk
Fri Jan 20 17:03:50 CET 2006


On Fri, 2006-01-20 at 21:35 +0900, Daisuke Murase wrote:
> I'm using mod_setenv module for this problem.
> 
> example:
> 
>     $HTTP["url"] =~ "^/myapp/" {
>         setenv.add-environment = ( "SCRIPT_NAME" => "/myapp/" )
>     }
> 
> With this config, you can see $c->req->base is 'http://.../myapp/'
> under /myapp/ path.

Thats making base work... at the price of breaking everything else :-)

It appears that (for my app at the root of the web server), the values
passed should look something like:-
  SCRIPT_NAME = '/'
  PATH_INFO = '/useradmin/chpass'

Whats happening instead is that I'm getting this:-
  SCRIPT_NAME = '/useradmin/chpass'
  PATH_INFO = 

Now forcing SCRIPT_NAME to / is causing the useful data that should be
in PATH_INFO to be lost.

[later...]

OK, have worked out *whats* wrong.
It all goes wrong if you have your cat app at the webserver root, so my
fastcgi config stanza looked like:-


        fastcgi.server             = (
           "" => (
              "MyApp" => (
                 "socket"       => "/tmp/MyApp.socket",
                 "check-local"  => "disable",
                 "bin-path"     => "/usr/share/myapp/script/myapp_fastcgi.pl",
                 "min-procs"    => 1,
                 "max-procs"    => 3,
                 "idle-timeout" => 20
              )
           )
        )

Putting it at another part of the url namespace makes it work OK -
without any SCRIPT_NAME hacking required:-

        fastcgi.server             = (
           "/app" => (
              "MyApp" => (
                 "socket"       => "/tmp/MyApp.socket",
                 "check-local"  => "disable",
                 "bin-path"     => "/usr/share/myapp/script/myapp_fastcgi.pl",
                 "min-procs"    => 1,
                 "max-procs"    => 3,
                 "idle-timeout" => 20
              )
           )
        )


	Nigel.

-- 
[ Nigel Metheringham           Nigel.Metheringham at InTechnology.co.uk ]
[ - Comments in this message are my own and not ITO opinion/policy - ]





More information about the Catalyst mailing list