<div dir="ltr"><div><div><div>Hi list,<br><br></div>I am a newbie finding ways to implement MapProxy as a tile cache server.<br>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: <a href="http://lists.osgeo.org/pipermail/mapproxy/2012-February/000976.html">http://lists.osgeo.org/pipermail/mapproxy/2012-February/000976.html</a> (I added some twists to the instruction).<br>
</div><br></div><b>*** My configuration file (mapproxy.yaml):</b><br><div>services:<br>  demo:<br>  wmts:<br><br>sources:<br>  gm:<br>    type: tile<br>    url: <a href="http://mt0.google.com/vt/lyrs=m@0&hl=en&x=%(x)s&y=%(y)s&z=%(z)s">http://mt0.google.com/vt/lyrs=m@0&hl=en&x=%(x)s&y=%(y)s&z=%(z)s</a><br>
    grid: gm_grid<br><br>grids:<br>  gm_grid:<br>    base: GLOBAL_MERCATOR<br>    origin: ul<br><br>caches:<br>  gm_cache:<br>    grids: [gm_grid]<br>    sources: [gm]<br>    cache_dir: /etc/mapproxy/cached_tiles<br>    cache:<br>
      type: file<br>      directory_layout: tc<br><br>layers:<br>  - name: layer<br>    title: tiles<br>    sources: [gm_cache]<br><br><b>*** My installation process:</b><br>#On a Debian or Ubuntu system, you need to install the following packages:<br>
    sudo apt-get install python-imaging python-yaml libproj0<br>#To get all optional packages:<br>    sudo apt-get install libgeos-dev python-lxml libgdal-dev python-shapely<br>#install easy_install<br>    sudo apt-get install python-setuptools<br>
#install pip<br>    sudo easy_install pip<br>#install mapproxy<br>    sudo pip install MapProxy<br>#copy an existing configuration to /etc/mapproxy.yaml<br>    sudo cp mapproxy.yaml /etc/mapproxy.yaml<br>#install apache<br>
    sudo apt-get install apache2<br>#install mod-wsgi on apache2<br>    sudo apt-get install libapache2-mod-wsgi<br>#create wsgi python application file 'config.py'<br>    sudo mapproxy-util create -t wsgi-app -f /etc/mapproxy.yaml /etc/mapproxy/config.py<br>
#edit file /etc/apache2/sites-available/default<br>    sudo gedit /etc/apache2/sites-available/default<br>#add lines:<br>    WSGIScriptAlias /mapproxy /path_to_config/config.py<br>    <Directory /path_to_config/><br>
        Order deny,allow<br>        Allow from all<br>    </Directory><br>#mapproxy yaml contains paths to cache_directories, allow access for apache2 wsgi<br>    sudo chown www-data /etc/mapproxy/cached_tiles<br>    sudo chgrp www-data /etc/mapproxy/cached_tiles<br>
#load configuration into apache by restarting apache<br>    sudo apache2ctl restart<br><br></div><div><b>*** Problem:</b><br></div><div>When I run the develop server from the terminal: sudo mapproxy-util serve-develop /etc/mapproxy.yaml<br>
and access the web page locally (<a href="http://127.0.0.1:8080/demo/?wmts_layer=layer&format=%3Cbuilt-in%20function%20format%3E&srs=EPSG%3A900913">http://127.0.0.1:8080/demo/?wmts_layer=layer&format=%3Cbuilt-in%20function%20format%3E&srs=EPSG%3A900913</a>)<br>
</div><div>everything was fine.<br></div><div>When I access "<a href="http://ip_of_ubuntu_server/mapproxy">http://ip_of_ubuntu_server/mapproxy</a>" from another computer, the map was loaded with already cached tiles only, <b>all new tiles (uncached) won't display</b>.<br>
<br></div><div>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)<br><br></div><div>Any help appreciated!<br><br>
Thanks a lot!<br></div></div>