I'm trying to set up Mercurial repositories to be hosted by IIS under Windows Server 2003. Following this post I installed Python 2.5.4.4 and Mercurial 1.3, set up virtual dir, extracted library.zip and created hgwebdir.config.
However, when I trying to open the http://hostname/hg/hgwebdir.cgi I got an error “The specified CGI application misbehaved by not returning a complete set of HTTP headers.” I did all by best:
One more thing is when I'm requesting inexistent script file (e.g /hg/inexist.cgi) I have the same error. Nothing helped!
Some more things that I needed to fix:
c:\whatever\Python26\python.exe -u "%s" "%s"
instead use c:\whatever\Python26\python.exe -u -O -B "%s" "%s"
-O causes it to also look for .pyo files (not just .py or .pyc, which at least in my version weren't present). -B causes it to not attempt to compile .py files that it finds into .pyo files (which fails due to lacking write permissions)Finally I got that "no headers" error returned on any python script error, so I checked script with console interpreter and fixed errors in my config file. And of course I should ask this question at ServerFault instead of StackOverflow - the lack of sleep did the job :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With