1 For each application, add an Alias line to httpd.conf to point to the directory
2 containing the handler package, then specify the appropriate module name as the
3 PythonHandler.
4
5 Alias /simple "/home/paulb/Software/Python/WebStack/examples/ModPython/SimpleApp"
6
7 <Directory "/home/paulb/Software/Python/WebStack/examples/ModPython/SimpleApp">
8 AddHandler python-program .simple
9 PythonHandler SimpleHandler
10 PythonDebug On
11 </Directory>
12
13 It would appear that the directory really should be distinct from others
14 defined for mod_python, and that the handler should have a distinct name from
15 other handlers employed.
16
17 Using such a definition in httpd.conf, only server resources residing directly
18 below "/simple" in the URL "hierarchy" with names ending in ".simple" would be
19 associated with the Simple WebStack application's resources. Therefore, the
20 following URL paths would access the application:
21
22 /simple/home.simple
23 /simple/tasks.simple/my-tasks
24 /simple/agenda.simple/tomorrow/first-thing
25
26 Examples of URL paths not addressing the application are as follows:
27
28 /agenda/my-agenda.simple
29 /simple/tasks/my-tasks.simple
30
31 --------
32
33 Authentication/authorisation in mod_python:
34
35 Whilst WebStack applications are permitted to send the "WWW-Authenticate"
36 header to HTTP clients, Apache appears to avoid defining the current user
37 unless various Auth directives have been applied to such applications in the
38 httpd.conf file, and since Apache sends such authentication headers when such
39 directives have been applied in the configuration, WebStack applications seem
40 to have limited control over the precise circumstances of authentication
41 itself.
42
43 Consequently, it is necessary to define authentication methods in the
44 httpd.conf file as in the following example:
45
46 Alias /auth "/home/paulb/Software/Python/WebStack/examples/ModPython/AuthApp"
47
48 <Directory "/home/paulb/Software/Python/WebStack/examples/ModPython/AuthApp">
49 AddHandler python-program .py
50 PythonHandler AuthHandler
51 PythonDebug On
52 AuthType Basic
53 AuthName "AuthResource"
54 AuthUserFile /usr/local/apache2/conf/users
55 require valid-user
56 </Directory>
57
58 The details of the application's deployment, including the exact pathname of
59 the users file and the appropriate access policy, must obviously be defined
60 according to the actual application concerned.