<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
Although the MapProxy documentation on
<a class="moz-txt-link-freetext" href="http://mapproxy.org/documentation.html">http://mapproxy.org/documentation.html</a> 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. <br>
<br>
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.<br>
<br>
Anne<br>
<br>
Recipe:<br>
<br>
#MapProxy installation for deployment on a bare ubuntu 10.04 LTS
server<br>
#using wsgi embbedding in apache2<br>
#assumes you have a clean ubuntu 10.04 LTS server and <br>
#a working configuration file 'mapproxy.yaml'<br>
<br>
#optional for clones of (virtual) ubuntu machines:<br>
#necessary if your clone does not have a working eth network
interface card.<br>
#remove wrong file-stored MAC address of clone original:<br>
#update MAC address with VMWARE NIC wildcard "00:0c:29:*" (or
completely remove line), then restart OS<br>
#in file /etc/udev/rules.d/70-persistent-net.rules<br>
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:0c:29:*", ATTR{dev_id}=="0x0", ATTR{type}=="1",
KERNEL=="eth*", NAME="eth0"<br>
<br>
#optional: add ssh access<br>
sudo apt-get install ssh<br>
<br>
#install mapproxy dependencies<br>
sudo apt-get install python-imaging python-yaml libproj0<br>
<br>
#optional: remove proj config error in Dutch map projection config
(EPSG:28992)<br>
#in file /usr/share/proj/epsg<br>
#line for projection <28992> should be:<br>
<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 <> <br>
<br>
#install easy_install<br>
sudo apt-get install python-setuptools<br>
<br>
#install pip<br>
sudo easy_install pip<br>
<br>
#install mapproxy<br>
sudo pip install MapProxy<br>
<br>
#copy an existing configuration to /etc/mapproxy.yaml<br>
sudo cp mapproxy.yaml /etc/mapproxy.yaml<br>
<br>
#install apache<br>
sudo apt-get install apache2<br>
<br>
#install mod-wsgi on apache2<br>
sudo apt-get install libapache2-mod-wsgi<br>
<br>
#create wsgi python application file 'config.py'<br>
mapproxy-util create -t wsgi-app -f /etc/mapproxy.yaml
/a_path_to_config/config.py<br>
<br>
#edit file /etc/apache2/sites-available/default and 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>
<br>
#mapproxy yaml contains paths to cache_directories, allow access for
apache2 wsgi<br>
sudo chown www-data /path_to_cache<br>
sudo chgrp www-data /path_to_cache<br>
<br>
#load configuration into apache by restarting apache<br>
sudo apache2ctl restart<br>
<br>
#check if all is fine in a browser:<br>
<a class="moz-txt-link-freetext" href="http://ip_or_hostname_of_ubuntu_server/mapproxy">http://ip_or_hostname_of_ubuntu_server/mapproxy</a><br>
<br>
#if not, inspect apache2 error log at<br>
/var/log/apache2/error.log<br>
<br>
<div class="moz-signature"><span class="Apple-style-span"
style="color: rgb(0, 0, 0); font-family: 'Times New Roman';
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); font-size: medium; "> </span>
</div>
</body>
</html>