WebStack

Changeset

389:1b737aceb08a
2005-07-12 paulb raw files shortlog changelog graph [project @ 2005-07-12 14:12:01 by paulb] Added AOLserver details. Improved and tidied some things.
docs/CGI/NOTES.txt (file)
     1.1 --- a/docs/CGI/NOTES.txt	Tue Jul 12 14:11:32 2005 +0000
     1.2 +++ b/docs/CGI/NOTES.txt	Tue Jul 12 14:12:01 2005 +0000
     1.3 @@ -1,7 +1,8 @@
     1.4 -Configuring Apache:
     1.5 +Configuring Apache
     1.6 +==================
     1.7  
     1.8  To configure applications without authenticators, use the config.py script
     1.9 -in tools/Apache to set up mod_python applications. For example:
    1.10 +in tools/Apache to set up CGI applications. For example:
    1.11  
    1.12  python tools/Apache/config.py \
    1.13      CGI \
    1.14 @@ -10,11 +11,16 @@
    1.15      cookies \
    1.16      /cgi/cookies
    1.17  
    1.18 -This script can also be used to configure mod_python applications.
    1.19 +This script can also be used to configure mod_python applications. Run the
    1.20 +script without any arguments to see the documentation.
    1.21  
    1.22 ---------
    1.23 +With the above command, the "cookies" application should be visitable with a
    1.24 +URL resembling this one:
    1.25  
    1.26 -The manual way:
    1.27 +http://localhost/cgi/cookies
    1.28 +
    1.29 +The Manual Way
    1.30 +--------------
    1.31  
    1.32  Declare the script in httpd.conf or equivalent Web server configuration file.
    1.33  For example:
    1.34 @@ -30,18 +36,59 @@
    1.35  
    1.36  chmod u+x examples/CGI/SimpleHandler.py
    1.37  
    1.38 ---------
    1.39 +With the above configuration, the "cookies" application should be visitable
    1.40 +with a URL resembling this one:
    1.41 +
    1.42 +http://localhost/cgi/simple
    1.43 +
    1.44 +Configuring AOLserver
    1.45 +=====================
    1.46 +
    1.47 +To configure applications for AOLserver, edit the server's configuration file
    1.48 +(eg. config.tcl) so that the following definitions are present in the "CGI
    1.49 +interface" section:
    1.50 +
    1.51 +ns_section "ns/server/${servername}/module/nscgi"
    1.52 +ns_param   map "GET  /cgi /home/paulb/Software/Python/WebStack/examples/CGI" ;# CGI script file dir (GET).
    1.53 +ns_param   map "POST /cgi /home/paulb/Software/Python/WebStack/examples/CGI" ;# CGI script file dir (POST).
    1.54 +ns_param   interps CGIinterps
    1.55 +
    1.56 +ns_section "ns/interps/CGIinterps"
    1.57 +ns_param   .py "/usr/bin/python"
    1.58  
    1.59 -Session storage with CGI:
    1.60 +Search for the first line in the definitions above and add the following lines
    1.61 +immediately after it in the file.
    1.62 +
    1.63 +Additionally, in the "Modules to load" section, starting with this line...
    1.64 +
    1.65 +ns_section "ns/server/${servername}/modules"
    1.66 +
    1.67 +...you must ensure that the nscgi.so module is enabled:
    1.68 +
    1.69 +    ns_param nscgi ${bindir}/nscgi.so
    1.70 +
    1.71 +In other words, it must not be commented out with a leading # character.
    1.72 +
    1.73 +With the above configuration, the example applications should be visitable
    1.74 +with URLs resembling these:
    1.75 +
    1.76 +http://localhost/cgi/CookieHandler.py
    1.77 +http://localhost/cgi/SimpleHandler.py
    1.78 +
    1.79 +More advanced configuration of AOLserver to expose "cleaner" names for
    1.80 +application resources is not covered here.
    1.81 +
    1.82 +Session Storage with CGI
    1.83 +========================
    1.84  
    1.85  The very simple SessionStore class provided in WebStack.Helpers.Session, and
    1.86 -used by the WebStack.CGI.Transaction class, requires that a directory be created
    1.87 -in the directories of the CGI programs being run with the name
    1.88 +used by the WebStack.CGI.Transaction class, requires that a directory be
    1.89 +created in the directories of the CGI programs being run with the name
    1.90  "WebStack-sessions".  Here are some example commands for doing this:
    1.91  
    1.92    cd examples/CGI
    1.93    mkdir WebStack-sessions
    1.94    chown username.groupname WebStack-sessions
    1.95  
    1.96 -The given "username" and "groupname" correspond to the user and group the Apache
    1.97 +The given "username" and "groupname" correspond to the user and group the Web
    1.98  server assumes when running.