INSTALLATION
============

To use it, you must first rebuild the Apache Server linking in this
module:

   a. Copy the entire package in a new subdirectory ``PyApache'' of the
      standard Apache ``src/modules'' directory.

   b. In the top directory of the server source distribution there is
      a new ``configure'' script that let's you plug-in a new module in
      the server without hand-editing one of its configuration files.
      The simplest command line is the following

      ./configure --activate-module=src/modules/PyApache/mod_pyapache.c

      This is all you need to configure the module.

      Alternatively, you can follow the old recipe:

      1. Modify src/Configuration adding the following line; for your
         convenience, the PyApache package contains a ``Configuration.chunk''
         that you may copy from

         AddModule modules/PyApache/mod_pyapache.o


      2. Run the `Configure' script to update the Makefile.


   d. Run `make' to rebuild the server.

Once the server is built, to activate this module you need to put
somewhere in its `conf/srm.conf' a line like

   AddHandler python-cgi-script .py

or the equivalent

   AddHandler python/x-httpd-cgi .py   

meaning that whenever the server is asked for a resource whose name
ends in `.py' it should handle it through this module
(`python-cgi-script' is an alias for `python/x-httpd-cgi').

PyApache will try to execute one of the compiled versions whenever a
valid one is present, or will try to create one of them if not. To be
able to do this, the directory containing the source script must be
writable by the server.

If you want, you may put only the compiled script on the server: given
that PyApache is registered to handle ``.pyc'' and/or ``.pyo'' files,
it will do its job even when the related ``.py'' source file isn't
there.
   

You can configure further the Python Environment on a per directory
basis, for example to set the Verbosity On in your testing
directory, or set a particular module search path... For example,
my `conf/access.conf' contains something like
 
   <Directory /usr/local/etc/apache/cgi-bin/lele>
   PythonPath /users/lele/Library/testing-python
   PythonVerbose On
   PythonDebug On
   </Directory>

to test these features: the `PythonPath' command cause its argument to
be prepended to the standard path; `PythonVerbose' is equivalent to
the `-v' option of the interpreter, and `PythonDebug' to the `-d'
option; in this case these settings are available only in the given
directory.

NB: If you were previously using PyApache, remove the now undefined
PythonPersistent and PythonTrustedScripts options from your configs.


Other two directives apply to the PyApache module: with
`PyApacheStartupScript' you may define a Python script that will be
executed at initialization time, ie when the server starts up; you can
configure the load path of *this* execution with `PyApachePath'.


