<div dir="ltr">Thanks Christopher<br><br>firstly, I just type this lines in IDLE . then nothing happens, it stuck there<br><br>then I put the script which you sent to me into a test python file <br><br>when I open the file (<a href="http://127.0.0.1/test/mptest.py">http://127.0.0.1/test/mptest.py</a>) I do get some error message, <br>
<pre>URI: '/test/mptest.py'<br>Location: None<br>Directory: 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/test/'<br>Filename: 'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/test/mptest.py'<br>
PathInfo: ''<br><br>Phase: 'PythonHandler'<br>Handler: 'mptest'<br><br>Traceback (most recent call last):<br><br> File "C:\Python25\lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch<br>
default=default_handler, arg=req, silent=hlist.silent)<br><br> File "C:\Python25\lib\site-packages\mod_python\importer.py", line 1202, in _process_target<br> module = import_module(module_name, path=path)<br>
<br> File "C:\Python25\lib\site-packages\mod_python\importer.py", line 296, in import_module<br> log, import_path)<br><br> File "C:\Python25\lib\site-packages\mod_python\importer.py", line 680, in import_module<br>
execfile(file, module.__dict__)<br><br> File "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\mptest.py", line 2, in <module><br> urllib.urlopen('<a href="http://labs.metacarta.com/wms/vmap0').read(">http://labs.metacarta.com/wms/vmap0').read(</a>)<br>
<br> File "C:\Python25\lib\urllib.py", line 82, in urlopen<br> return opener.open(url)<br><br> File "C:\Python25\lib\urllib.py", line 190, in open<br> return getattr(self, name)(url)<br><br> File "C:\Python25\lib\urllib.py", line 325, in open_http<br>
h.endheaders()<br><br> File "C:\Python25\lib\httplib.py", line 856, in endheaders<br> self._send_output()<br><br> File "C:\Python25\lib\httplib.py", line 728, in _send_output<br> self.send(msg)<br>
<br> File "C:\Python25\lib\httplib.py", line 695, in send<br> self.connect()<br><br> File "C:\Python25\lib\httplib.py", line 679, in connect<br> raise socket.error, msg<br><br>IOError: [Errno socket error] (10060, 'Operation timed out')<br>
<br><br>MODULE CACHE DETAILS<br><br>Accessed: Fri Jul 18 15:51:23 2008<br>Generation: 0<br><br>_mp_4dc1c0c8307510ff7d0d209757080772 {<br> FileName: 'C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\test\\mptest.py'<br>
Instance: 1 [IMPORT]<br> Generation: 0 [ERROR]<br> Modified: Fri Jul 18 15:51:09 2008<br>}<br></pre><br><br>is that means I have to looking for a suitable mod_python ?<br>on the anther way, without mod_python, I just copy all file into /apache/cgi-bin/<br>
<br>when I open the link <a href="http://127.0.0.1/cgi-bin/tilecache-2.04/tilecache.cgi/1.0.0/basic/0/0/0.png">http://127.0.0.1/cgi-bin/tilecache-2.04/tilecache.cgi/1.0.0/basic/0/0/0.png</a><br>I have same error with mod_python <br>
<pre>An error occurred: <urlopen error (10060, 'Operation timed out')><br> File "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\tilecache-2.04\TileCache\Service.py", line 290, in cgiHandler<br>
format, image = service.dispatchRequest( params, path_info, req_method, host )<br> File "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\tilecache-2.04\TileCache\Service.py", line 208, in dispatchRequest<br>
return self.renderTile(tile, params.has_key('FORCE'))<br> File "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\tilecache-2.04\TileCache\Service.py", line 138, in renderTile<br> data = layer.render(tile)<br>
File "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\tilecache-2.04\TileCache\Layer.py", line 437, in render<br> return self.renderTile(tile)<br> File "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\tilecache-2.04\TileCache\Layers\WMS.py", line 29, in renderTile<br>
tile.data, response = wms.fetch()<br> File "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\tilecache-2.04\TileCache\Client.py", line 54, in fetch<br> response = self.client.open(urlrequest)<br>
File "C:\Python25\lib\urllib2.py", line 374, in open<br> response = self._open(req, data)<br> File "C:\Python25\lib\urllib2.py", line 392, in _open<br> '_open', req)<br> File "C:\Python25\lib\urllib2.py", line 353, in _call_chain<br>
result = func(*args)<br> File "C:\Python25\lib\urllib2.py", line 1101, in http_open<br> return self.do_open(httplib.HTTPConnection, req)<br> File "C:\Python25\lib\urllib2.py", line 1076, in do_open<br>
raise URLError(err)<br></pre>I am wondering whether there is any packages that combine Apache + mod_python + tilecache?<br><br>Thanks <br><br>Xiaoyu<br><br><br><br><div class="gmail_quote">On Fri, Jul 18, 2008 at 3:41 PM, Christopher Schmidt <<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Fri, Jul 18, 2008 at 11:45:19AM +0200, Xiaoyu Guan wrote:<br>
> Hi Tibor:<br>
> Thanks for your advise.<br>
> as you mentioned, I just try the two link<br>
><br>
> from <a href="http://127.0.0.1/tilecache/tilecache.py/1.0.0/" target="_blank">http://127.0.0.1/tilecache/tilecache.py/1.0.0/</a><br>
> I got xml codes like this<br>
><br>
> <TileMapService version="1.0.0"><br>
</div>> ?$B!]<br>
<div class="Ih2E3d">> <TileMaps><br>
> <TileMap href="<a href="http://127.0.0.1/tilecache/tilecache.py/1.0.0/basic/" target="_blank">http://127.0.0.1/tilecache/tilecache.py/1.0.0/basic/</a>"<br>
> srs="EPSG:4326" title="basic" profile="global-geodetic"/><br>
> </TileMaps><br>
> </TileMapService><br>
<br>
</div>This is expected.<br>
<div class="Ih2E3d"><br>
> However, I got error when I open next link<br>
><br>
> An error occurred: <urlopen error (10060, 'Operation timed out')><br>
<br>
</div>This is not a TileCache problem.<br>
<br>
The problem is, specifically, that Python running within mod_python<br>
can't access to the URL that you have configured.<br>
<br>
This typically means that something about your configuration doesn't<br>
allow this type of access. Perhaps it's a firewall rule, or something<br>
else.<br>
<br>
You can try testing with a python command line: typing:<br>
<br>
import urllib<br>
urllib.urlopen('<a href="http://labs.metacarta.com/wms/vmap0%27%29.read%28" target="_blank">http://labs.metacarta.com/wms/vmap0').read(</a>)<br>
<br>
If you get the same error: great, fix that, then move on.<br>
<br>
Unfortunately, this usually doesn't happen: usually people come back and<br>
say 'it works on the command line, but not in TileCache.'<br>
<br>
At that point, it's a problem with your machine/mod_python, which I<br>
don't know how to solve.<br>
<br>
However, it's not a TileCache-specific bug, so you'd want to look for<br>
'mod_python urllib timeout' in searches, rather than anything TileCache<br>
specific.<br>
<br>
Regards,<br>
<font color="#888888">--<br>
Christopher Schmidt<br>
MetaCarta<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Xiaoyu Guan (Sam)<br>Geo-information Science<br>Wageningen UR<br>
</div>