paulb@114 | 1 | Declare the script in httpd.conf or equivalent Web server configuration file.
|
paulb@114 | 2 | For example:
|
paulb@114 | 3 |
|
paulb@114 | 4 | ScriptAlias /cgi/simple "/home/paulb/Software/Python/WebStack/examples/CGI/SimpleHandler.py"
|
paulb@114 | 5 |
|
paulb@114 | 6 | The WebStack package must reside on the PYTHONPATH, along with the package
|
paulb@114 | 7 | containing the application itself. Therefore, ensure that the handler uses the
|
paulb@114 | 8 | appropriate entries in sys.path.
|
paulb@114 | 9 |
|
paulb@114 | 10 | Ensure that the handler file for the application has the appropriate
|
paulb@114 | 11 | permissions:
|
paulb@114 | 12 |
|
paulb@114 | 13 | chmod u+x examples/CGI/SimpleHandler.py
|
paulb@269 | 14 |
|
paulb@269 | 15 | --------
|
paulb@269 | 16 |
|
paulb@269 | 17 | Session storage with CGI:
|
paulb@269 | 18 |
|
paulb@269 | 19 | The very simple SessionStore class provided in WebStack.Helpers.Session, and
|
paulb@269 | 20 | used by the WebStack.CGI.Transaction class, requires that a directory be created
|
paulb@269 | 21 | in the directories of the CGI programs being run with the name
|
paulb@269 | 22 | "WebStack-sessions". Here are some example commands for doing this:
|
paulb@269 | 23 |
|
paulb@269 | 24 | cd examples/CGI
|
paulb@269 | 25 | mkdir WebStack-sessions
|
paulb@269 | 26 | chown username.groupname WebStack-sessions
|
paulb@269 | 27 |
|
paulb@269 | 28 | The given "username" and "groupname" correspond to the user and group the Apache
|
paulb@269 | 29 | server assumes when running.
|