paulb@376 | 1 | Configuring Apache:
|
paulb@376 | 2 |
|
paulb@376 | 3 | To configure applications without authenticators, use the config.py script
|
paulb@376 | 4 | in tools/Apache to set up mod_python applications. For example:
|
paulb@376 | 5 |
|
paulb@376 | 6 | python tools/Apache/config.py \
|
paulb@376 | 7 | CGI \
|
paulb@376 | 8 | /home/paulb/Software/Python/WebStack/examples/CGI/CookiesApp.py \
|
paulb@376 | 9 | /etc/apache2/sites-available \
|
paulb@376 | 10 | cookies \
|
paulb@376 | 11 | /cgi/cookies
|
paulb@376 | 12 |
|
paulb@376 | 13 | This script can also be used to configure mod_python applications.
|
paulb@376 | 14 |
|
paulb@376 | 15 | --------
|
paulb@376 | 16 |
|
paulb@376 | 17 | The manual way:
|
paulb@376 | 18 |
|
paulb@114 | 19 | Declare the script in httpd.conf or equivalent Web server configuration file.
|
paulb@114 | 20 | For example:
|
paulb@114 | 21 |
|
paulb@114 | 22 | ScriptAlias /cgi/simple "/home/paulb/Software/Python/WebStack/examples/CGI/SimpleHandler.py"
|
paulb@114 | 23 |
|
paulb@114 | 24 | The WebStack package must reside on the PYTHONPATH, along with the package
|
paulb@114 | 25 | containing the application itself. Therefore, ensure that the handler uses the
|
paulb@114 | 26 | appropriate entries in sys.path.
|
paulb@114 | 27 |
|
paulb@114 | 28 | Ensure that the handler file for the application has the appropriate
|
paulb@114 | 29 | permissions:
|
paulb@114 | 30 |
|
paulb@114 | 31 | chmod u+x examples/CGI/SimpleHandler.py
|
paulb@269 | 32 |
|
paulb@269 | 33 | --------
|
paulb@269 | 34 |
|
paulb@269 | 35 | Session storage with CGI:
|
paulb@269 | 36 |
|
paulb@269 | 37 | The very simple SessionStore class provided in WebStack.Helpers.Session, and
|
paulb@269 | 38 | used by the WebStack.CGI.Transaction class, requires that a directory be created
|
paulb@269 | 39 | in the directories of the CGI programs being run with the name
|
paulb@269 | 40 | "WebStack-sessions". Here are some example commands for doing this:
|
paulb@269 | 41 |
|
paulb@269 | 42 | cd examples/CGI
|
paulb@269 | 43 | mkdir WebStack-sessions
|
paulb@269 | 44 | chown username.groupname WebStack-sessions
|
paulb@269 | 45 |
|
paulb@269 | 46 | The given "username" and "groupname" correspond to the user and group the Apache
|
paulb@269 | 47 | server assumes when running.
|