Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Mason via Poet+Plack (FCGI): Request path gets lost

by Anonymous Monk
on Jun 25, 2014 at 10:54 UTC ( [id://1091165]=note: print w/replies, xml ) Need Help??


in reply to Mason via Poet+Plack (FCGI): Request path gets lost

fcgi plack "SCRIPT_NAME must not be /" -> Error "SCRIPT_NAME must not be /" in FCGI mode · Issue #308 · plack/Plack · GitHub
this is a problem with your web server (FastCGI) settings. You have to configure it so that the SCRIPT_NAME won't have the value of "/", instead "" (an empty string). Read the documentation Plack::Handler::FCGI for more.
  • Comment on Re: Mason via Poet+Plack (FCGI): Request path gets lost

Replies are listed 'Best First'.
Re^2: Mason via Poet+Plack (FCGI): Request path gets lost
by flowdy (Scribe) on Jun 25, 2014 at 12:10 UTC

    The docs you are linking to actually include information on how to configure path info and script name, however related to nginx. I'm using Apache 2.4 with mod_fcgid, so the docs loose me here. Tried FcgiFixPathinfo 1 to no avail either. Googling mod_fcgid and script_name reveals PHP-related stuff only beside of e.g. Bug 52710 - mod_fcgid should set PATH_INFO when configured in 'virtual' mode. This bug still has status flag "NEW". Can't quite imagine mod_fcgid is broken like that.

      I got a question, you know how you have this
      <Location /> ... FcgidWrapper "/usr/local/my_site/bin/start-fcgi.sh" virtual

      What tells apache that /anything/whatsoever/here gets served by start-fcgi.sh?

        Hi Monk,

        Changing it to <LocationMatch "^/"> has no effect. But I found a work-around (that is, not quite a solution I would call one) which is tweaking the subroutine returned by the builder call in bin/app.psgi that way:

        builder { # [...] sub { my $psgi_env = shift; /^\/$/ and $_ = "" for $psgi_env->{SCRIPT_NAME}; $psgi_env->{PATH_INFO} ||= trim( @{$psgi_env}{'SCRIPT_FILENAME', 'DOCUMENT_ROOT'}, ". +html" ); $poet->app_class('Mason')->handle_psgi($psgi_env); }; }; sub trim { my ($string, $head, $tail) = @_; $string =~ s{ \A \Q$head\E (.+?) \Q$tail\E \z }{$1}xmsr; }

        What concerns the SCRIPT_NAME line added as well, however, it still does not work.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1091165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found