[MapProxy] Need help installing MapProxy embeded in Apache

Cao Minh Tu caominhtuvn at gmail.com
Wed Apr 17 03:57:55 PDT 2013

Hi list,

I am a newbie finding ways to implement MapProxy as a tile cache server.
Right now I am testing it on a clean Ubuntu 12.04 64 bit virtual machine
with Google map tiles source and instructions found here:
http://lists.osgeo.org/pipermail/mapproxy/2012-February/000976.html (I
added some twists to the instruction).

**** My configuration file (mapproxy.yaml):*

    type: tile
    url: http://mt0.google.com/vt/lyrs=m@0&hl=en&x=%(x)s&y=%(y)s&z=%(z)s
    grid: gm_grid

    origin: ul

    grids: [gm_grid]
    sources: [gm]
    cache_dir: /etc/mapproxy/cached_tiles
      type: file
      directory_layout: tc

  - name: layer
    title: tiles
    sources: [gm_cache]

**** My installation process:*
#On a Debian or Ubuntu system, you need to install the following packages:
    sudo apt-get install python-imaging python-yaml libproj0
#To get all optional packages:
    sudo apt-get install libgeos-dev python-lxml libgdal-dev python-shapely
#install easy_install
    sudo apt-get install python-setuptools
#install pip
    sudo easy_install pip
#install mapproxy
    sudo pip install MapProxy
#copy an existing configuration to /etc/mapproxy.yaml
    sudo cp mapproxy.yaml /etc/mapproxy.yaml
#install apache
    sudo apt-get install apache2
#install mod-wsgi on apache2
    sudo apt-get install libapache2-mod-wsgi
#create wsgi python application file 'config.py'
    sudo mapproxy-util create -t wsgi-app -f /etc/mapproxy.yaml
#edit file /etc/apache2/sites-available/default
    sudo gedit /etc/apache2/sites-available/default
#add lines:
    WSGIScriptAlias /mapproxy /path_to_config/config.py
    <Directory /path_to_config/>
        Order deny,allow
        Allow from all
#mapproxy yaml contains paths to cache_directories, allow access for
apache2 wsgi
    sudo chown www-data /etc/mapproxy/cached_tiles
    sudo chgrp www-data /etc/mapproxy/cached_tiles
#load configuration into apache by restarting apache
    sudo apache2ctl restart

**** Problem:*
When I run the develop server from the terminal: sudo mapproxy-util
serve-develop /etc/mapproxy.yaml
and access the web page locally (
everything was fine.
When I access "http://ip_of_ubuntu_server/mapproxy" from another computer,
the map was loaded with already cached tiles only, *all new tiles
(uncached) won't display*.

Is this a problem with Apache user privileges or something else - can
anyone show me how to fix it? (I am a newbie in everyhing: Linux, Apache,
Python, MapProxy)

Any help appreciated!

Thanks a lot!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20130417/756b3743/attachment.html>

More information about the MapProxy mailing list