Subversion Repositories DevTools

Rev

Rev 1295 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1293 dpurdie 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2
<HTML
3
><HEAD
4
><TITLE
5
>Apache webserver configuration</TITLE
6
><META
7
NAME="GENERATOR"
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9
REL="HOME"
10
TITLE="The Codestriker Guide"
11
HREF="book1.html"><LINK
12
REL="UP"
13
TITLE="Installation"
14
HREF="c49.html"><LINK
15
REL="PREVIOUS"
16
TITLE="Running install.pl"
17
HREF="x234.html"><LINK
18
REL="NEXT"
19
TITLE="IIS configuration"
20
HREF="x302.html"></HEAD
21
><BODY
22
CLASS="SECT1"
23
BGCOLOR="#FFFFFF"
24
TEXT="#000000"
25
LINK="#0000FF"
26
VLINK="#840084"
27
ALINK="#0000FF"
28
><DIV
29
CLASS="NAVHEADER"
30
><TABLE
31
SUMMARY="Header navigation table"
32
WIDTH="100%"
33
BORDER="0"
34
CELLPADDING="0"
35
CELLSPACING="0"
36
><TR
37
><TH
38
COLSPAN="3"
39
ALIGN="center"
40
>The Codestriker Guide: Version 1.9.3</TH
41
></TR
42
><TR
43
><TD
44
WIDTH="10%"
45
ALIGN="left"
46
VALIGN="bottom"
47
><A
48
HREF="x234.html"
49
ACCESSKEY="P"
50
>Prev</A
51
></TD
52
><TD
53
WIDTH="80%"
54
ALIGN="center"
55
VALIGN="bottom"
56
>Chapter 2. Installation</TD
57
><TD
58
WIDTH="10%"
59
ALIGN="right"
60
VALIGN="bottom"
61
><A
62
HREF="x302.html"
63
ACCESSKEY="N"
64
>Next</A
65
></TD
66
></TR
67
></TABLE
68
><HR
69
ALIGN="LEFT"
70
WIDTH="100%"></DIV
71
><DIV
72
CLASS="SECT1"
73
><H1
74
CLASS="SECT1"
75
><A
76
NAME="AEN248"
77
>2.4. Apache webserver configuration</A
78
></H1
79
><P
80
>        This section deals with deploying Codestriker using Apache, on
81
        either a UN*X machine or Win32.
82
        Codestriker can run as an ordinary CGI script, which allows it
83
        to run under any CGI-complaint webserver.  The following
84
        configuration details are specific for the Apache webserver
85
        (<A
86
HREF="http://httpd.apache.org"
87
TARGET="_top"
88
>http://httpd.apache.org</A
89
>),
90
        which is available for download for both UNIX and Window
91
        platforms.  Apache should be already available for most UNIX
92
        distributions.  Apache 1.X or 2.X can be used for Win32 systems
93
        deploying Codestriker as a CGI script.  For Win32 mod_perl
94
        installations, Apache 1.X is recommended.
95
      </P
96
><P
97
>        <SPAN
98
CLASS="emphasis"
99
><I
100
CLASS="EMPHASIS"
101
>Note any Codestriker or Apache configuration changes
102
        require the Apache server to be restarted.</I
103
></SPAN
104
>  For
105
        UNIX, a command like the following is required:
106
<PRE
107
CLASS="PROGRAMLISTING"
108
>/etc/init.d/httpd restart</PRE
109
>
110
        or
111
<PRE
112
CLASS="PROGRAMLISTING"
113
>/etc/init.d/apache restart</PRE
114
>
115
      </P
116
><P
117
>        For Windows, the Apache shell window can be terminated by
118
        pressing ^C, and started from the Windows menu.  There are
119
        also shortcuts from the menu for editing the Apache
120
        configuration file.
121
      </P
122
><DIV
123
CLASS="SECT2"
124
><H2
125
CLASS="SECT2"
126
><A
127
NAME="AEN257"
128
>2.4.1. CGI Script</A
129
></H2
130
><P
131
>	  If you installed Codestriker into
132
	  <TT
133
CLASS="FILENAME"
134
>/var/www/codestriker/codestriker-X.Y.Z</TT
135
>,
136
	  the configuration you need in your
137
	  <TT
138
CLASS="FILENAME"
139
>apache.conf</TT
140
> file (normally located in
141
	  either
142
	  <TT
143
CLASS="FILENAME"
144
>/etc/httpd.conf</TT
145
>,
146
	  <TT
147
CLASS="FILENAME"
148
>/etc/apache.conf</TT
149
> or
150
	  <TT
151
CLASS="FILENAME"
152
>/etc/httpd/conf/httpd.conf</TT
153
>) is the
154
	  following:
155
<PRE
156
CLASS="PROGRAMLISTING"
157
>ScriptAlias /codestriker/  /var/www/codestriker/codestriker-X.Y.Z/cgi-bin/
158
Alias /codestrikerhtml/  /var/www/codestriker/codestriker-X.Y.Z/html/
159
 
160
&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/cgi-bin/"&gt;
161
   AllowOverride None
162
   Options ExecCGI
163
   Order allow,deny
164
   Allow from all
165
   SetHandler cgi-script
166
&lt;/Directory&gt;
167
 
168
&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/html/"&gt;
169
   AllowOverride None
170
   Allow from all
171
&lt;/Directory&gt;</PRE
172
>
173
         For Windows, the configuration is the same, but filename
174
         paths should use '/' rather than '\'.  An example
175
         configuration could be the following, if Codestriker was
176
         installed in
177
         <TT
178
CLASS="FILENAME"
179
>c:\codestriker\codestriker-X.Y.Z</TT
180
>.
181
<PRE
182
CLASS="PROGRAMLISTING"
183
>ScriptAlias /codestriker/ "C:/codestriker/codestriker-X.Y.Z/cgi-bin/"
184
Alias /codestrikerhtml/ "C:/codestriker/codestriker-X.Y.Z/html/"
185
 
186
&lt;Directory "C:/codestriker/codestriker-X.Y.Z/cgi-bin/"&gt;
187
   AllowOverride None
188
   Options ExecCGI
189
   Order allow,deny
190
   Allow from all
191
   SetHandler cgi-script
192
&lt;/Directory&gt;
193
 
194
&lt;Directory "C:/codestriker/codestriker-X.Y.Z/html/"&gt;
195
   AllowOverride None
196
   Allow from all
197
&lt;/Directory&gt;</PRE
198
>
199
	</P
200
></DIV
201
><DIV
202
CLASS="SECT2"
203
><H2
204
CLASS="SECT2"
205
><A
206
NAME="AEN268"
207
>2.4.2. Apache 1.X mod_perl</A
208
></H2
209
><P
210
>	  Using <B
211
CLASS="COMMAND"
212
>mod_perl</B
213
> provides performance
214
	  benefits for Perl-based web applications.  For CGI
215
	  deployments, as described in the previous section, each HTTP
216
	  request will create a <SPAN
217
CLASS="emphasis"
218
><I
219
CLASS="EMPHASIS"
220
>new</I
221
></SPAN
222
> Perl
223
	  interpreter, which needs to initialise, and then parse the
224
	  Codestriker source code.  This may add significant latency
225
	  for each HTTP request.
226
	</P
227
><P
228
>	  Using <B
229
CLASS="COMMAND"
230
>mod_perl</B
231
>, a pool of Perl
232
	  interpreters which have already parsed the Codestriker
233
	  source code is maintained, so that whenever an HTTP request
234
	  is issued, the time spent creating a new Perl interpreter
235
	  and the parsing of the Codestriker code is removed.
236
	</P
237
><P
238
>	  <B
239
CLASS="COMMAND"
240
>Mod_perl</B
241
> is available for download from
242
	  <A
243
HREF="http://perl.apache.org"
244
TARGET="_top"
245
>http://perl.apache.org</A
246
>.
247
	  For most UNIX distributions, it is available by default with
248
	  Apache.  For installing <B
249
CLASS="COMMAND"
250
>mod_perl</B
251
> under
252
	  Windows, <A
253
HREF="http://www.webmatrix.net/log/modperl-win32"
254
TARGET="_top"
255
>http://www.webmatrix.net/log/modperl-win32</A
256
>
257
	  contains installation information.  You
258
	  should be able to install it by typing:
259
<PRE
260
CLASS="PROGRAMLISTING"
261
>C:\&#62; ppm
262
PPM&#62; rep add theory http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
263
PPM&#62; install mod_perl</PRE
264
>
265
          Note mod_perl has known to be a little flaky under Windows.
266
          Make sure you get Codestriker working deployed as a CGI
267
          script before trying to use mod_perl.
268
	</P
269
><P
270
>	  The following shows the configuration settings for an Apache
271
	  1.X server with <B
272
CLASS="COMMAND"
273
>mod_perl</B
274
> enabled, for a
275
	  Codestriker distribution installed in
276
	  <TT
277
CLASS="FILENAME"
278
>/var/www/codestriker/codestriker-X.Y.Z</TT
279
>.
280
<PRE
281
CLASS="PROGRAMLISTING"
282
>Alias /codestriker/  /var/www/codestriker/codestriker-X.Y.Z/cgi-bin/
283
Alias /codestrikerhtml/  /var/www/codestriker/codestriker-X.Y.Z/html/
284
 
285
&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/cgi-bin/"&gt;
286
   SetHandler perl-script
287
   PerlHandler Apache::Registry
288
   Options +ExecCGI
289
&lt;/Directory&gt;
290
 
291
&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/html/"&gt;
292
   AllowOverride None
293
   Allow from all
294
&lt;/Directory&gt;</PRE
295
>
296
          The settings for Windows are the same, only the pathnames
297
          will be different, as per the CGI configuration in the
298
          previous section.
299
	</P
300
><P
301
>	  For extra security, Codestriker supports Perl taint-mode, so
302
	  it is advisable to also have the following option in your
303
	  Apache config:
304
<PRE
305
CLASS="PROGRAMLISTING"
306
>PerlTaintCheck On</PRE
307
>
308
          Note if you are using LXR on the same webserver, this option
309
          cannot be used.  You'll also need to remove the
310
          <CODE
311
CLASS="OPTION"
312
>-T</CODE
313
> argument from
314
          <TT
315
CLASS="FILENAME"
316
>bin/codestriker.pl.base</TT
317
>, and re-run
318
          <B
319
CLASS="COMMAND"
320
>install.pl</B
321
> again (see <A
322
HREF="x234.html"
323
>Section 2.3</A
324
>) if you want to use
325
          Codestriker and LXR.
326
	</P
327
><P
328
>          Also note there is a strange issue with Perl 5.8 on Win32,
329
          the open3() call and taint mode.  For Win32 users, don't enable
330
          tainted mode.
331
        </P
332
></DIV
333
><DIV
334
CLASS="SECT2"
335
><H2
336
CLASS="SECT2"
337
><A
338
NAME="AEN292"
339
>2.4.3. Apache 2.X mod_perl</A
340
></H2
341
><P
342
>	  For Apache 2.X, make sure the <B
343
CLASS="COMMAND"
344
>mod_perl</B
345
>
346
	  module is loaded when Apache starts.  Near the top of the
347
	  Apache config file, you should see commands like the
348
	  following:
349
<PRE
350
CLASS="PROGRAMLISTING"
351
>LoadModule perl_module modules/mod_perl.so
352
PerlModule Apache2</PRE
353
>
354
          If these commands aren't present, and a Perl startup file is
355
          not being used, make sure these are added in.
356
	</P
357
><P
358
>	  The Codestriker configuration for Apache 2.X is very
359
	  similar, the only change is the name of the PerlHandler.
360
<PRE
361
CLASS="PROGRAMLISTING"
362
>Alias /codestriker/  /var/www/codestriker/codestriker-X.Y.Z/cgi-bin/
363
Alias /codestrikerhtml/  /var/www/codestriker/codestriker-X.Y.Z/html/
364
 
365
&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/cgi-bin/"&gt;
366
   SetHandler perl-script
367
   PerlHandler ModPerl::Registry
368
   Options +ExecCGI
369
&lt;/Directory&gt;
370
 
371
&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/html/"&gt;
372
   AllowOverride None
373
   Allow from all
374
&lt;/Directory&gt;</PRE
375
>
376
	</P
377
><P
378
>	  To enable Perl taint mode checking, using the following
379
	  option:
380
<PRE
381
CLASS="PROGRAMLISTING"
382
>PerlSwitches -T</PRE
383
>
384
	</P
385
><P
386
>          As mentioned in the previous section, Win32 users should
387
          not enable this mode.
388
        </P
389
></DIV
390
></DIV
391
><DIV
392
CLASS="NAVFOOTER"
393
><HR
394
ALIGN="LEFT"
395
WIDTH="100%"><TABLE
396
SUMMARY="Footer navigation table"
397
WIDTH="100%"
398
BORDER="0"
399
CELLPADDING="0"
400
CELLSPACING="0"
401
><TR
402
><TD
403
WIDTH="33%"
404
ALIGN="left"
405
VALIGN="top"
406
><A
407
HREF="x234.html"
408
ACCESSKEY="P"
409
>Prev</A
410
></TD
411
><TD
412
WIDTH="34%"
413
ALIGN="center"
414
VALIGN="top"
415
><A
416
HREF="book1.html"
417
ACCESSKEY="H"
418
>Home</A
419
></TD
420
><TD
421
WIDTH="33%"
422
ALIGN="right"
423
VALIGN="top"
424
><A
425
HREF="x302.html"
426
ACCESSKEY="N"
427
>Next</A
428
></TD
429
></TR
430
><TR
431
><TD
432
WIDTH="33%"
433
ALIGN="left"
434
VALIGN="top"
435
>Running install.pl</TD
436
><TD
437
WIDTH="34%"
438
ALIGN="center"
439
VALIGN="top"
440
><A
441
HREF="c49.html"
442
ACCESSKEY="U"
443
>Up</A
444
></TD
445
><TD
446
WIDTH="33%"
447
ALIGN="right"
448
VALIGN="top"
449
>IIS configuration</TD
450
></TR
451
></TABLE
452
></DIV
453
></BODY
454
></HTML
455
>