Commit | Line | Data |
45b58a85 |
1 | =head1 NAME |
2 | |
3 | Catalyst::Manual::Deployment::IIS::FastCGI - Deploying Catalyst with Microsoft IIS |
4 | |
0191b435 |
5 | =head1 Microsoft IIS |
45b58a85 |
6 | |
5abded07 |
7 | It is possible to run Catalyst under IIS with FastCGI, but only on IIS |
8 | 6.0 (Microsoft Windows 2003), IIS 7.0 (Microsoft Windows 2008 and |
9 | Vista), and (hopefully) its successors. |
45b58a85 |
10 | |
5abded07 |
11 | FastCGI is sometimes said to be supported on IIS 5.1 (Windows XP), but |
12 | some features (specifically, wildcard mappings) are not supported. This |
13 | prevents Catalyst applications from running on the server. |
45b58a85 |
14 | |
15 | Let us assume that our server has the following layout: |
16 | |
17 | d:\WWW\WebApp\ path to our Catalyst application |
18 | d:\strawberry\perl\bin\perl.exe path to perl interpreter (with Catalyst installed) |
19 | c:\windows Windows directory |
20 | |
0191b435 |
21 | =head2 Setup IIS 6.0 (Windows 2003) |
45b58a85 |
22 | |
0191b435 |
23 | =over |
45b58a85 |
24 | |
25 | =item Install FastCGI extension for IIS 6.0 |
26 | |
5abded07 |
27 | FastCGI is not a standard part of IIS 6 - you have to install it |
28 | separately. For more info and the download, go to |
29 | L<http://www.iis.net/extensions/FastCGI>. Choose the appropriate version |
30 | (32-bit/64-bit); installation is quite simple (in fact no questions, no |
31 | options). |
45b58a85 |
32 | |
33 | =item Create a new website |
34 | |
35 | Open "Control Panel" > "Administrative Tools" > "Internet Information Services Manager". |
36 | Click "Action" > "New" > "Web Site". After you finish the installation wizard |
37 | you need to go to the new website's properties. |
38 | |
39 | =item Set website properties |
40 | |
5abded07 |
41 | On the tab "Web site", set proper values for: Site Description, IP |
42 | Address, TCP Port, SSL Port, etc. |
45b58a85 |
43 | |
5abded07 |
44 | On the tab "Home Directory" set the following: |
45b58a85 |
45 | |
46 | Local path: "d:\WWW\WebApp\root" |
47 | Local path permission flags: check only "Read" + "Log visits" |
48 | Execute permitions: "Scripts only" |
49 | |
50 | Click "Configuration" button (still on Home Directory tab) then click "Insert" |
5abded07 |
51 | the wildcard application mapping, and in the next dialog set: |
45b58a85 |
52 | |
53 | Executable: "c:\windows\system32\inetsrv\fcgiext.dll" |
54 | Uncheck: "Verify that file exists" |
55 | |
56 | Close all dialogs with "OK". |
57 | |
58 | =item Edit fcgiext.ini |
59 | |
60 | Put the following lines into c:\windows\system32\inetsrv\fcgiext.ini (on 64-bit |
61 | system c:\windows\syswow64\inetsrv\fcgiext.ini): |
62 | |
63 | [Types] |
64 | *:8=CatalystApp |
65 | ;replace 8 with the identification number of the newly created website |
66 | ;it is not so easy to get this number: |
67 | ; - you can use utility "c:\inetpub\adminscripts\adsutil.vbs" |
68 | ; to list websites: "cscript adsutil.vbs ENUM /P /W3SVC" |
69 | ; to get site name: "cscript adsutil.vbs GET /W3SVC/<number>/ServerComment" |
70 | ; to get all details: "cscript adsutil.vbs GET /W3SVC/<number>" |
71 | ; - or look where are the logs located: |
72 | ; c:\WINDOWS\SYSTEM32\Logfiles\W3SVC7\whatever.log |
73 | ; means that the corresponding number is "7" |
74 | ;if you are running just one website using FastCGI you can use '*=CatalystApp' |
75 | |
76 | [CatalystApp] |
77 | ExePath=d:\strawberry\perl\bin\perl.exe |
78 | Arguments="d:\WWW\WebApp\script\webapp_fastcgi.pl -e" |
79 | |
80 | ;by setting this you can instruct IIS to serve Catalyst static files |
81 | ;directly not via FastCGI (in case of any problems try 1) |
82 | IgnoreExistingFiles=0 |
83 | |
84 | ;do not be fooled by Microsoft doc talking about "IgnoreExistingDirectories" |
85 | ;that does not work and use "IgnoreDirectories" instead |
86 | IgnoreDirectories=1 |
87 | |
88 | =back |
89 | |
0191b435 |
90 | =head2 Setup IIS 7.0 (Windows 2008 and Vista) |
45b58a85 |
91 | |
506ff3c8 |
92 | Microsoft IIS 7.0 has built-in support for FastCGI so you do not have to |
93 | install any addons. |
45b58a85 |
94 | |
0191b435 |
95 | =over |
45b58a85 |
96 | |
97 | =item Necessary steps during IIS7 installation |
98 | |
5abded07 |
99 | During IIS7 installation, after you have added role "Web Server (IIS)" |
100 | you need to check to install the role feature "CGI" (do not be nervous |
101 | that it is not FastCGI). If you already have IIS7 installed you can add |
102 | the "CGI" role feature through "Control panel" > "Programs and |
103 | Features". |
45b58a85 |
104 | |
105 | =item Create a new website |
106 | |
506ff3c8 |
107 | Open "Control Panel" > "Administrative Tools" > "Internet Information Services |
108 | Manager" > "Add Web Site". |
45b58a85 |
109 | |
110 | site name: "CatalystSite" |
111 | content directory: "d:\WWW\WebApp\root" |
112 | binding: set proper IP address, port etc. |
113 | |
114 | =item Configure FastCGI |
115 | |
116 | You can configure FastCGI extension using commandline utility |
117 | "c:\windows\system32\inetsrv\appcmd.exe" |
118 | |
0191b435 |
119 | =over |
45b58a85 |
120 | |
121 | =item Configuring section "fastCgi" (it is a global setting) |
122 | |
123 | 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 |
124 | |
125 | =item Configuring proper handler (it is a site related setting) |
126 | |
127 | 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 |
128 | |
5abded07 |
129 | Note: before launching the commands above, do not forget to change the |
130 | site name and paths to values relevant for your server setup. |
45b58a85 |
131 | |
132 | =back |
133 | |
134 | =back |
135 | |
136 | =head1 AUTHORS |
137 | |
138 | Catalyst Contributors, see Catalyst.pm |
139 | |
140 | =head1 COPYRIGHT |
141 | |
142 | This library is free software. You can redistribute it and/or modify it under |
143 | the same terms as Perl itself. |
144 | |
145 | =cut |