root/lang/perl/CatalystX-Plugin-Engine-FastCGI-Lighttpd/trunk/lib/CatalystX/Plugin/Engine/FastCGI/Lighttpd.pm @ 31937

Revision 31937, 2.7 kB (checked in by holidays-l, 6 years ago)

ドキュメント修正

Line 
1#
2# $Id$
3#
4package CatalystX::Plugin::Engine::FastCGI::Lighttpd;
5use strict;
6use warnings;
7use utf8;
8use version; our $VERSION = qv('0.0.2');
9
10use NEXT;
11
12sub handle_request {
13    my ( $c, %args ) = @_;
14
15    my $env_ref = $args{env};
16
17    if ( ( $env_ref->{SERVER_SOFTWARE} || q{} ) !~ /lighttpd/msx ) {
18        $c->log->warn(__PACKAGE__ . ': Do you want to apply this really?');
19    }
20
21    if ( $c->engine ne 'Catalyst::Engine::FastCGI' ) {
22        $c->log->warn(__PACKAGE__ . ': Do you want to apply this really?');
23    }
24
25    ( $env_ref->{PATH_INFO}, $env_ref->{QUERY_STRING} ) =
26      ( split /\?/msx, $env_ref->{REQUEST_URI}, 2 );
27
28    $env_ref->{HTTP_X_FORWARDED_HOST} ||= $env_ref->{HTTP_X_HOST};
29
30    return $c->NEXT::handle_request(%args);
31}
32
331;
34
35__END__
36
37=head1 NAME
38
39CatalystX::Plugin::Engine::FastCGI::Lighttpd - Fix up for FastCGI on Lighttpd.
40
41=head1 VERSION
42
43This document describes CatalystX::Plugin::Engine::FastCGI::Lighttpd version 0.0.2
44
45=head1 SYNOPSIS
46
47    # 1. in your MyApp.pm
48    use Catalyst qw(+CatalystX::Engine::FastCGI::Lighttpd);
49   
50    #    when lighttpd is behind proxy
51    __PACKAGE__->config( using_frontend_proxy => 1 );
52   
53    # 2. in your lighttpd.conf
54    server.error-handler-404 = "DISPATCH_TO_CATALYST"
55    fastcgi.server = ( "DISPATCH_TO_CATALYST" =>
56                       (( "socket" => "/path/to/myapp.socket",
57                          "bin-path" => "/usr/bin/perl /path/to/myapp_fastcgi.pl",
58                          "check-local" => "disable" )))
59
60=head1 DESCRIPTION
61
62C::E::FastCGI could not treat with PATH_INFO and QUERY_STRING correctly.
63This module fix up it.
64mod_proxy of Lighttpd does not set HTTP_X_FORWARDED_HOST.
65This module fix up it.
66
67=head1 SUBROUTINES/METHODS
68
69=head2 handle_request( $c, %args )
70
71It rebuild PATH_INFO and QUERY_STRING from REQUEST_URI.
72
73=head1 DIAGNOSTICS
74
75=over
76
77=item Do you want to apply this really?
78
79This module works only on fastcgi-lighttpd.
80
81=back
82
83=head1 CONFIGURATION AND ENVIRONMENT
84
85CatalystX::Plugin::Engine::FastCGI::Lighttpd requires no configuration files or environment variables.
86
87=head1 DEPENDENCIES
88
89None.
90
91=head1 INCOMPATIBILITIES
92
93None reported.
94
95=head1 BUGS AND LIMITATIONS
96
97No bugs have been reported.
98
99Please report any bugs or feature requests to
100C<bug-catalystx-plugin-engine-fastcgi-lighttpd@rt.cpan.org>, or through the web interface at
101L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CatalystX-Plugin-Engine-FastCGI-Lighttpd>.
102I will be notified, and then you'll automatically be notified of progress on
103your bug as I make changes.
104
105=head1 AUTHOR
106
107Hironori Yoshida <yoshida@cpan.org>
108
109=head1 LICENSE AND COPYRIGHT
110
111This module is free software; you can redistribute it and/or
112modify it under the same terms as Perl itself. See L<perlartistic>.
113
114=cut
Note: See TracBrowser for help on using the browser.