flowdy has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Whatever the requested URL, all I get is either the default start page of Poet framework or a static index.html when provided in another directory registered in conf/global.cfg poet file env.comp_dir = [...].

For debugging purposes, I edited the Poet's standard index.mc file to contain the following:

<p>Request info: <% $m->req->env->{SCRIPT_NAME} %> This is the default home page generated by <code><% $m->request_path % +>.</p>
This outputs:
Request info: /demo.mc This is the default home page generated by /.
Seems like Plack does know the requested path but doesn't forward it to Poet/Mason. How come? I append some configuration you might need, please tell if you need for any other:
# in httpd.conf of Apache 2.4 LoadModule fcgid_module modules/mod_fcgid.so <IfModule fcgid_module> #FcgidIPCDir "/tmp/fcgidsock" FcgidMaxProcessesPerClass 100 </IfModule> <Directory "/usr/local/my_site"> Require all granted </Directory> <Location /> SetHandler fcgid-script Options +ExecCGI FcgidWrapper "/usr/local/my_site/bin/start-fcgi.sh" virtual Require all granted </Location> # in start-fcgi.sh is just one line after shebang: # exec plackup -s FCGI app.psgi
# in /usr/local/my_site/conf/global.cfg env: comps_dir: [ '/web/htdocs', "${root_dir}/comps" ] mason: top_level_extensions: [ '.html', '.mc' ]
Requesting root http://$HOST/, I get following error message: SCRIPT_NAME must not be / at /usr/share/perl5/Plack/Middleware/Lint.pm line 40

My versions installed: Mason 2.21, Poet 0.13 (despite of 0.something major release version, installed from Ubuntu Trusty LTS 14.04 official repo, hence I dare considering it "stable". Current version 0.15 according to CPAN but Changes file didn't expose any apparently imported fixes), Plack 1.003, Apache 2.4.9, Mod_fcgid 2.3.9.

Oh wise, as any promising idea strives mindwards from your meditation so deep, could you please tell me? There is poor information on the net, unless I just searched with bad keywords.

-- flowdy

Replies are listed 'Best First'.
Re: Mason via Poet+Plack (FCGI): Request path gets lost
by Anonymous Monk on Jun 25, 2014 at 10:54 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?

Re: Mason via Poet+Plack (FCGI): Request path gets lost
by Anonymous Monk on Jun 25, 2014 at 10:42 UTC

    Can you provide the missing information?

      Sure, but what information? I've included everything I thought might be relevant.