1.1 --- a/docs/ModPython/NOTES.txt Fri Jun 20 22:35:04 2008 +0200
1.2 +++ b/docs/ModPython/NOTES.txt Fri Jan 13 17:41:08 2006 +0000
1.3 @@ -10,7 +10,6 @@
1.4 /etc/apache2/sites-available \
1.5 cookies-mod \
1.6 /cookies \
1.7 - .cookies
1.8
1.9 This script can also be used to configure CGI applications. Run the script
1.10 without any arguments to see the documentation.
1.11 @@ -18,45 +17,35 @@
1.12 With the above command, the "cookies" application should be visitable with
1.13 URLs resembling these:
1.14
1.15 -http://localhost/cookies/test.cookies
1.16 -http://localhost/cookies/my.cookies
1.17 +http://localhost/cookies/test
1.18 +http://localhost/cookies/my-cookies
1.19
1.20 The Manual Approach
1.21 -------------------
1.22
1.23 -For each application, add an Alias line to httpd.conf to point to the directory
1.24 -containing the handler package, then specify the appropriate module name as the
1.25 -PythonHandler.
1.26 +For each application, add a Location section to httpd.conf (or an appropriate
1.27 +equivalent configuration file) as follows:
1.28
1.29 -Alias /simple "/home/paulb/Software/Python/WebStack/examples/ModPython/SimpleApp"
1.30 -
1.31 -<Directory "/home/paulb/Software/Python/WebStack/examples/ModPython/SimpleApp">
1.32 - AddHandler python-program .simple
1.33 +<Location "/simple">
1.34 + SetHandler python-program
1.35 PythonHandler SimpleHandler
1.36 PythonDebug On
1.37 -</Directory>
1.38 -
1.39 -It would appear that the directory really should be distinct from others
1.40 -defined for mod_python, and that the handler should have a distinct name from
1.41 -other handlers employed.
1.42 + PythonPath "['/home/paulb/Software/Python/WebStack/examples/ModPython/SimpleApp'] + sys.path"
1.43 +</Location>
1.44
1.45 The WebStack package must reside on the PYTHONPATH, along with the package
1.46 containing the application itself. Therefore, ensure that the handler uses the
1.47 -appropriate entries in sys.path.
1.48 +appropriate entries in sys.path or use the PythonPath directive as shown
1.49 +above.
1.50
1.51 Using the above definition in httpd.conf, only server resources residing
1.52 -directly below "/simple" in the URL "hierarchy" with names ending in ".simple"
1.53 -would be associated with the Simple WebStack application's resources.
1.54 -Therefore, the following URL paths would access the application:
1.55 +directly below "/simple" in the URL "hierarchy" would be associated with the
1.56 +Simple WebStack application's resources. Therefore, the following URL paths
1.57 +would access the application:
1.58
1.59 - /simple/home.simple
1.60 - /simple/tasks.simple/my-tasks
1.61 - /simple/agenda.simple/tomorrow/first-thing
1.62 -
1.63 -Examples of URL paths not addressing the application are as follows:
1.64 -
1.65 - /agenda/my-agenda.simple
1.66 - /simple/tasks/my-tasks.simple
1.67 + /simple/home
1.68 + /simple/tasks/my-tasks
1.69 + /simple/agenda/tomorrow/first-thing
1.70
1.71 Authentication/Authorisation in mod_python
1.72 ==========================================
1.73 @@ -70,18 +59,17 @@
1.74 Consequently, it is necessary to define authentication methods in the
1.75 httpd.conf file as in the following example:
1.76
1.77 -Alias /auth "/home/paulb/Software/Python/WebStack/examples/ModPython/AuthApp"
1.78 -
1.79 -<Directory "/home/paulb/Software/Python/WebStack/examples/ModPython/AuthApp">
1.80 - AddHandler python-program .py
1.81 +<Location "/auth">
1.82 + SetHandler python-program
1.83 PythonHandler AuthHandler
1.84 PythonAuthenHandler AuthHandler
1.85 PythonDebug On
1.86 AuthType Basic
1.87 AuthName "AuthResource"
1.88 - AuthUserFile /usr/local/apache2/conf/users
1.89 + AuthUserFile /etc/apache2/users
1.90 require valid-user
1.91 -</Directory>
1.92 + PythonPath "['/home/paulb/Software/Python/WebStack/examples/ModPython/AuthApp'] + sys.path"
1.93 +</Location>
1.94
1.95 The details of the application's deployment, including the exact pathname of
1.96 the users file and the appropriate access policy, must obviously be defined