Compiler-Parser
view release on metacpan or search on metacpan
t/app/Plack/Handler/FCGI.t view on Meta::CPAN
Now you can use plackup to listen to the socket that you've just configured in Apache.
$ plackup -s FCGI --listen /tmp/myapp.sock psgi/myapp.psgi
The above describes the "standalone" method, which is usually appropriate.
There are other methods, described in more detail at
L<Catalyst::Engine::FastCGI/Standalone_server_mode> (with regards to Catalyst, but which may be set up similarly for Plack).
See also L<http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html#FastCgiExternalServer>
for more details.
=head3 lighttpd
To host the app in the root path, you're recommended to use lighttpd
1.4.23 or newer with C<fix-root-scriptname> flag like below.
fastcgi.server = ( "/" =>
((
"socket" => "/tmp/fcgi.sock",
"check-local" => "disable",
"fix-root-scriptname" => "enable",
))
If you use lighttpd older than 1.4.22 where you don't have
C<fix-root-scriptname>, mouting apps under the root causes wrong
C<SCRIPT_NAME> and C<PATH_INFO> set. Also, mouting under the empty
root (C<"">) or a path that has a trailing slash would still cause
weird values set even with C<fix-root-scriptname>. In such cases you
can use L<Plack::Middleware::LighttpdScriptNameFix> to fix it.
To mount in the non-root path over TCP:
fastcgi.server = ( "/foo" =>
((
"host" = "127.0.0.1",
"port" = "5000",
"check-local" => "disable",
))
It's recommended that your mount path does B<NOT> have the trailing
slash. If you I<really> need to have one, you should consider using
L<Plack::Middleware::LighttpdScriptNameFix> to fix the wrong
B<PATH_INFO> values set by lighttpd.
=cut
=head2 Authorization
Most fastcgi configuration does not pass C<Authorization> headers to
C<HTTP_AUTHORIZATION> environment variable by default for security
reasons. Authentication middleware such as L<Plack::Middleware::Auth::Basic> or
L<Catalyst::Authentication::Credential::HTTP> requires the variable to
be set up. Plack::Handler::FCGI supports extracting the C<Authorization> environment
variable when it is configured that way.
Apache2 with mod_fastcgi:
--pass-header Authorization
mod_fcgid:
FcgiPassHeader Authorization
=head1 SEE ALSO
L<Plack>
=cut
( run in 0.526 second using v1.01-cache-2.11-cpan-5735350b133 )