[MapProxy] Recipe for deploying MapProxy for production on clean Ubuntu 10.04 LTS embedded in Apache using wsgi

Anne Blankert anne.blankert at geodan.nl
Fri Feb 3 11:15:11 EST 2012


Hi,

Although the MapProxy documentation on 
http://mapproxy.org/documentation.html is quite excellent, it still took 
me quite some time to figure out all details for deploying MapProxy for 
production on a clean Ubuntu 10.04 LTS server embedded in Apache using 
wsgi.

I logged the necessary steps and hope these may be of use for somebody 
else that wants to do the same thing. If you think I missed an important 
configuration step or if you think the following configuration is not 
best practice, please comment.

Anne

Recipe:

#MapProxy installation for deployment on a bare ubuntu 10.04 LTS server
#using wsgi embbedding in apache2
#assumes you have a clean ubuntu 10.04 LTS server and
#a working configuration file 'mapproxy.yaml'

#optional for clones of (virtual) ubuntu machines:
#necessary if your clone does not have a working eth network interface card.
#remove wrong file-stored MAC address of clone original:
#update MAC address with VMWARE NIC wildcard "00:0c:29:*" (or completely 
remove line), then restart OS
#in file /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:0c:29:*", ATTR{dev_id}=="0x0", ATTR{type}=="1", 
KERNEL=="eth*", NAME="eth0"

#optional: add ssh access
sudo apt-get install ssh

#install mapproxy dependencies
sudo apt-get install python-imaging python-yaml libproj0

#optional: remove proj config error in Dutch map projection config 
(EPSG:28992)
#in file /usr/share/proj/epsg
#line for projection <28992> should be:
<28992> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 
+k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel 
+towgs84=565.237,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812 
+units=m +no_defs <>

#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'
mapproxy-util create -t wsgi-app -f /etc/mapproxy.yaml 
/a_path_to_config/config.py

#edit file /etc/apache2/sites-available/default and add lines:
  WSGIScriptAlias /mapproxy /path_to_config/config.py
<Directory /path_to_config/>
           Order deny,allow
           Allow from all
</Directory>

#mapproxy yaml contains paths to cache_directories, allow access for 
apache2 wsgi
sudo chown www-data /path_to_cache
sudo chgrp www-data /path_to_cache

#load configuration into apache by restarting apache
sudo apache2ctl restart

#check if all is fine in a browser:
http://ip_or_hostname_of_ubuntu_server/mapproxy

#if not, inspect apache2 error log at
/var/log/apache2/error.log

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapproxy/attachments/20120203/652f4af0/attachment.html


More information about the MapProxy mailing list