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