# HG changeset patch # User paulb # Date 1121177521 0 # Node ID 1b737aceb08a32a5fa90119d987d721a249b1212 # Parent 8fc960ea9dad0c606e3f71c5c6a6977b59067638 [project @ 2005-07-12 14:12:01 by paulb] Added AOLserver details. Improved and tidied some things. diff -r 8fc960ea9dad -r 1b737aceb08a docs/CGI/NOTES.txt --- a/docs/CGI/NOTES.txt Tue Jul 12 14:11:32 2005 +0000 +++ b/docs/CGI/NOTES.txt Tue Jul 12 14:12:01 2005 +0000 @@ -1,7 +1,8 @@ -Configuring Apache: +Configuring Apache +================== To configure applications without authenticators, use the config.py script -in tools/Apache to set up mod_python applications. For example: +in tools/Apache to set up CGI applications. For example: python tools/Apache/config.py \ CGI \ @@ -10,11 +11,16 @@ cookies \ /cgi/cookies -This script can also be used to configure mod_python applications. +This script can also be used to configure mod_python applications. Run the +script without any arguments to see the documentation. --------- +With the above command, the "cookies" application should be visitable with a +URL resembling this one: -The manual way: +http://localhost/cgi/cookies + +The Manual Way +-------------- Declare the script in httpd.conf or equivalent Web server configuration file. For example: @@ -30,18 +36,59 @@ chmod u+x examples/CGI/SimpleHandler.py --------- +With the above configuration, the "cookies" application should be visitable +with a URL resembling this one: + +http://localhost/cgi/simple + +Configuring AOLserver +===================== + +To configure applications for AOLserver, edit the server's configuration file +(eg. config.tcl) so that the following definitions are present in the "CGI +interface" section: + +ns_section "ns/server/${servername}/module/nscgi" +ns_param map "GET /cgi /home/paulb/Software/Python/WebStack/examples/CGI" ;# CGI script file dir (GET). +ns_param map "POST /cgi /home/paulb/Software/Python/WebStack/examples/CGI" ;# CGI script file dir (POST). +ns_param interps CGIinterps + +ns_section "ns/interps/CGIinterps" +ns_param .py "/usr/bin/python" -Session storage with CGI: +Search for the first line in the definitions above and add the following lines +immediately after it in the file. + +Additionally, in the "Modules to load" section, starting with this line... + +ns_section "ns/server/${servername}/modules" + +...you must ensure that the nscgi.so module is enabled: + + ns_param nscgi ${bindir}/nscgi.so + +In other words, it must not be commented out with a leading # character. + +With the above configuration, the example applications should be visitable +with URLs resembling these: + +http://localhost/cgi/CookieHandler.py +http://localhost/cgi/SimpleHandler.py + +More advanced configuration of AOLserver to expose "cleaner" names for +application resources is not covered here. + +Session Storage with CGI +======================== The very simple SessionStore class provided in WebStack.Helpers.Session, and -used by the WebStack.CGI.Transaction class, requires that a directory be created -in the directories of the CGI programs being run with the name +used by the WebStack.CGI.Transaction class, requires that a directory be +created in the directories of the CGI programs being run with the name "WebStack-sessions". Here are some example commands for doing this: cd examples/CGI mkdir WebStack-sessions chown username.groupname WebStack-sessions -The given "username" and "groupname" correspond to the user and group the Apache +The given "username" and "groupname" correspond to the user and group the Web server assumes when running.