OpenStreetBrowser/Install

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — OpenStreetBrowser/Install
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް

This howto should show how to install the new version (branch category) of OpenStreetBrowser. The older format is discouraged, as the newer version has a more flexible design.

We start with a clean Ubuntu installation. It was originally written for a 9.10 installation, some names of the to-installed-software might have changed, e.g. you might want to install postgresql-8.4 now.

System Software

(This instructions are for an Ubuntu 10.04 LTS installation:

sudo apt-get install apache2 vim php5-cli libapache2-mod-php5 php5-pgsql build-essential libxml2-dev libgeos-dev libbz2-dev proj libbz2-dev sun-java6-jre imagemagick python-cssutils imagemagick curl libltdl7-dev proj python-cairo libcairomm-1.0-dev libtiff4-dev mmv apache2-threaded-dev autoconf libboost-dev libboost-system-dev libboost-regex-dev libboost-iostreams-dev libboost-thread-dev libboost-filesystem-dev libboost-program-options-dev python-dev libboost-python1.40.0 unzip libboost-python1.40-dev

See this for installation instructions for PostgreSQL 9.0 with PostGIS 1.5.

In this howto I assume you use the user 'osm' for installation, with the home directory /home/osm .

mkdir software

OSB

git clone git://gitorious.org/openstreetbrowser/openstreetbrowser.git openstreetbrowser
cd openstreetbrowser

Mapnik

PostGIS

File /etc/postgresql/8.3/main/postgresql.conf:

shared_buffers = 16MB # 128MB does not work!
checkpoint_segments = 20
maintenance_work_mem = 256MB

Commands:

su - postgres
createuser osm
createuser -P PASSWD www
createdb -E UTF8 -O osm osm

osm2pgsql

We don't use osm2pgsql any more

Cascadenik

You don't need to install Cascadenik, but there will be a plugin using Cascadenik, so it won't hurt.
cd software
svn checkout http://mapnik-utils.googlecode.com/svn/trunk/ mapnik-utils-read-only  
cd mapnik-utils-read-only/serverside/cascadenik
wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg
mv setuptools-0.6c11-py2.6.egg setuptools-0.6c7-py2.6.egg
sudo python setup.py install

Mapnik

cd software
wget http://download.berlios.de/mapnik/mapnik-0.7.1.tar.bz2
tar xjf mapnik-0.7.1.tar.bz2
cd mapnik-0.7.1/
python scons/scons.py PGSQL_INCLUDES=/usr/include/postgresql PROJ_INCLUDES=/usr/include PROJ_LIBS=/usr/lib XMLPARSER=libxml2
sudo python scons/scons.py install PGSQL_INCLUDES=/usr/include/postgresql PROJ_INCLUDES=/usr/include PROJ_LIBS=/usr/lib XMLPARSER=libxml2

Osmosis

Osmosis changed its database layout with version 0.36. As we are still using the old one use version 0.35.1.

cd software
wget http://dev.openstreetmap.org/~bretth/osmosis-build/osmosis-bin-latest.zip
unzip osmosis-latest-bin.zip
chmod 755 osmosis-0.xx/bin/osmosis
sudo ln -s `pwd`/osmosis-0.xx/bin/osmosis /usr/bin/

mod_tile

cd software
svn co http://svn.openstreetmap.org/applications/utils/mod_tile

edit render_conf.h:

  • HASH_PATH: /osm/tiles/
  • fix MAPNIK-paths
  • generate /etc/renderd.conf

Apply patch to check on changed style file (see [1] for details). Download the patch file from this address.

cd mod_tile
patch -p1 < rerender_updated_style.patch
make
sudo make install
sudo /etc/init.d/apache2 restart

OSB

  • Configure Apache2 (just the paths)
  • Create conf.php from conf.php-dist
  • If you want to import the database from an osm-file, include the plugins "pg_cache" and "osm_import" and set an $osm_import_source to the file.
  • If you want to render the basemap, include the plugin "basemap" and (if you use mod_tile resp. renderd) "renderd". You can find the finished Mapnik style in www/plugins/basemap/base.mapnik

run

bin/init
bin/mcp