[Xitami] Associating .cgi with python

Paul Reid xitami@lists.xitami.org
Wed, 30 Jan 2002 12:34:47 -0500


> Under windows, I want Xitami to run .cgi scripts as python script.  I have #!/usr/bin/python2 as the first line of the script, but that only makes sense on my linux machine. How do I associate .cgi with python, for Xitami running under windows?

In Xitami Filters, associate ".cgi" with "C:/snakes/python/python.exe"

Any time Xitami is asked to deliver a file with ".cgi" extension, it will feed
that file through that program, capture the output, and send it to the
browser. 

I don't handle snakes but I do this for a VisualBasic program that processes
database tags in files. In my Xitami Filters, ".htmwl" is associated with
"D:/cgi/fetch.exe", the name of my VB program. 

Alternatively: hack the open-source code for Xitami, find the special-case
where Xitami/Win looks for "#!....perl" as the first line of a file and
searches PATH for a copy of perl.exe, and add similar lines to look for
"#!...python" and search PATH for python.exe. But recompiling Xitami on
Windows seems to want an MS C compiler, and IIRC the GUI version needs a
commercial package so isn't totally "free". 

 -PRR