[MapProxy] problems with apache and mod_wsgi: Import error: no module named site

Oliver Rau o.rau at mairdumont.com
Wed Mar 6 07:51:59 PST 2013

Hello together,

i am using Mapproxy 1.5 under Ubuntu 12.04 and i have problems with 
deploying Mapproxy with Apache and the mod_wsgi module. 
Some months ago everthing worked perfect, i haven't changed settings in 
any apache config files but after updating to version Mapproxy 1.5 i got 
the problems.

After starting apache i could not reach Mapproxy via Firefox even the 
localhost page did not response something from the apache.
I checked the error.log and there i have thousands of identical errors:

[Wed Mar 06 13:52:28 2013] [warn] mod_wsgi: Compiled for Python/2.7.2+.
[Wed Mar 06 13:52:28 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Wed Mar 06 13:52:28 2013] [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 
Python/2.7.3 configured -- resuming normal operations
ImportError: No module named site
ImportError: No module named site
ImportError: No module named site

Here are my config files

1. config.py
# WSGI module for use with Apache mod_wsgi or gunicorn

# uncomment the following lines for logging
# create a log.ini with `mapproxy-util create -t log-ini`
from logging.config import fileConfig
import os.path
fileConfig(r'/home/gisuser/mapproxy/etc/log.ini', {'here': 

from mapproxy.wsgiapp import make_wsgi_app
application = make_wsgi_app(r'/home/gisuser/mapproxy/etc/mapproxy.yaml')

2.  /etc/apache2/mods-enabled/wsgi.conf

    #WSGILazyInitialization On|Off

    WSGIPythonHome /home/gisuser/mapproxy

3.  /etc/apache2/sites-available/default:

WSGIScriptAlias /mapproxy /home/gisuser/mapproxy/etc/config.py

WSGIDaemonProcess mapproxy user=gisuser group=gisuser processes=8 
WSGIProcessGroup mapproxy

       <Directory //home/gisuser/mapproxy/etc/>
         Order deny,allow
         Allow from all

The rights for the cach directories are already set too

sudo chown www-data /path_to_cache
sudo chgrp www-data /path_to_cache

Does anyone could help o have an idea?

Mit freundlichen Grüßen

 Oliver Rau
 Bereich GeodatenManagement
 Teamleiter Entwicklung

Marco-Polo-Str. 1
D-73760 Ostfildern

Telefon +49 711 / 4502-152
Telefax +49 711 / 4502-341
mobil +49 162 / 4496282
mailto:o.rau at mairdumont.com

Sitz: 73760 Ostfildern
Amtsgericht: Stuttgart HRA 211281
Geschäftsführer: Dr. Stephanie Mair-Huydts, Dr. Thomas Brinkmann, Dr. Frank Mair, Uwe Zachmann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20130306/2c69fd69/attachment.html>

More information about the MapProxy mailing list