On Mar 14, 2010, at 7:08 AM, John Mitchell wrote:

I fixed the previous problem by adding to the first line:
#!c:\Python25\python.exe

Now I get the following errors within the apache error log:
[Sun Mar 14 09:54:34 2010] [error] [client 127.0.0.1] Premature end of
script headers: wmsWSGI_4326_apache.py
[Sun Mar 14 09:54:34 2010] [error] [client 127.0.0.1] Traceback (most
recent call last):\r
[Sun Mar 14 09:54:34 2010] [error] [client 127.0.0.1]   File
"C:/mapnik_0_6_1/example_code/wms/wmsWSGI_4326_apache.py", line 8, in
<module>\r
[Sun Mar 14 09:54:34 2010] [error] [client 127.0.0.1]     from
mapnik.ogcserver.wsgi import WSGIApp\r
[Sun Mar 14 09:54:34 2010] [error] [client 127.0.0.1] ImportError: No
module named mapnik.ogcserver.wsgi\r

So it is erroring off on the line:
from mapnik.ogcserver.wsgi import WSGIApp



This means that your apache user (depending on how apache is set up) does not have the Mapnik python bindings available on sys.path or PYTHONPATH.

http://docs.python.org/tutorial/modules.html#the-module-search-path
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonPath

This is likely because when you set up Mapnik you set the %USER% environment variables instead of the %SYSTEM% ones in your Windows preferences for PYTHONPATH, and apache is not running as your normal user.

So, you can add the necessary paths using the info above to the SYSTEM variable, or you can run as your normal user by using the WSGIDaemonProcess directive:

http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess


This did not error off when running as WSGI standalone.

My wmsWSGI_4326_apache.py without comments are the following:

#!c:\Python25\python.exe
import sys
sys.path.append('C:/mapnik_0_6_1/example_code/wms/')
from mapnik.ogcserver.wsgi import WSGIApp
application = WSGIApp('C:/mapnik_0_6_1/example_code/wms/ ogcserver_4326.conf')

John



On 3/14/10, John Mitchell <[email protected]> wrote:
Dane,

I have set up mod_wsgi on apache and I trying to access the ogcserver
and I get the following error within apache error log:
[Sun Mar 14 09:20:46 2010] [error] [client 127.0.0.1] C:/Program Files
(x86)/Apache Software Foundation/Apache2.2/wms/wmsWSGI_4326_apache.py
is not executable; ensure interpreted scripts have "#!" first line
[Sun Mar 14 09:20:46 2010] [error] [client 127.0.0.1] (9)Bad file
descriptor: don't know how to spawn child process: C:/Program Files
(x86)/Apache Software Foundation/Apache2.2/wms/wmsWSGI_4326_apache.py

John


On 3/13/10, Dane Springmeyer <[email protected]> wrote:
The ogcserver does fine deployed in a multithreaded environment. Look
in apache+mod_wsgi.

Running the server "standalone" uses the wsgiref module built into
python, which is really only intended for testing. Running multiple
instances of it does not make sense.

--- \o/ ---
Sent from my phone

On Mar 13, 2010, at 11:16 AM, John Mitchell <[email protected]>
wrote:

I realize that the WMS OGCServer that sits on top of Mapnik is only a single threaded application but if I did the following to simulate a
multi-threaded application would this be feasible?

Have 10 command windows running a different wms_WSGI_4326.py script
(1-10) as a WSGI standalone server with the only difference being that each script refers to a different port number (8001-8008). On top of all these servers is geowebcache which processes the WMS requests to
it from the client back to each of these WSGI standalone servers in
round robin format.

Does this make sense?

Thanks,

John

--
John J. Mitchell
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users



--
John J. Mitchell



--
John J. Mitchell

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to