in reply to Plack beer challenge

http://blog.robin.smidsrod.no/2009/10/25/how-to-get-a-psgi-app-running-with-mod_f
Plack::App::Apache::ActionWrapper - Wrapper for Apache2 Action directive for running PSGI apps on shared hosting with FastCGI
Deploying Plack Web Applications: OSCON 2011
Plack::Handler::FCGI
http://search.cpan.org/~xsawyerx/Dancer-1.3072/lib/Dancer/Deployment.pod#Running_as_a_cgi-script_%28or_fast-cgi%29
Introduction a plack
plackup -s FCGI --listen /tmp/fcgi.sock --daemonize --nproc 10
Plack basics for Perl websites - YAPC::EU 2011

Replies are listed 'Best First'.
Re^2: Plack beer challenge
by morgon (Priest) on Sep 29, 2011 at 13:37 UTC
    Ok.

    This is exactly the type of answer I was NOT looking for.

    While I believe that your links may contain the answer I have already proven to myself beyond any doubt that I am too stupid to properly understand them...

    Here is my app:

    #!/home/mh/perl514/bin/plackup -s FCGI --listen /tmp/fcgi.sock --daemo +nize --nproc 10 use strict; use warnings; return sub { return [ 200, ["Content-Type" => "text/plain"], ["hi"] ]; }
    Started on it's own it actually works - it starts a web-server on port 5000 that delivers the proper result.

    But how to make this work in Apache?

    I have put this app as "app.psgi" in /usr/lib/cgi-bin and this is my apache-config:

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all AddHandler fcgid-script .psgi </Directory>
    Now what happens is that when I try point my browser to the plack-app apache I get an internal server error.

    The plack-app actually is launched (there is a process visible), but it seems to me that the plack-app and apache cannot communicate as I can see in the error log that fcgid reports a read timeout and the really weird thing is that I have this line in the error log HTTP::Server::PSGI: Accepting connections at http://0:5000

    So to me it seems as if Plack is not aware that it runs under apache for some reasons...

    The beer is still for grabs...

      #!/home/mh­/perl514/b­in/plackup -s FCGI --listen /tmp/fcgi.­sock --da +emoniz­e --nproc 10

      When the kernel honors a #! line, it only handles up to 1 argument. It certainly isn't portable to put so many options on your #! unless some non-standard method (not the Unix kernel) is doing the exec.

      - tye        

        Fair enough.

        I was only trying what I had gathered from a previous posting.

        The main question remains: How is it done properly?