By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

Python as CGI on IIS and Windows 2003 Server

P: n/a
Hi,

My python scripts are running as cgi scripts on an IIS on Windows XP.
I have to distribute it to IIS on Windows 2003 Server.
I tried to set python as cgi scripts in IIS on this machine in IIS
using advices from http://python.markrowsoft.com/iiswse.asp

No test with or without any " let the IIS execute python scrits as cgi.
Http Error code is 404 (but i'm sure that the file exists in the
requested path).

Is there any difference for python as CGI on IIS between Windows XP
prof. and Windows 2003 Server?

Thanks
Lothar

Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a

lo********@gmx.de wrote:
Hi,

My python scripts are running as cgi scripts on an IIS on Windows XP.
I have to distribute it to IIS on Windows 2003 Server. .... Is there any difference for python as CGI on IIS between Windows XP
prof. and Windows 2003 Server?

....

Yes there is a difference!

I had this problem last year (developing on Win XP Pro and delivering
on IIS Server), I'll try to lookup the solution, but it might be
difficult (it's kind of a thing you do once and forget about later.)

Jean-Marc

Jul 19 '05 #2

P: n/a
Some bits are coming back to me: the problems stemmed from adresses -
getting the root of IIS was different so accessing files didn't work
the same way. I'm also quite positive that my desktop (developement
version) was IIS 5.1 which comes with XP Pro compared to 6.0 for IIS
Server. I changed the way I was dealing with file adresses.

Maybe there is a hint of direction for your own investigation...

Jean-Marc

Jul 19 '05 #3

P: n/a
jean-marc schrieb:
Some bits are coming back to me: the problems stemmed from adresses -
getting the root of IIS was different so accessing files didn't work
the same way.


thanks for that.
you are right, IIS versions are different.
Wich kind of adresses do you mean, http-adresses or paths in file
systems to root of IIS or to pythonscripts below IIS' root?

Unfortunately I couldn't find a way to solve the problem.
regards
Lothar

Jul 19 '05 #4

P: n/a


lo********@gmx.de wrote:
jean-marc schrieb:
Some bits are coming back to me: the problems stemmed from adresses -
getting the root of IIS was different so accessing files didn't work
the same way.


thanks for that.
you are right, IIS versions are different.
Wich kind of adresses do you mean, http-adresses or paths in file
systems to root of IIS or to pythonscripts below IIS' root?

Unfortunately I couldn't find a way to solve the problem.
regards
Lothar


I think it was due to the way of getting a reference to the IIS's root
- I think that all adresses in html (wheter from static documents or
those generated by python) need to use relative adresses (double dot
slash, or dot slash type of adresses).

If it still doesn't work maybe posting some culprit code could help
figure it out...!

Jean-Marc

May

Jul 19 '05 #5

P: n/a
Lothat <lo********@gmx.de> wrote:
No test with or without any " let the IIS execute python scrits as cgi.
Http Error code is 404 (but i'm sure that the file exists in the
requested path).


Have you checked the security restrictions? IIS6 has a new feature
whereby script mappings are disabled by default even if they are listed
in the configuration list.

To turn CGI on, go to the IIS Manager snap-in and select the 'Web
Service Extensions' folder. Select 'All Unknown CGI Extensions' and
click 'Allow'.

Incidentally, the string I am using is:

"C:\Program Files\Python\2.4\python.exe" -u "%s" "%s"

--
Andrew Clover
mailto:an*@doxdesk.com
http://www.doxdesk.com/

Jul 19 '05 #6

P: 1
If you set 'All Unknown CGI Extensions' to Allow you will solve your problem as far as running python CGI but you will open up your server to the world to be hacked. The only time that I ever do that would be to test to make sure that I have coded my python CGI correctly. Once I get the cgi app to run properly with this setting, then I would set 'All Unknown CGI Extensions' to 'Prohibited' and configure my Web Server Extension the correct way.

Please let me know if there is anything that did not work for you from http://python.markrowsoft.com/iiswse.asp

Send python questions to python at markrowsoft dot com and I will address them.

Cheers,

Mark

MCSE MCSA

www.python.markrowsoft.com
Aug 4 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.