Subversion Repositories DevTools

Rev

Rev 1295 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Apache webserver configuration</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Codestriker Guide"
HREF="book1.html"><LINK
REL="UP"
TITLE="Installation"
HREF="c49.html"><LINK
REL="PREVIOUS"
TITLE="Running install.pl"
HREF="x234.html"><LINK
REL="NEXT"
TITLE="IIS configuration"
HREF="x302.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Codestriker Guide: Version 1.9.3</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x234.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Installation</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x302.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN248"
>2.4. Apache webserver configuration</A
></H1
><P
>        This section deals with deploying Codestriker using Apache, on
        either a UN*X machine or Win32.
        Codestriker can run as an ordinary CGI script, which allows it
        to run under any CGI-complaint webserver.  The following
        configuration details are specific for the Apache webserver
        (<A
HREF="http://httpd.apache.org"
TARGET="_top"
>http://httpd.apache.org</A
>),
        which is available for download for both UNIX and Window
        platforms.  Apache should be already available for most UNIX
        distributions.  Apache 1.X or 2.X can be used for Win32 systems
        deploying Codestriker as a CGI script.  For Win32 mod_perl
        installations, Apache 1.X is recommended.
      </P
><P
>        <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Note any Codestriker or Apache configuration changes
        require the Apache server to be restarted.</I
></SPAN
>  For
        UNIX, a command like the following is required:
<PRE
CLASS="PROGRAMLISTING"
>/etc/init.d/httpd restart</PRE
>
        or
<PRE
CLASS="PROGRAMLISTING"
>/etc/init.d/apache restart</PRE
>
      </P
><P
>        For Windows, the Apache shell window can be terminated by
        pressing ^C, and started from the Windows menu.  There are
        also shortcuts from the menu for editing the Apache
        configuration file.
      </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN257"
>2.4.1. CGI Script</A
></H2
><P
>         If you installed Codestriker into
          <TT
CLASS="FILENAME"
>/var/www/codestriker/codestriker-X.Y.Z</TT
>,
          the configuration you need in your
          <TT
CLASS="FILENAME"
>apache.conf</TT
> file (normally located in
          either
          <TT
CLASS="FILENAME"
>/etc/httpd.conf</TT
>,
          <TT
CLASS="FILENAME"
>/etc/apache.conf</TT
> or
          <TT
CLASS="FILENAME"
>/etc/httpd/conf/httpd.conf</TT
>) is the
          following:
<PRE
CLASS="PROGRAMLISTING"
>ScriptAlias /codestriker/  /var/www/codestriker/codestriker-X.Y.Z/cgi-bin/
Alias /codestrikerhtml/  /var/www/codestriker/codestriker-X.Y.Z/html/

&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/cgi-bin/"&gt;
   AllowOverride None
   Options ExecCGI
   Order allow,deny
   Allow from all
   SetHandler cgi-script
&lt;/Directory&gt;

&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/html/"&gt;
   AllowOverride None
   Allow from all
&lt;/Directory&gt;</PRE
>
         For Windows, the configuration is the same, but filename
         paths should use '/' rather than '\'.  An example
         configuration could be the following, if Codestriker was
         installed in
         <TT
CLASS="FILENAME"
>c:\codestriker\codestriker-X.Y.Z</TT
>.
<PRE
CLASS="PROGRAMLISTING"
>ScriptAlias /codestriker/ "C:/codestriker/codestriker-X.Y.Z/cgi-bin/"
Alias /codestrikerhtml/ "C:/codestriker/codestriker-X.Y.Z/html/"

&lt;Directory "C:/codestriker/codestriker-X.Y.Z/cgi-bin/"&gt;
   AllowOverride None
   Options ExecCGI
   Order allow,deny
   Allow from all
   SetHandler cgi-script
&lt;/Directory&gt;

&lt;Directory "C:/codestriker/codestriker-X.Y.Z/html/"&gt;
   AllowOverride None
   Allow from all
&lt;/Directory&gt;</PRE
>
        </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN268"
>2.4.2. Apache 1.X mod_perl</A
></H2
><P
>         Using <B
CLASS="COMMAND"
>mod_perl</B
> provides performance
          benefits for Perl-based web applications.  For CGI
          deployments, as described in the previous section, each HTTP
          request will create a <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>new</I
></SPAN
> Perl
          interpreter, which needs to initialise, and then parse the
          Codestriker source code.  This may add significant latency
          for each HTTP request.
        </P
><P
>         Using <B
CLASS="COMMAND"
>mod_perl</B
>, a pool of Perl
          interpreters which have already parsed the Codestriker
          source code is maintained, so that whenever an HTTP request
          is issued, the time spent creating a new Perl interpreter
          and the parsing of the Codestriker code is removed.
        </P
><P
>         <B
CLASS="COMMAND"
>Mod_perl</B
> is available for download from
          <A
HREF="http://perl.apache.org"
TARGET="_top"
>http://perl.apache.org</A
>.
          For most UNIX distributions, it is available by default with
          Apache.  For installing <B
CLASS="COMMAND"
>mod_perl</B
> under
          Windows, <A
HREF="http://www.webmatrix.net/log/modperl-win32"
TARGET="_top"
>http://www.webmatrix.net/log/modperl-win32</A
>
          contains installation information.  You
          should be able to install it by typing:
<PRE
CLASS="PROGRAMLISTING"
>C:\&#62; ppm
PPM&#62; rep add theory http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
PPM&#62; install mod_perl</PRE
>
          Note mod_perl has known to be a little flaky under Windows.
          Make sure you get Codestriker working deployed as a CGI
          script before trying to use mod_perl.
        </P
><P
>         The following shows the configuration settings for an Apache
          1.X server with <B
CLASS="COMMAND"
>mod_perl</B
> enabled, for a
          Codestriker distribution installed in
          <TT
CLASS="FILENAME"
>/var/www/codestriker/codestriker-X.Y.Z</TT
>.
<PRE
CLASS="PROGRAMLISTING"
>Alias /codestriker/  /var/www/codestriker/codestriker-X.Y.Z/cgi-bin/
Alias /codestrikerhtml/  /var/www/codestriker/codestriker-X.Y.Z/html/

&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/cgi-bin/"&gt;
   SetHandler perl-script
   PerlHandler Apache::Registry
   Options +ExecCGI
&lt;/Directory&gt;

&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/html/"&gt;
   AllowOverride None
   Allow from all
&lt;/Directory&gt;</PRE
>
          The settings for Windows are the same, only the pathnames
          will be different, as per the CGI configuration in the
          previous section.
        </P
><P
>         For extra security, Codestriker supports Perl taint-mode, so
          it is advisable to also have the following option in your
          Apache config:
<PRE
CLASS="PROGRAMLISTING"
>PerlTaintCheck On</PRE
>
          Note if you are using LXR on the same webserver, this option
          cannot be used.  You'll also need to remove the
          <CODE
CLASS="OPTION"
>-T</CODE
> argument from
          <TT
CLASS="FILENAME"
>bin/codestriker.pl.base</TT
>, and re-run
          <B
CLASS="COMMAND"
>install.pl</B
> again (see <A
HREF="x234.html"
>Section 2.3</A
>) if you want to use
          Codestriker and LXR.
        </P
><P
>          Also note there is a strange issue with Perl 5.8 on Win32,
          the open3() call and taint mode.  For Win32 users, don't enable
          tainted mode.
        </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN292"
>2.4.3. Apache 2.X mod_perl</A
></H2
><P
>         For Apache 2.X, make sure the <B
CLASS="COMMAND"
>mod_perl</B
>
          module is loaded when Apache starts.  Near the top of the
          Apache config file, you should see commands like the
          following:
<PRE
CLASS="PROGRAMLISTING"
>LoadModule perl_module modules/mod_perl.so
PerlModule Apache2</PRE
>
          If these commands aren't present, and a Perl startup file is
          not being used, make sure these are added in.
        </P
><P
>         The Codestriker configuration for Apache 2.X is very
          similar, the only change is the name of the PerlHandler.
<PRE
CLASS="PROGRAMLISTING"
>Alias /codestriker/  /var/www/codestriker/codestriker-X.Y.Z/cgi-bin/
Alias /codestrikerhtml/  /var/www/codestriker/codestriker-X.Y.Z/html/

&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/cgi-bin/"&gt;
   SetHandler perl-script
   PerlHandler ModPerl::Registry
   Options +ExecCGI
&lt;/Directory&gt;

&lt;Directory "/var/www/codestriker/codestriker-X.Y.Z/html/"&gt;
   AllowOverride None
   Allow from all
&lt;/Directory&gt;</PRE
>
        </P
><P
>         To enable Perl taint mode checking, using the following
          option:
<PRE
CLASS="PROGRAMLISTING"
>PerlSwitches -T</PRE
>
        </P
><P
>          As mentioned in the previous section, Win32 users should
          not enable this mode.
        </P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x234.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x302.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Running install.pl</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c49.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>IIS configuration</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>