<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Setting Up Python on IIS7</title>
	<atom:link href="http://geographika.co.uk/setting-up-python-on-iis7/feed" rel="self" type="application/rss+xml" />
	<link>http://geographika.co.uk/setting-up-python-on-iis7?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=setting-up-python-on-iis7</link>
	<description>Developing geo-technologies</description>
	<lastBuildDate>Sat, 31 Jul 2010 10:22:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: geographika &#187; Using TileCache on IIS</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-471</link>
		<dc:creator>geographika &#187; Using TileCache on IIS</dc:creator>
		<pubDate>Sun, 04 Jul 2010 13:01:46 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-471</guid>
		<description>[...] previously written about using PyISAPie to run Python under IIS – this allows Python scripts to run faster than using CGI. Rather than starting up the Python [...]</description>
		<content:encoded><![CDATA[<p>[...] previously written about using PyISAPie to run Python under IIS – this allows Python scripts to run faster than using CGI. Rather than starting up the Python [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geographika</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-469</link>
		<dc:creator>geographika</dc:creator>
		<pubDate>Wed, 30 Jun 2010 20:48:21 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-469</guid>
		<description>Hi Chris - I uploaded my TileCache script to http://bitbucket.org/geographika/mapserver-scripts/changeset/40e84703a58d

Let me know how you get on. I&#039;ll try and turn my notes into a post at some point. I think there were a couple of changes I have to make in the TileCache scripts themselves due to Python errors.</description>
		<content:encoded><![CDATA[<p>Hi Chris &#8211; I uploaded my TileCache script to <a href="http://bitbucket.org/geographika/mapserver-scripts/changeset/40e84703a58d" rel="nofollow">http://bitbucket.org/geographika/mapserver-scripts/changeset/40e84703a58d</a></p>
<p>Let me know how you get on. I&#8217;ll try and turn my notes into a post at some point. I think there were a couple of changes I have to make in the TileCache scripts themselves due to Python errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-467</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Fri, 25 Jun 2010 23:18:32 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-467</guid>
		<description>@geographika
first of all: I like your blog and your simple way to explain things, I guess you did already safe some people some time!

you said, that you were  able to get TileCache running on IIS7 with PyISAPIe. Could you give me a hint, how the original tilecache.py has to be changed?

------------------------------
from TileCache import Service, cgiHandler, cfgfiles

if __name__ == &#039;__main__&#039;:
    svc = Service.load(*cfgfiles)
    cgiHandler(svc)
------------------------------

I guess, since it isn&#039;t a CGI script, that has to be adopted... currently I get:

Request handler failed

Traceback (most recent call last):
  File &quot;C:\Python25\PyISAPIe\Http\Isapi.py&quot;, line 49, in Request
    raise ImportError, &quot;[Loading &#039;%s&#039;] %s&quot; % (Env.SCRIPT_TRANSLATED, str(Val))
ImportError: [Loading &#039;\\?\C:\inetpub\wwwroot\tilecache\tilecache.py&#039;] &#039;module&#039; object has no attribute &#039;argv&#039;</description>
		<content:encoded><![CDATA[<p>@geographika<br />
first of all: I like your blog and your simple way to explain things, I guess you did already safe some people some time!</p>
<p>you said, that you were  able to get TileCache running on IIS7 with PyISAPIe. Could you give me a hint, how the original tilecache.py has to be changed?</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
from TileCache import Service, cgiHandler, cfgfiles</p>
<p>if __name__ == &#8216;__main__&#8217;:<br />
    svc = Service.load(*cfgfiles)<br />
    cgiHandler(svc)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>I guess, since it isn&#8217;t a CGI script, that has to be adopted&#8230; currently I get:</p>
<p>Request handler failed</p>
<p>Traceback (most recent call last):<br />
  File &#8220;C:\Python25\PyISAPIe\Http\Isapi.py&#8221;, line 49, in Request<br />
    raise ImportError, &#8220;[Loading '%s'] %s&#8221; % (Env.SCRIPT_TRANSLATED, str(Val))<br />
ImportError: [Loading '\\?\C:\inetpub\wwwroot\tilecache\tilecache.py'] &#8216;module&#8217; object has no attribute &#8216;argv&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-306</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Wed, 28 Apr 2010 20:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-306</guid>
		<description>&lt;a href=&#039;#comment-168&#039; rel=&quot;nofollow&quot;&gt;@Cyrus&lt;/a&gt;
Cyrus, can you describe what you did here?  How does IIS know to run the rundjango.py file of you do not specify the filename on the command line?</description>
		<content:encoded><![CDATA[<p><a href='#comment-168' rel="nofollow">@Cyrus</a><br />
Cyrus, can you describe what you did here?  How does IIS know to run the rundjango.py file of you do not specify the filename on the command line?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joss</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-299</link>
		<dc:creator>joss</dc:creator>
		<pubDate>Thu, 22 Apr 2010 12:10:53 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-299</guid>
		<description>A quick hack I found very useful was to modify Http/Isapi.py such that it reloads the file if you have modified it:

from PyISAPIe import Env
from hashlib import md5
import imp
from os import stat

Handlers = {}
TimeMap = {}

def Request():
  Script = Env.SCRIPT_NAME
  Key = Name = &#039;__&#039;+md5(Script).hexdigest().upper()
  Handler = Handlers.get(Key, None)
  mtime = stat(Env.SCRIPT_TRANSLATED[4:])[8]
  if not Handler or TimeMap[Key] &lt; mtime:
    Handlers[Key] = imp.load_source(Key, Env.SCRIPT_TRANSLATED).Request
    TimeMap[Key] = mtime
  return Handlers[Key]()</description>
		<content:encoded><![CDATA[<p>A quick hack I found very useful was to modify Http/Isapi.py such that it reloads the file if you have modified it:</p>
<p>from PyISAPIe import Env<br />
from hashlib import md5<br />
import imp<br />
from os import stat</p>
<p>Handlers = {}<br />
TimeMap = {}</p>
<p>def Request():<br />
  Script = Env.SCRIPT_NAME<br />
  Key = Name = &#8216;__&#8217;+md5(Script).hexdigest().upper()<br />
  Handler = Handlers.get(Key, None)<br />
  mtime = stat(Env.SCRIPT_TRANSLATED[4:])[8]<br />
  if not Handler or TimeMap[Key] &lt; mtime:<br />
    Handlers[Key] = imp.load_source(Key, Env.SCRIPT_TRANSLATED).Request<br />
    TimeMap[Key] = mtime<br />
  return Handlers[Key]()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geographika &#187; Compiling a 64 bit Version of PyISAPIe</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-268</link>
		<dc:creator>geographika &#187; Compiling a 64 bit Version of PyISAPIe</dc:creator>
		<pubDate>Fri, 16 Apr 2010 10:12:22 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-268</guid>
		<description>[...] then set up the PyISAPIe.DLL on IIS7 (using the same process as I detailed here), replacing the 32-bit DLL with my newly compiled 64-bit, and using the DefaultAppPool which should [...]</description>
		<content:encoded><![CDATA[<p>[...] then set up the PyISAPIe.DLL on IIS7 (using the same process as I detailed here), replacing the 32-bit DLL with my newly compiled 64-bit, and using the DefaultAppPool which should [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geographika &#187; Reboot to Refresh Environment Variables</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-233</link>
		<dc:creator>geographika &#187; Reboot to Refresh Environment Variables</dc:creator>
		<pubDate>Tue, 06 Apr 2010 08:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-233</guid>
		<description>[...] This knowledge may save a couple of hours of frustration if you are running Python scripts on IIS through PyISAPIe. [...]</description>
		<content:encoded><![CDATA[<p>[...] This knowledge may save a couple of hours of frustration if you are running Python scripts on IIS through PyISAPIe. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geographika</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-179</link>
		<dc:creator>geographika</dc:creator>
		<pubDate>Mon, 22 Mar 2010 18:04:05 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-179</guid>
		<description>&lt;a href=&#039;#comment-177&#039; rel=&quot;nofollow&quot;&gt;@Jonathan&lt;/a&gt;
TileCache has been running for a couple of months now without any problems. 
Both &lt;a href=&quot;http://sei.maps.ie/wind&quot; rel=&quot;nofollow&quot;&gt;http://sei.maps.ie/wind&lt;/a&gt; and &lt;a href=&quot;http://sei.maps.ie/geothermal&quot; rel=&quot;nofollow&quot;&gt;http://sei.maps.ie/geothermal&lt;/a&gt; are using caches. 
I had both Apache and IIS running the same .map files on the same Windows 2008 64-bit server. 
I used JMeter to test the performance between the two, but after a few consecutive requests Apache froze. &lt;a href=&quot;http://geographika.co.uk/mapserverwindowsapachecrash&quot; rel=&quot;nofollow&quot;&gt;I wasn&#039;t able to find out why&lt;/a&gt;, but IIS and ISAPI were able to handle anything I threw at it. 
I&#039;d strongly recommend using IIS if using Windows. You can also take advantage of the 64-bit MapServer (although a 64-bit Python version is not yet ready as far as I know).</description>
		<content:encoded><![CDATA[<p><a href='#comment-177' rel="nofollow">@Jonathan</a><br />
TileCache has been running for a couple of months now without any problems.<br />
Both <a href="http://sei.maps.ie/wind" rel="nofollow">http://sei.maps.ie/wind</a> and <a href="http://sei.maps.ie/geothermal" rel="nofollow">http://sei.maps.ie/geothermal</a> are using caches.<br />
I had both Apache and IIS running the same .map files on the same Windows 2008 64-bit server.<br />
I used JMeter to test the performance between the two, but after a few consecutive requests Apache froze. <a href="http://geographika.co.uk/mapserverwindowsapachecrash" rel="nofollow">I wasn&#8217;t able to find out why</a>, but IIS and ISAPI were able to handle anything I threw at it.<br />
I&#8217;d strongly recommend using IIS if using Windows. You can also take advantage of the 64-bit MapServer (although a 64-bit Python version is not yet ready as far as I know).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-177</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-177</guid>
		<description>Great Stuff. I was playing with this about two months ago and came to an abrupt halt - python was proving too much of a learning curve. Just to confirm - have you defintely got tilecache working with this set up - and if do - how does it compare with mod_apache?

All the best,

Jonathan</description>
		<content:encoded><![CDATA[<p>Great Stuff. I was playing with this about two months ago and came to an abrupt halt &#8211; python was proving too much of a learning curve. Just to confirm &#8211; have you defintely got tilecache working with this set up &#8211; and if do &#8211; how does it compare with mod_apache?</p>
<p>All the best,</p>
<p>Jonathan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cyrus</title>
		<link>http://geographika.co.uk/setting-up-python-on-iis7/comment-page-1#comment-168</link>
		<dc:creator>Cyrus</dc:creator>
		<pubDate>Mon, 15 Mar 2010 05:20:31 +0000</pubDate>
		<guid isPermaLink="false">http://geographika.co.uk/?p=273#comment-168</guid>
		<description>Nevermind, I got it working.  Needed the most up to date Pyisapie files.  Then had to mod Pyisapie.py for django 1.0.  Thanks!</description>
		<content:encoded><![CDATA[<p>Nevermind, I got it working.  Needed the most up to date Pyisapie files.  Then had to mod Pyisapie.py for django 1.0.  Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
