Setting up a test server/0.3

From OpenStreetMap

Jump to: navigation, search

People developing the OSM server code, may well be interested in setting up a server on their own machine at home. If you want to use the preconfigured test server, you may want to read Using the dev server instead.

For any help beyond this page, please call user:Imi for help.

Under NO circumstances ever upload anything to the main OSM server that you have taken from an test server! The id generation will confuse both servers and the world will end in a mess.

Contents

Get all the packages

You need several packages. For Debian based distributions, install this:

  • ruby
  • eruby
  • mysql-server
  • mysql-client
  • apache2
  • apache2-modules
  • libapache2-mod-ruby
  • libxml-ruby
  • libmysql-ruby

OS X notes

  • build from source if you can, rather than relying on Fink or DarwinPorts:
  • Apache2
    • will build from source.
      • Install all needed modules: See: support/www.openstreetmap.org/apache-modules.txt.
      • Compile: sudo ./configure --enable-mods-shared=most --enable-proxy should probably work.
  • Ruby
    • Ruby
    • eruby
    • mod_ruby
      • the above three will build from source, but do not set --enable-shared when configuring.
      • Point mod_ruby to your apache2 installation, like this: ruby configure.rb --prefix=/usr/local/apache2/ --with-apxs=/usr/local/apache2/bin/apxs.
    • This modRuby on ruby181 guide is a helpful guide, but again, do not --enable-shared
  • Ruby XML and MySQL libraries

Setup Apache

  • Getting The Source.
  • change www.openstreetmap.org/ruby/api/osm/servinfo.rb if you prefer not to access mysql as root.

Debian notes

  • copy support/www.openstreetmap.org/openstreetmap-apache-conf to your apache site-config dir /etc/apache2/sites-available. Then modify it to your needs and link to it from /etc/apache2/site-enabled. This is usually done by creating a symbolic link. One way to do this is to cd to the sites-enabled directory and then:

user@box:/etc/apache2/sites-enabled$ ln -s /etc/apache2/sites-available/openstreetmap-apache-conf


  • point your document root in the new /etc/apache2/sites-available/openstreetmap-apache-conf to the www.openstreetmap.org subdirectory. (Replace all other occourences of /var/www too).

OS X notes

  • paste the appropriate section from the openstreetmap-apache-conf into conf/httpd.conf and configure accordingly
  • enable all apache modules listed in support/www.openstreetmap.org/apache-modules.txt
  • restart your apache. Check the log in /var/log/apache2/error.log for problems.
  • access your own server via http://localhost/
  • register yourself in your testserver via the web-frontend ;-)
    • (if this gives an error, check that sendmail can access port 25)

Setup MySql

I assume that you used the original provided servinfo.rb. This assumes, especially, that your database is called osm and your username is root.

  • Become root
  • Create the database with: mysqladmin create osm
  • Import the schema from sql directory, using: mysql osm < sql/mysql-schema.sql

If you want to have real OSM data in your database:

  • Download planet.osm
  • Navigate to the utils/planet.osm/perl/ directory
  • Edit planetosm-to-db.pl to include your database user ID, password, host etc.
  • perl planetosm-to-db.pl /path/to/your/planet.osm

Build the applet

If you want the applet in your testserver, do the following in addition to the steps above:

  • install java (e.g. package sun-java5-jre from deb http://ftp.debian-unofficial.org/debian/ stable non-free
  • install ant (package ant)
  • make sure your JAVA_HOME is set correctly (e.g. to /usr/lib/jvm/java-1.5.0-sun-1.5.0.06)
  • build the applet, calling ant within the java subdirectory
  • cp java/dist/*.jar www.openstreetmap.org/


Test your installation

User:Imi is working on a script called testserver.rb to verify the integrity and conformity of an server.

Personal tools
recent changes