.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Catalyst::Manual::Deployment::IIS::FastCGI 3pm" .TH Catalyst::Manual::Deployment::IIS::FastCGI 3pm 2024-03-30 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Catalyst::Manual::Deployment::IIS::FastCGI \- Deploying Catalyst with Microsoft IIS .SH "Microsoft IIS" .IX Header "Microsoft IIS" Probably the best way to deploy a Catalyst application on IIS is by using IIS as a front end proxy. However if you positively must use FastCGI (say due to internal IT policies) then this manual shows you how. .PP It is possible to run Catalyst under IIS with FastCGI, but only on IIS 6.0 (Microsoft Windows 2003), IIS 7.0 (Microsoft Windows 2008 and Vista), and (hopefully) its successors. .PP FastCGI is sometimes said to be supported on IIS 5.1 (Windows XP), but some features (specifically, wildcard mappings) are not supported. This prevents Catalyst applications from running on the server. .PP Let us assume that our server has the following layout: .PP .Vb 3 \& d:\eWWW\eWebApp\e path to our Catalyst application \& d:\estrawberry\eperl\ebin\eperl.exe path to perl interpreter (with Catalyst installed) \& c:\ewindows Windows directory .Ve .SS "Setup IIS 6.0 (Windows 2003)" .IX Subsection "Setup IIS 6.0 (Windows 2003)" .IP "Install FastCGI extension for IIS 6.0" 4 .IX Item "Install FastCGI extension for IIS 6.0" FastCGI is not a standard part of IIS 6 \- you have to install it separately. For more info and the download, go to . Choose the appropriate version (32\-bit/64\-bit); installation is quite simple (in fact no questions, no options). .IP "Create a new website" 4 .IX Item "Create a new website" Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager". Click "Action" > "New" > "Web Site". After you finish the installation wizard you need to go to the new website's properties. .IP "Set website properties" 4 .IX Item "Set website properties" On the tab "Web site", set proper values for: Site Description, IP Address, TCP Port, SSL Port, etc. .Sp On the tab "Home Directory" set the following: .Sp .Vb 3 \& Local path: "d:\eWWW\eWebApp\eroot" \& Local path permission flags: check only "Read" + "Log visits" \& Execute permitions: "Scripts only" .Ve .Sp Click "Configuration" button (still on Home Directory tab) then click "Insert" the wildcard application mapping, and in the next dialog set: .Sp .Vb 2 \& Executable: "c:\ewindows\esystem32\einetsrv\efcgiext.dll" \& Uncheck: "Verify that file exists" .Ve .Sp Close all dialogs with "OK". .IP "Edit fcgiext.ini" 4 .IX Item "Edit fcgiext.ini" Put the following lines into c:\ewindows\esystem32\einetsrv\efcgiext.ini (on 64\-bit system c:\ewindows\esyswow64\einetsrv\efcgiext.ini): .Sp .Vb 12 \& [Types] \& *:8=CatalystApp \& ;replace 8 with the identification number of the newly created website \& ;it is not so easy to get this number: \& ; \- you can use utility "c:\einetpub\eadminscripts\eadsutil.vbs" \& ; to list websites: "cscript adsutil.vbs ENUM /P /W3SVC" \& ; to get site name: "cscript adsutil.vbs GET /W3SVC//ServerComment" \& ; to get all details: "cscript adsutil.vbs GET /W3SVC/" \& ; \- or look where are the logs located: \& ; c:\eWINDOWS\eSYSTEM32\eLogfiles\eW3SVC7\ewhatever.log \& ; means that the corresponding number is "7" \& ;if you are running just one website using FastCGI you can use \*(Aq*=CatalystApp\*(Aq \& \& [CatalystApp] \& ExePath=d:\estrawberry\eperl\ebin\eperl.exe \& Arguments="d:\eWWW\eWebApp\escript\ewebapp_fastcgi.pl \-e" \& \& ;by setting this you can instruct IIS to serve Catalyst static files \& ;directly not via FastCGI (in case of any problems try 1) \& IgnoreExistingFiles=0 \& \& ;do not be fooled by Microsoft doc talking about "IgnoreExistingDirectories" \& ;that does not work and use "IgnoreDirectories" instead \& IgnoreDirectories=1 .Ve .SS "Setup IIS 7.0 (Windows 2008 and Vista)" .IX Subsection "Setup IIS 7.0 (Windows 2008 and Vista)" Microsoft IIS 7.0 has built-in support for FastCGI so you do not have to install any addons. .IP "Necessary steps during IIS7 installation" 4 .IX Item "Necessary steps during IIS7 installation" During IIS7 installation, after you have added role "Web Server (IIS)" you need to check to install the role feature "CGI" (do not be nervous that it is not FastCGI). If you already have IIS7 installed you can add the "CGI" role feature through "Control panel" > "Programs and Features". .IP "Create a new website" 4 .IX Item "Create a new website" Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager" > "Add Web Site". .Sp .Vb 3 \& site name: "CatalystSite" \& content directory: "d:\eWWW\eWebApp\eroot" \& binding: set proper IP address, port etc. .Ve .IP "Configure FastCGI" 4 .IX Item "Configure FastCGI" You can configure FastCGI extension using commandline utility "c:\ewindows\esystem32\einetsrv\eappcmd.exe" .RS 4 .IP "Configuring section ""fastCgi"" (it is a global setting)" 4 .IX Item "Configuring section ""fastCgi"" (it is a global setting)" .Vb 1 \& appcmd.exe set config \-section:system.webServer/fastCgi /+"[fullPath=\*(Aqd:\estrawberry\eperl\ebin\eperl.exe\*(Aq,arguments=\*(Aqd:\ewww\eWebApp\escript\ewebapp_fastcgi.pl \-e\*(Aq,maxInstances=\*(Aq4\*(Aq,idleTimeout=\*(Aq300\*(Aq,activityTimeout=\*(Aq30\*(Aq,requestTimeout=\*(Aq90\*(Aq,instanceMaxRequests=\*(Aq1000\*(Aq,protocol=\*(AqNamedPipe\*(Aq,flushNamedPipe=\*(AqFalse\*(Aq]" /commit:apphost .Ve .IP "Configuring proper handler (it is a site related setting)" 4 .IX Item "Configuring proper handler (it is a site related setting)" .Vb 1 \& appcmd.exe set config "CatalystSite" \-section:system.webServer/handlers /+"[name=\*(AqCatalystFastCGI\*(Aq,path=\*(Aq*\*(Aq,verb=\*(AqGET,HEAD,POST\*(Aq,modules=\*(AqFastCgiModule\*(Aq,scriptProcessor=\*(Aqd:\estrawberry\eperl\ebin\eperl.exe|d:\ewww\eWebApp\escript\ewebapp_fastcgi.pl \-e\*(Aq,resourceType=\*(AqUnspecified\*(Aq,requireAccess=\*(AqScript\*(Aq]" /commit:apphost .Ve .Sp Note: before launching the commands above, do not forget to change the site name and paths to values relevant for your server setup. .RE .RS 4 .RE .PP \fISetup of your application\fR .IX Subsection "Setup of your application" .PP Note that you \fBMUST\fR have the config setting \f(CW\*(C`use_request_uri_for_path\*(C'\fR set to true to work in IIS7 \- if you do not have this then all sub paths in your application (e.g. /foo/bar) will resolve to the root path, i.e. / .SH AUTHORS .IX Header "AUTHORS" Catalyst Contributors, see Catalyst.pm .SH COPYRIGHT .IX Header "COPYRIGHT" This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.