Hi ALL,

I have installed mapnik0.7.1 with boost_1.4.0, libicu-4.4, apache-2.2,
mod_wsgi-2.5-1 on Ubuntu 9.10. When I run my wms.py script, I get
Target WSGI script cannot be loaded as Python module
==============================================================================================
[Thu Apr 15 12:51:35 2010] [notice] Apache/2.2.12 (Ubuntu)
mod_wsgi/2.5 Python/2.6.4 configured -- resuming normal operations
[Thu Apr 15 12:51:41 2010] [info] mod_wsgi (pid=2287): Create
interpreter 'ubuntu.digi.com:8080|'.
[Thu Apr 15 12:51:41 2010] [info] [client 10.80.1.201] mod_wsgi
(pid=2287, process='ogcserver', application='ubuntu.digi.com:8080|'):
Loading WSGI script '/planet/devel/code/ogcserver/wms.py'.
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201] mod_wsgi
(pid=2287): Target WSGI script '/planet/devel/code/ogcserver/wms.py'
cannot be loaded as Python module.
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201] mod_wsgi
(pid=2287): Exception occurred processing WSGI script
'/planet/devel/code/ogcserver/wms.py'.
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201] Traceback
(most recent call last):
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201]   File
"/planet/devel/code/ogcserver/wms.py", line 7, in <module>
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201]
application = WSGIApp('/planet/devel/code/ogcserver/ogcserver.conf')
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201]   File
"/usr/lib/python2.6/dist-packages/mapnik/ogcserver/wsgi.py", line 40,
in __init__
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201]
mapfactorymodule = __import__(conf.get('server', 'module'))
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201]   File
"//planet/devel/code/ogcserver/mapnikserv.py", line 7
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201]      def __init__(self):
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201]        ^
[Thu Apr 15 12:51:41 2010] [error] [client 10.80.1.201]
IndentationError: expected an indented block
[Thu Apr 15 12:51:41 2010] [debug] mod_deflate.c(615): [client
10.80.1.201] Zlib: Compressed 616 to 381 : URL /
==============================================================================================

The apache2 configuration file is
==============================================================================================
WSGISocketPrefix /var/run/apache2/wsgi
<VirtualHost *:8080>
WSGIDaemonProcess ogcserver user=mapadmin group=mapadmin processes=10 threads=2
WSGIProcessGroup ogcserver
WSGIScriptAlias / /planet/devel/code/ogcserver/wms.py
LogLevel debug
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
==============================================================================================

The wms.py is
==============================================================================================
#!/usr/bin/env python
import os
import sys
from mapnik.ogcserver.wsgi import WSGIApp
sys.path.append('//planet/devel/code/ogcserver/')
application = WSGIApp('/planet/devel/code/ogcserver/ogcserver.conf')
==============================================================================================

The ogcserver.conf is
==============================================================================================
[server]
module=mapnikserv
[service]
title=Mapnik OGC Server
abstract=This abstract describes the server and its contents.
maxheight=1024
maxwidth=1024
allowedepsgcodes=4326
onlineresource=http://www.mapnik.org/
fees=
keywordlist=
accessconstraints=
maxage=86400
[contact]
contactperson=
contactorganization=
contactposition=
addresstype=
address=
city=
stateorprovince=
postcode=
country=
contactvoicetelephone=
contactelectronicmailaddress=
==============================================================================================

The mapnikserv.py is
==============================================================================================
from mapnik.ogcserver.WMS import BaseWMSFactory
from mapnik import *
PROJ4_STRING = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs
+over'
class WMSFactory(BaseWMSFactory):
def __init__(self):
BaseWMSFactory.__init__(self)
self.loadXML('/planet/devel/code/ogcserver/osm.xml')
self.finalize()
==============================================================================================

The osm.xml is from johnnydobbins
==============================================================================================
http://johnnydobbins.com/2009/05/31/mapnik-ogcserver-setup-from-scratch/
==============================================================================================

The directory /planet/devel/code/ogcserver contains symbols
checked-out from mapnik and the world_boundaries folders.

The test application for mod_wsgi
(http://wiki.pylonshq.com/display/pylonscookbook/mod_wsgi+and+workingenv.py#id4)
works fine, but the script above (wms.py) does not work.

Please let me know how to resovle

Regards
Shann

-- 
Thanks & Regards
Prashant N
http://openenter.blogspot.com
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to