Thursday August 06, 2009 Python CGIs in Sun Web Server 7.0
Add this test script in <ws7-install-dir>https-<instance-name>/docs/cgi-bin directory and call it hello.cgi
#!/usr/bin/env pythonprint("Content-Type: text/plain;charset=utf-8")print("\r\n")print("Hello World!")
Change obj.conf default object
<Object name="default">AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"NameTrans fn="ntrans-j2ee" name="j2ee"NameTrans fn="pfx2dir" from="/cgi-bin" dir="/<ws-install-dir>/https-<instance-name>/docs/cgi-bin" name="cgi"...<Object name="cgi"> ObjectType fn="force-type" type="magnus-internal/cgi" Service fn="send-cgi" </Object>
Send a request through the browser http://host:post/cgi-bin/hello.cgi
You can see Hello World! displayed.
References
http://docs.python.org/3.1/howto/webservers.html
This blog copyright 2009 by meena