<div dir="ltr">Dear all <br>I have setup Mod python with Apache 2.2 (Python 2.5) . from the test page, I am sure mod python it works<br>then I try to setup TileCache 2.04<br>after download setuptools-0.6c8-py2.5.egg<br clear="all">
At first, I copy Tilecache 2.04 to /Apache2.2/cgi-bin/, use terminal&nbsp; run setup.py, seem like nothing works, then I copy all the file to /Apache2.2/htdocs/tilecache , run setup.py again. <br><br>according to some tutorials online, I have configured my Apache like this:<br>
<br>1. Add<br>&lt;Directory &quot;C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/tilecache&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AddHandler python-program .py<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PythonHandler TileCache.Service<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PythonOption TileCacheConfig &quot;C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/tilecache/tilecache.cfg&quot;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PythonPath &quot;[&#39;c:\Program Files\Apache Software Foundation\Apache2.2\htdocs\tilecache&#39;] + sys.path&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PythonDebug On<br>&lt;/Directory&gt;<br><br>to Apache httpd.conf, restart apache, no error<br>
beside that tilecache.cfg modified like this <br><br>[cache]<br>type=DiskCache<br>base= c:\tilecache2<br><br>2. Change some python script header to&nbsp; #!C:/Python25/python.exe -u<br><br>3. I changed tilecache.cgi into tilecache.py (under /Apache2.2/htdocs/tilecache/)index.html openlayers script like this<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var map, layer;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function init(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map = new OpenLayers.Map( $(&#39;map&#39;), {&#39;maxResolution&#39;: 360/512});<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layer = new OpenLayers.Layer.WMS( &quot;VMap0&quot;, <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;/tilecache/tilecache.py?&quot;, {layers: &#39;basic&#39;, format: &#39;image/png&#39; } );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayer(layer);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addControl(new OpenLayers.Control.Permalink());<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!map.getCenter()) map.zoomToMaxExtent();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>4. when I open <a href="http://127.0.0.1/tilecache/tilecache.py">http://127.0.0.1/tilecache/tilecache.py</a> without error message, but follow xml codes<br>
<style>BODY{font:x-small &#39;Verdana&#39;;margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:&#39;Courier New&#39;;font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}</style><div class="e"><span class="b">&nbsp;</span> <span class="m">&lt;?</span><span class="pi">xml 
version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; </span><span class="m">?&gt;</span> </div>
<div class="e">
<div class="c" style="margin-left: 1em; text-indent: -2em;"><a class="b" onfocus="h()" onclick="return false" href="#">-</a> <span class="m">&lt;</span><span class="t">Services</span><span class="m">&gt;</span></div>
<div>
<div class="e">
<div style="margin-left: 1em; text-indent: -2em;"><span class="b">&nbsp;</span> <span class="m">&lt;</span><span class="t">TileMapService</span> <span class="t">version</span><span class="m">=&quot;</span><b>1.0.0</b><span class="m">&quot;</span><span class="t"> href</span><span class="m">=&quot;</span><b><a href="http://127.0.0.1/1.0.0/">http://127.0.0.1/1.0.0/</a></b><span class="m">&quot;</span><span class="m"> /&gt;</span> </div>
</div>
<div><span class="b">&nbsp;</span> <span class="m">&lt;/</span><span class="t">Services</span><span class="m">&gt;<br><br><br></span></div></div></div><br>now I could not find where error is ? is there anybody have same problems before ?<br>
Thanks in advance <br><br>All the best <br>-- <br>Xiaoyu Guan (Sam)<br>Geo-information Science<br>Wageningen UR<br>
</div>