Fix undef warning in Engine::FastCGI
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / FastCGI.pm
CommitLineData
d1d9793f 1package Catalyst::Engine::FastCGI;
ffb41d94 2
7fa2c9c1 3use Moose;
4extends 'Catalyst::Engine::CGI';
5
0fc2d522 6# eval { Class::MOP::load_class("FCGI") };
6f409682 7eval "use FCGI";
500a1679 8die "Unable to load the FCGI module, you may need to install it:\n$@\n" if $@;
ffb41d94 9
10=head1 NAME
11
fbcc39ad 12Catalyst::Engine::FastCGI - FastCGI Engine
ffb41d94 13
14=head1 DESCRIPTION
15
fbcc39ad 16This is the FastCGI engine.
ffb41d94 17
e2fd5b5f 18=head1 OVERLOADED METHODS
19
fbcc39ad 20This class overloads some methods from C<Catalyst::Engine::CGI>.
e2fd5b5f 21
b5ecfcf0 22=head2 $self->run($c, $listen, { option => value, ... })
b0ad47c1 23
5898abae 24Starts the FastCGI server. If C<$listen> is set, then it specifies a
25location to listen for FastCGI requests;
26
b799b493 27=over 4
28
29=item /path
30
31listen via Unix sockets on /path
32
33=item :port
34
35listen via TCP on port on all interfaces
36
37=item hostname:port
38
39listen via TCP on port bound to hostname
40
41=back
5898abae 42
43Options may also be specified;
44
b799b493 45=over 4
46
47=item leave_umask
48
88eee38e 49Set to 1 to disable setting umask to 0 for socket open
50
51=item nointr
b799b493 52
53Do not allow the listener to be interrupted by Ctrl+C
54
55=item nproc
56
57Specify a number of processes for FCGI::ProcManager
58
59=item pidfile
60
61Specify a filename for the pid file
62
63=item manager
64
65Specify a FCGI::ProcManager sub-class
66
b0ad47c1 67=item detach
b799b493 68
69Detach from console
70
71=item keep_stderr
72
73Send STDERR to STDOUT instead of the webserver
74
75=back
e2fd5b5f 76
77=cut
78
fbcc39ad 79sub run {
5898abae 80 my ( $self, $class, $listen, $options ) = @_;
81
5db46287 82 my $sock = 0;
5898abae 83 if ($listen) {
84 my $old_umask = umask;
85 unless ( $options->{leave_umask} ) {
86 umask(0);
87 }
88 $sock = FCGI::OpenSocket( $listen, 100 )
89 or die "failed to open FastCGI socket; $!";
90 unless ( $options->{leave_umask} ) {
91 umask($old_umask);
92 }
93 }
6f2e0021 94 elsif ( $^O ne 'MSWin32' ) {
5898abae 95 -S STDIN
96 or die "STDIN is not a socket; specify a listen location";
97 }
98
99 $options ||= {};
6f409682 100
84528885 101 my %env;
6fc58422 102 my $error = \*STDERR; # send STDERR to the web server
103 $error = \*STDOUT # send STDERR to stdout (a logfile)
85d9fce6 104 if $options->{keep_stderr}; # (if asked to)
cfd31158 105
5898abae 106 my $request =
6fc58422 107 FCGI::Request( \*STDIN, \*STDOUT, $error, \%env, $sock,
5898abae 108 ( $options->{nointr} ? 0 : &FCGI::FAIL_ACCEPT_ON_INTR ),
109 );
110
111 my $proc_manager;
6f409682 112
113 if ($listen) {
526b698a 114 $options->{manager} ||= "FCGI::ProcManager";
115 $options->{nproc} ||= 1;
8865ee12 116 $options->{proc_title} ||= "perl-fcgi-pm [$class]";
b5ecfcf0 117
526b698a 118 $self->daemon_fork() if $options->{detach};
b5ecfcf0 119
526b698a 120 if ( $options->{manager} ) {
121 eval "use $options->{manager}; 1" or die $@;
122
b5ecfcf0 123 $proc_manager = $options->{manager}->new(
124 {
526b698a 125 n_processes => $options->{nproc},
126 pid_fname => $options->{pidfile},
8865ee12 127 pm_title => $options->{proc_title},
b5ecfcf0 128 }
129 );
130
526b698a 131 # detach *before* the ProcManager inits
132 $self->daemon_detach() if $options->{detach};
133
134 $proc_manager->pm_manage();
cfd31158 135
136 # Give each child its own RNG state.
137 srand;
dc2fc680 138 }
526b698a 139 elsif ( $options->{detach} ) {
140 $self->daemon_detach();
b5ecfcf0 141 }
5898abae 142 }
e2fd5b5f 143
fbcc39ad 144 while ( $request->Accept >= 0 ) {
5898abae 145 $proc_manager && $proc_manager->pm_pre_dispatch();
cfd31158 146
c46dd4e8 147 $self->_fix_env( \%env );
cfd31158 148
84528885 149 $class->handle_request( env => \%env );
cfd31158 150
9f778270 151 $proc_manager && $proc_manager->pm_post_dispatch();
fbcc39ad 152 }
e2fd5b5f 153}
154
b5ecfcf0 155=head2 $self->write($c, $buffer)
e2fd5b5f 156
157=cut
158
fbcc39ad 159sub write {
160 my ( $self, $c, $buffer ) = @_;
4f5ebacd 161
6ca73485 162 # ->write will be called once with the body, even in a redirect (and
163 # in that case, the body is undef)
164 $buffer = '' if !defined $buffer;
165
02570318 166 unless ( $self->_prepared_write ) {
4f5ebacd 167 $self->prepare_write($c);
02570318 168 $self->_prepared_write(1);
fbcc39ad 169 }
b0ad47c1 170
e512dd24 171 # XXX: We can't use Engine's write() method because syswrite
172 # appears to return bogus values instead of the number of bytes
173 # written: http://www.fastcgi.com/om_archive/mail-archive/0128.html
b0ad47c1 174
e512dd24 175 # Prepend the headers if they have not yet been sent
02570318 176 if ( $self->_has_header_buf ) {
177 $buffer = $self->_clear_header_buf . $buffer;
e512dd24 178 }
4f5ebacd 179
fbcc39ad 180 # FastCGI does not stream data properly if using 'print $handle',
181 # but a syswrite appears to work properly.
4f5ebacd 182 *STDOUT->syswrite($buffer);
e2fd5b5f 183}
184
b5ecfcf0 185=head2 $self->daemon_fork()
526b698a 186
187Performs the first part of daemon initialisation. Specifically,
188forking. STDERR, etc are still connected to a terminal.
189
190=cut
191
192sub daemon_fork {
193 require POSIX;
194 fork && exit;
195}
196
b5ecfcf0 197=head2 $self->daemon_detach( )
526b698a 198
199Performs the second part of daemon initialisation. Specifically,
200disassociates from the terminal.
201
202However, this does B<not> change the current working directory to "/",
203as normal daemons do. It also does not close all open file
204descriptors (except STDIN, STDOUT and STDERR, which are re-opened from
205F</dev/null>).
206
207=cut
208
209sub daemon_detach {
210 my $self = shift;
211 print "FastCGI daemon started (pid $$)\n";
b5ecfcf0 212 open STDIN, "+</dev/null" or die $!;
213 open STDOUT, ">&STDIN" or die $!;
214 open STDERR, ">&STDIN" or die $!;
526b698a 215 POSIX::setsid();
216}
217
c46dd4e8 218=head2 $self->_fix_env( $env )
219
220Adjusts the environment variables when necessary.
221
222=cut
223
224sub _fix_env
225{
226 my $self = shift;
227 my $env = shift;
228
b0ad47c1 229 # we are gonna add variables from current system environment %ENV to %env
0c913601 230 # that contains at this moment just variables taken from FastCGI request
231 foreach my $k (keys(%ENV)) {
232 $env->{$k} = $ENV{$k} unless defined($env->{$k});
233 }
234
c46dd4e8 235 return unless ( $env->{SERVER_SOFTWARE} );
236
237 # If we're running under Lighttpd, swap PATH_INFO and SCRIPT_NAME
238 # http://lists.scsys.co.uk/pipermail/catalyst/2006-June/008361.html
239 # Thanks to Mark Blythe for this fix
240 if ( $env->{SERVER_SOFTWARE} =~ /lighttpd/ ) {
241 $env->{PATH_INFO} ||= delete $env->{SCRIPT_NAME};
242 }
1dea1c87 243 elsif ( $env->{SERVER_SOFTWARE} =~ /^nginx/ ) {
244 my $script_name = $env->{SCRIPT_NAME};
245 $env->{PATH_INFO} =~ s/^$script_name//g;
246 }
5351e13d 247 # Fix the environment variables PATH_INFO and SCRIPT_NAME when running
248 # under IIS
63630a22 249 elsif ( $env->{SERVER_SOFTWARE} =~ /IIS\/[6-9]\.[0-9]/ ) {
c46dd4e8 250 my @script_name = split(m!/!, $env->{PATH_INFO});
251 my @path_translated = split(m!/|\\\\?!, $env->{PATH_TRANSLATED});
252 my @path_info;
253
254 while ($script_name[$#script_name] eq $path_translated[$#path_translated]) {
255 pop(@path_translated);
256 unshift(@path_info, pop(@script_name));
257 }
258
259 unshift(@path_info, '', '');
260
261 $env->{PATH_INFO} = join('/', @path_info);
262 $env->{SCRIPT_NAME} = join('/', @script_name);
263 }
264}
265
198b0efa 2661;
267__END__
268
198b0efa 269=head1 WEB SERVER CONFIGURATIONS
270
d7d72ad9 271=head2 Standalone FastCGI Server
272
b0ad47c1 273In server mode the application runs as a standalone server and accepts
d7d72ad9 274connections from a web server. The application can be on the same machine as
275the web server, on a remote machine, or even on multiple remote machines.
276Advantages of this method include running the Catalyst application as a
277different user than the web server, and the ability to set up a scalable
278server farm.
198b0efa 279
d7d72ad9 280To start your application in server mode, install the FCGI::ProcManager
281module and then use the included fastcgi.pl script.
198b0efa 282
d7d72ad9 283 $ script/myapp_fastcgi.pl -l /tmp/myapp.socket -n 5
b0ad47c1 284
d7d72ad9 285Command line options for fastcgi.pl include:
286
287 -d -daemon Daemonize the server.
288 -p -pidfile Write a pidfile with the pid of the process manager.
289 -l -listen Listen on a socket path, hostname:port, or :port.
290 -n -nproc The number of processes started to handle requests.
b0ad47c1 291
d7d72ad9 292See below for the specific web server configurations for using the external
293server.
198b0efa 294
d7d72ad9 295=head2 Apache 1.x, 2.x
296
297Apache requires the mod_fastcgi module. The same module supports both
298Apache 1 and 2.
299
b0ad47c1 300There are three ways to run your application under FastCGI on Apache: server,
d7d72ad9 301static, and dynamic.
302
303=head3 Standalone server mode
304
3f0911d3 305 FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket
439bc59c 306 Alias /myapp/ /tmp/myapp.fcgi/
b0ad47c1 307
d7d72ad9 308 # Or, run at the root
3f0911d3 309 Alias / /tmp/myapp.fcgi/
b0ad47c1 310
d7d72ad9 311 # Optionally, rewrite the path when accessed without a trailing slash
312 RewriteRule ^/myapp$ myapp/ [R]
b0ad47c1 313
3f0911d3 314
315The FastCgiExternalServer directive tells Apache that when serving
316/tmp/myapp to use the FastCGI application listenting on the socket
303c087d 317/tmp/mapp.socket. Note that /tmp/myapp.fcgi B<MUST NOT> exist --
3f0911d3 318it's a virtual file name. With some versions of C<mod_fastcgi> or
303c087d 319C<mod_fcgid>, you can use any name you like, but some require that the
3f0911d3 320virtual filename end in C<.fcgi>.
d7d72ad9 321
b0ad47c1 322It's likely that Apache is not configured to serve files in /tmp, so the
d7d72ad9 323Alias directive maps the url path /myapp/ to the (virtual) file that runs the
324FastCGI application. The trailing slashes are important as their use will
325correctly set the PATH_INFO environment variable used by Catalyst to
326determine the request path. If you would like to be able to access your app
327without a trailing slash (http://server/myapp), you can use the above
328RewriteRule directive.
329
330=head3 Static mode
331
332The term 'static' is misleading, but in static mode Apache uses its own
333FastCGI Process Manager to start the application processes. This happens at
334Apache startup time. In this case you do not run your application's
335fastcgi.pl script -- that is done by Apache. Apache then maps URIs to the
336FastCGI script to run your application.
337
338 FastCgiServer /path/to/myapp/script/myapp_fastcgi.pl -processes 3
339 Alias /myapp/ /path/to/myapp/script/myapp_fastcgi.pl/
b0ad47c1 340
d7d72ad9 341FastCgiServer tells Apache to start three processes of your application at
342startup. The Alias command maps a path to the FastCGI application. Again,
343the trailing slashes are important.
b0ad47c1 344
d7d72ad9 345=head3 Dynamic mode
346
b0ad47c1 347In FastCGI dynamic mode, Apache will run your application on demand,
d7d72ad9 348typically by requesting a file with a specific extension (e.g. .fcgi). ISPs
349often use this type of setup to provide FastCGI support to many customers.
350
351In this mode it is often enough to place or link your *_fastcgi.pl script in
352your cgi-bin directory with the extension of .fcgi. In dynamic mode Apache
353must be able to run your application as a CGI script so ExecCGI must be
354enabled for the directory.
355
356 AddHandler fastcgi-script .fcgi
357
358The above tells Apache to run any .fcgi file as a FastCGI application.
359
360Here is a complete example:
361
362 <VirtualHost *:80>
363 ServerName www.myapp.com
364 DocumentRoot /path/to/MyApp
365
366 # Allow CGI script to run
367 <Directory /path/to/MyApp>
368 Options +ExecCGI
369 </Directory>
370
371 # Tell Apache this is a FastCGI application
372 <Files myapp_fastcgi.pl>
373 SetHandler fastcgi-script
374 </Files>
198b0efa 375 </VirtualHost>
d7d72ad9 376
377Then a request for /script/myapp_fastcgi.pl will run the
378application.
b0ad47c1 379
198b0efa 380For more information on using FastCGI under Apache, visit
381L<http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html>
382
25f55123 383=head3 Authorization header with mod_fastcgi or mod_cgi
384
385By default, mod_fastcgi/mod_cgi do not pass along the Authorization header,
386so modules like C<Catalyst::Plugin::Authentication::Credential::HTTP> will
387not work. To enable pass-through of this header, add the following
388mod_rewrite directives:
389
390 RewriteCond %{HTTP:Authorization} ^(.+)
391 RewriteRule ^(.*)$ $1 [E=HTTP_AUTHORIZATION:%1,PT]
392
198b0efa 393=head2 Lighttpd
394
d7d72ad9 395These configurations were tested with Lighttpd 1.4.7.
396
397=head3 Standalone server mode
398
399 server.document-root = "/var/www/MyApp/root"
400
401 fastcgi.server = (
402 "" => (
403 "MyApp" => (
404 "socket" => "/tmp/myapp.socket",
405 "check-local" => "disable"
406 )
407 )
408 )
409
410=head3 Static mode
198b0efa 411
412 server.document-root = "/var/www/MyApp/root"
b0ad47c1 413
198b0efa 414 fastcgi.server = (
415 "" => (
416 "MyApp" => (
417 "socket" => "/tmp/myapp.socket",
418 "check-local" => "disable",
419 "bin-path" => "/var/www/MyApp/script/myapp_fastcgi.pl",
420 "min-procs" => 2,
421 "max-procs" => 5,
422 "idle-timeout" => 20
423 )
424 )
425 )
b0ad47c1 426
d7d72ad9 427Note that in newer versions of lighttpd, the min-procs and idle-timeout
428values are disabled. The above example would start 5 processes.
25810c41 429
d7d72ad9 430=head3 Non-root configuration
b0ad47c1 431
d7d72ad9 432You can also run your application at any non-root location with either of the
2f381252 433above modes. Note the required mod_rewrite rule.
198b0efa 434
2f381252 435 url.rewrite = ( "myapp\$" => "myapp/" )
198b0efa 436 fastcgi.server = (
d7d72ad9 437 "/myapp" => (
198b0efa 438 "MyApp" => (
d7d72ad9 439 # same as above
198b0efa 440 )
441 )
442 )
443
444For more information on using FastCGI under Lighttpd, visit
445L<http://www.lighttpd.net/documentation/fastcgi.html>
446
5351e13d 447=head2 nginx
448
449Catalyst runs under nginx via FastCGI in a similar fashion as the lighttpd
450standalone server as described above.
451
452nginx does not have its own internal FastCGI process manager, so you must run
453the FastCGI service separately.
454
455=head3 Configuration
456
457To configure nginx, you must configure the FastCGI parameters and also the
458socket your FastCGI daemon is listening on. It can be either a TCP socket
459or a Unix file socket.
460
461The server configuration block should look roughly like:
462
463 server {
464 listen $port;
465
466 location / {
64edd9df 467 fastcgi_param QUERY_STRING $query_string;
468 fastcgi_param REQUEST_METHOD $request_method;
469 fastcgi_param CONTENT_TYPE $content_type;
470 fastcgi_param CONTENT_LENGTH $content_length;
471
5a7d7e5c 472 fastcgi_param SCRIPT_NAME /;
473 fastcgi_param PATH_INFO $fastcgi_script_name;
64edd9df 474 fastcgi_param REQUEST_URI $request_uri;
475 fastcgi_param DOCUMENT_URI $document_uri;
476 fastcgi_param DOCUMENT_ROOT $document_root;
477 fastcgi_param SERVER_PROTOCOL $server_protocol;
5351e13d 478
479 fastcgi_param GATEWAY_INTERFACE CGI/1.1;
64edd9df 480 fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
5351e13d 481
64edd9df 482 fastcgi_param REMOTE_ADDR $remote_addr;
483 fastcgi_param REMOTE_PORT $remote_port;
484 fastcgi_param SERVER_ADDR $server_addr;
485 fastcgi_param SERVER_PORT $server_port;
486 fastcgi_param SERVER_NAME $server_name;
5351e13d 487
488 # Adjust the socket for your applications!
489 fastcgi_pass unix:$docroot/myapp.socket;
490 }
491 }
492
493It is the standard convention of nginx to include the fastcgi_params in a
494separate file (usually something like C</etc/nginx/fastcgi_params>) and
495simply include that file.
496
497=head3 Non-root configuration
498
1dea1c87 499If you properly specify the PATH_INFO and SCRIPT_NAME parameters your
5a7d7e5c 500application will be accessible at any path. The SCRIPT_NAME variable is the
501prefix of your application, and PATH_INFO would be everything in addition.
5351e13d 502
503As an example, if your application is rooted at /myapp, you would configure:
504
5a7d7e5c 505 fastcgi_param SCRIPT_NAME /myapp/;
506 fastcgi_param PATH_INFO $fastcgi_script_name;
5351e13d 507
508C<$fastcgi_script_name> would be "/myapp/path/of/the/action". Catalyst will
509process this accordingly and setup the application base as expected.
510
511This behavior is somewhat different than Apache and Lighttpd, but is still
512functional.
513
514For more information on nginx, visit:
515L<http://nginx.net>
516
da7aac2e 517=head2 Microsoft IIS
198b0efa 518
b0ad47c1 519It is possible to run Catalyst under IIS with FastCGI, but only on IIS 6.0
da7aac2e 520(Microsoft Windows 2003), IIS 7.0 (Microsoft Windows 2008 and Vista) and
521hopefully its successors.
522
b0ad47c1 523Even if it is declared that FastCGI is supported on IIS 5.1 (Windows XP) it
da7aac2e 524does not support some features (specifically: wildcard mappings) that prevents
525running Catalyst application.
526
527Let us assume that our server has the following layout:
528
529 d:\WWW\WebApp\ path to our Catalyst application
530 d:\strawberry\perl\bin\perl.exe path to perl interpreter (with Catalyst installed)
531 c:\windows Windows directory
532
533=head3 Setup IIS 6.0 (Windows 2003)
534
4a6f54df 535=over 4
536
537=item Install FastCGI extension for IIS 6.0
da7aac2e 538
539FastCGI is not a standard part of IIS 6 - you have to install it separately. For
540more info and download go to L<http://www.iis.net/extensions/FastCGI>. Choose
b0ad47c1 541approptiate version (32-bit/64-bit), installation is quite simple
da7aac2e 542(in fact no questions, no options).
543
4a6f54df 544=item Create a new website
da7aac2e 545
b0ad47c1 546Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager".
da7aac2e 547Click "Action" > "New" > "Web Site". After you finish the installation wizard
b0ad47c1 548you need to go to the new website's properties.
da7aac2e 549
4a6f54df 550=item Set website properties
da7aac2e 551
b0ad47c1 552On tab "Web site" set proper values for:
da7aac2e 553Site Description, IP Address, TCP Port, SSL Port etc.
554
555On tab "Home Directory" set the following:
556
557 Local path: "d:\WWW\WebApp\root"
558 Local path permission flags: check only "Read" + "Log visits"
559 Execute permitions: "Scripts only"
560
b0ad47c1 561Click "Configuration" button (still on Home Directory tab) then click "Insert"
da7aac2e 562the wildcard application mapping and in the next dialog set:
563
564 Executable: "c:\windows\system32\inetsrv\fcgiext.dll"
565 Uncheck: "Verify that file exists"
566
567Close all dialogs with "OK".
568
4a6f54df 569=item Edit fcgiext.ini
da7aac2e 570
b0ad47c1 571Put the following lines into c:\windows\system32\inetsrv\fcgiext.ini (on 64-bit
da7aac2e 572system c:\windows\syswow64\inetsrv\fcgiext.ini):
573
574 [Types]
575 *:8=CatalystApp
576 ;replace 8 with the identification number of the newly created website
577 ;it is not so easy to get this number:
578 ; - you can use utility "c:\inetpub\adminscripts\adsutil.vbs"
579 ; to list websites: "cscript adsutil.vbs ENUM /P /W3SVC"
580 ; to get site name: "cscript adsutil.vbs GET /W3SVC/<number>/ServerComment"
581 ; to get all details: "cscript adsutil.vbs GET /W3SVC/<number>"
b0ad47c1 582 ; - or look where are the logs located:
583 ; c:\WINDOWS\SYSTEM32\Logfiles\W3SVC7\whatever.log
da7aac2e 584 ; means that the corresponding number is "7"
b0ad47c1 585 ;if you are running just one website using FastCGI you can use '*=CatalystApp'
da7aac2e 586
587 [CatalystApp]
588 ExePath=d:\strawberry\perl\bin\perl.exe
589 Arguments="d:\WWW\WebApp\script\webapp_fastcgi.pl -e"
590
b0ad47c1 591 ;by setting this you can instruct IIS to serve Catalyst static files
da7aac2e 592 ;directly not via FastCGI (in case of any problems try 1)
593 IgnoreExistingFiles=0
b0ad47c1 594
da7aac2e 595 ;do not be fooled by Microsoft doc talking about "IgnoreExistingDirectories"
596 ;that does not work and use "IgnoreDirectories" instead
597 IgnoreDirectories=1
598
4a6f54df 599=back
600
da7aac2e 601=head3 Setup IIS 7.0 (Windows 2008 and Vista)
602
603Microsoft IIS 7.0 has built-in support for FastCGI so you do not have to install
604any addons.
605
4a6f54df 606=over 4
607
608=item Necessary steps during IIS7 installation
da7aac2e 609
610During IIS7 installation after you have added role "Web Server (IIS)"
b0ad47c1 611you need to check to install role feature "CGI" (do not be nervous that it is
612not FastCGI). If you already have IIS7 installed you can add "CGI" role feature
613through "Control panel" > "Programs and Features".
da7aac2e 614
4a6f54df 615=item Create a new website
da7aac2e 616
b0ad47c1 617Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager"
da7aac2e 618> "Add Web Site".
619
620 site name: "CatalystSite"
b0ad47c1 621 content directory: "d:\WWW\WebApp\root"
da7aac2e 622 binding: set proper IP address, port etc.
623
4a6f54df 624=item Configure FastCGI
da7aac2e 625
b0ad47c1 626You can configure FastCGI extension using commandline utility
da7aac2e 627"c:\windows\system32\inetsrv\appcmd.exe"
628
4a6f54df 629=over 4
630
631=item Configuring section "fastCgi" (it is a global setting)
da7aac2e 632
4a6f54df 633 appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='d:\strawberry\perl\bin\perl.exe',arguments='d:\www\WebApp\script\webapp_fastcgi.pl -e',maxInstances='4',idleTimeout='300',activityTimeout='30',requestTimeout='90',instanceMaxRequests='1000',protocol='NamedPipe',flushNamedPipe='False']" /commit:apphost
da7aac2e 634
4a6f54df 635=item Configuring proper handler (it is a site related setting)
da7aac2e 636
4a6f54df 637 appcmd.exe set config "CatalystSite" -section:system.webServer/handlers /+"[name='CatalystFastCGI',path='*',verb='GET,HEAD,POST',modules='FastCgiModule',scriptProcessor='d:\strawberry\perl\bin\perl.exe|d:\www\WebApp\script\webapp_fastcgi.pl -e',resourceType='Unspecified',requireAccess='Script']" /commit:apphost
da7aac2e 638
b0ad47c1 639Note: before launching the commands above do not forget to change site
da7aac2e 640name and paths to values relevant for your server setup.
198b0efa 641
4a6f54df 642=back
643
644=back
645
fbcc39ad 646=head1 SEE ALSO
e2fd5b5f 647
fbcc39ad 648L<Catalyst>, L<FCGI>.
cd3bb248 649
fbcc39ad 650=head1 AUTHORS
ffb41d94 651
2f381252 652Catalyst Contributors, see Catalyst.pm
ffb41d94 653
d7d72ad9 654=head1 THANKS
655
656Bill Moseley, for documentation updates and testing.
657
ffb41d94 658=head1 COPYRIGHT
659
536bee89 660This library is free software. You can redistribute it and/or modify it under
ffb41d94 661the same terms as Perl itself.
662
663=cut