Hi Dane, Thanks for the response, I've been digging around the issue too. And I am not convinced it's to do with the python version, because your mapnikserv.py script works fine, so there shouldn't be any problem rendering and displaying map files using the mapnik ogcserver.
I did a google search on the fromfd() member function for the socket class in python. And it seems that there were some issues for fromfd() to run on windows. (check http://bugs.python.org/issue1378). It is also indicated on the python documents that formfd() only works on BSD socket not Winsock (http://www.python.org/doc/2.5.2/lib/module-socket.html). Though, I don't see why this issue was not addressed in the later version of python (I am already on python 2.5.2) I was playing with tilecache as well, though I am still not sure how I could link tilecache to a local mapnik server (i.e. I think I need to modify the configuration file so it to point to a local "working" ogcserver.cgi script). Connecting to remote WMS servers seems to work on the testing tilecache scripts already. (In my case, it cached map tiles from remote servers, and store the map tiles in a tile directory specified by the configuration script). Kind regards, Po Cheng P.S. Doing this map serving thing on Windows is also a part of the research I am doing. (Otherwise, I would have already installed a Linux box. >_< ) Dane Blakely Springmeyer wrote: > Hi Po, > > Yes, TileCache and Mod_tile are both better options for OSM data because > they can cache tiles and avoid needing to render tile dynamically (which > is expensive with the large OSM styles). > > If you try TileCache it can run in both cgi and mod_python mode, which > should be a bit easier to set up on windows. > > Thats cool you got the mapnikserv testing script running on windows (I'd > be interested in the steps involved if it took anything special). > > Regarding the OGCServer errors with fastcgi, it looks like the problem > is mismatched python versions. That line "python_init: Python version > mismatch, expected '2.5', found '2.5.2'." says it all. > > Have you tried running the OGCserver script in plain cgi mode? > > It don't have any experience with apache and mod_fastcgi on windows, so > I'm not sure how to help further. Is there anyway you could get a hold > of a linux installation to try testing on? > > Dane > > > > On Tue, 06 Jan 2009 18:48:07 +0000, "Po Cheng" > <[email protected]> said: > >> Dear list, >> >> Sorry for disturbing a quiet and peaceful new year, but I am really stuck >> on this ogcserver provided by Mapnik. >> >> After my last encounter with setting up mapnik in Windows Server 2003 >> (https://lists.berlios.de/pipermail/mapnik-users/2008-December/001440.html). >> I have finally managed to get it working on Dane's mapnik testing >> utilities, including >> nik2img and mapnikserv (from >> http://mapnik-utils.googlecode.com/svn/trunk/). >> >> I then tried to setup the mapnik's ogcserver in the hope that it will run >> a openstreetmap style map service for me but come across lots of missing >> libraries issues. I sorted it all out by installing the additional >> requirements described on http://trac.mapnik.org/wiki/OgcServer and >> http://trac.mapnik.org/wiki/OgcServerSvn. After modifying the >> ogcserv.conf >> and wmsfactory.py to point to appropriate places. The ogcserver cgi >> script >> still does not run and I got an apache error log as follows: >> >> [Tue Jan 06 13:36:53 2009] [notice] Apache/2.2.4 (Win32) >> mod_fastcgi/2.4.6 >> PHP/5.2.3 configured -- resuming normal operations >> [Tue Jan 06 13:36:53 2009] [notice] Server built: Jan 9 2007 23:17:20 >> [Tue Jan 06 13:36:53 2009] [notice] Parent: Created child process 2156 >> [Tue Jan 06 13:36:53 2009] [error] python_init: Python version mismatch, >> expected '2.5', found '2.5.2'. >> [Tue Jan 06 13:36:53 2009] [error] python_init: Python executable found >> 'D:\\POSTGR~1\\ENTERP~1\\apache\\bin\\httpd.exe'. >> [Tue Jan 06 13:36:53 2009] [error] python_init: Python path being used >> 'C:\\Python25\\Lib;C:\\Python25\\DLLs;C:\\Python25\\Lib\\lib-tk;C:\\WINDOWS\\system32\\python25.zip;C:\\Python25\\Lib;C:\\Python25\\DLLs;C:\\Python25\\Lib\\lib-tk;;D:\\POSTGR~1\\ENTERP~1\\apache\\bin'. >> [Tue Jan 06 13:36:53 2009] [notice] mod_python: Creating 8 session >> mutexes >> based on 0 max processes and 250 max threads. >> [Tue Jan 06 13:36:53 2009] [notice] Child 2156: Child process is running >> [Tue Jan 06 13:36:53 2009] [notice] Child 2156: Acquired the start mutex. >> [Tue Jan 06 13:36:53 2009] [notice] Child 2156: Starting 250 worker >> threads. >> [Tue Jan 06 13:36:53 2009] [notice] FastCGI: process manager initialized >> [Tue Jan 06 13:36:53 2009] [notice] Child 2156: Starting thread to listen >> on port 80. >> [Tue Jan 06 13:37:03 2009] [error] [client 127.0.0.1] Premature end of >> script headers: ogcserver.py >> [Tue Jan 06 13:37:03 2009] [error] [client 127.0.0.1] Traceback (most >> recent call last):\r >> [Tue Jan 06 13:37:03 2009] [error] [client 127.0.0.1] File >> "D:\\PostgreSQL\\EnterpriseDB ApachePhp\\apache\\cgi-bin\\ogcserver.py", >> line 29, in <module>\r >> [Tue Jan 06 13:37:03 2009] [error] [client 127.0.0.1] >> fcgi.Server({fcgi.FCGI_RESPONDER: OGCServerHandler}).run()\r >> [Tue Jan 06 13:37:03 2009] [error] [client 127.0.0.1] File >> "C:\\Python25\\lib\\site-packages\\jon\\fcgi.py", line 451, in run\r >> [Tue Jan 06 13:37:03 2009] [error] [client 127.0.0.1] self._sock = >> socket.fromfd(sys.stdin.fileno(), socket.AF_INET, socket.SOCK_STREAM)\r >> [Tue Jan 06 13:37:03 2009] [error] [client 127.0.0.1] AttributeError: >> 'module' object has no attribute 'fromfd'\r >> >> This is after I also configured the apache to load fcgi module like below >> LoadModule fastcgi_module modules/mod_fastcgi.dll >> >> ScriptAlias /fcgi-bin/ "fcgi-bin/" >> ScriptAlias /mapnik/ "fcgi-bin/" >> >> <Directory "fcgi-bin"> >> AllowOverride All >> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch >> Order allow,deny >> Allow from all >> SetHandler fastcgi-script >> </Directory> >> >> The ogcserver.py script is set to run in the original cgi-bin directory, >> i.e. .\cgi-bin, which gives the above apache error. If the same >> ogcserver.py script it set to run in the fastcgi directory, i.e. >> .\fcgi-bin as configured above, the errors are worse (see logs below) and >> the process never seemed to stop trying. >> >> [Tue Jan 06 14:20:52 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" >> started (pid 4012) >> [Tue Jan 06 14:20:52 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" (pid >> 4012) terminated with exit with status '1' >> [Tue Jan 06 14:20:57 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" >> restarted (pid 2256) >> [Tue Jan 06 14:20:57 2009] [error] [client 127.0.0.1] (OS 109)The pipe >> has >> been ended. : FastCGI: comm with server "D:/PostgreSQL/EnterpriseDB >> ApachePhp/apache/fcgi-bin/ogcserver.py" aborted: GetOverlappedResult() >> failed >> [Tue Jan 06 14:20:57 2009] [error] [client 127.0.0.1] FastCGI: incomplete >> headers (0 bytes) received from server "D:/PostgreSQL/EnterpriseDB >> ApachePhp/apache/fcgi-bin/ogcserver.py" >> [Tue Jan 06 14:20:57 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" (pid >> 2256) terminated with exit with status '1' >> [Tue Jan 06 14:21:02 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" >> restarted (pid 648) >> [Tue Jan 06 14:21:02 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" (pid >> 648) terminated with exit with status '1' >> [Tue Jan 06 14:21:07 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" >> restarted (pid 3540) >> [Tue Jan 06 14:21:07 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" (pid >> 3540) terminated with exit with status '1' >> [Tue Jan 06 14:21:07 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" has >> failed to remain running for 30 seconds given 3 attempts, its restart >> interval has been backed off to 600 seconds >> [Tue Jan 06 14:21:08 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" has >> failed to remain running for 30 seconds given 3 attempts, its restart >> interval has been backed off to 600 seconds >> [Tue Jan 06 14:21:09 2009] [warn] FastCGI: (dynamic) server >> "D:/PostgreSQL/EnterpriseDB ApachePhp/apache/fcgi-bin/ogcserver.py" has >> failed to remain running for 30 seconds given 3 attempts, its restart >> interval has been backed off to 600 seconds >> >> So, I am wondering if it is worth the trouble to pursuit further down the >> path with setting up the ogcserv do what openstreetmap does, or am I >> better off trying tilecache or mod_tile (given there is no ready compiled >> mod_tile binaries for windows). As far as I am concerned, the mapnik is >> working fine, the final problem I have is the cgi link to the apache so I >> can display maps from the datasets in the postqis database or on a .osm >> mapfile. Any advise would be very much appreciated. >> >> Po Cheng >> 06/Jan/09 >> >> >> _______________________________________________ >> Mapnik-users mailing list >> [email protected] >> https://lists.berlios.de/mailman/listinfo/mapnik-users >> > > > _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

