Using the dev server
From OpenStreetMap
<attention>
Due a problem in mod_ruby, it is not recommended to use the development server with modified ruby scripts until the problem is fixed.
Do not use the dev server with any modified scripts beside the stable API version.
The Problem is, that only one instance of mod_ruby exist and different interpreters on the same machine interact with each other. The ruby server currently makes heavy use of global object instances (singletons) which are defined differently in different API versions.
So if you are running a different version than the stable API, other user instances can interact with your scripts and everything will blow up in a mess.
</attention>
Note for above: I will leave these settings as-is until we have the rails port live. Nobody should be developing against the current (non-rails) API. NickH FIXME:The Rails Port went live yonks ago. Does any of this warning still appply?
This page is to help OSM developers get up and running with a dev server account. Please update with stuff.
Contents |
What is a dev account?
Rather than install a database, apache, ruby... and all that stuff to work on OpenStreetMap there is a dev server with it all available to you to Develop and hack on from anywhere on the megawebnet.
WARNING: The dev server is not a complete implementation of OSM just yet. There are several strings with 'www.openstreetmap.org' in src files than need to be changed to $SERVER_NAME, and the tile generation stuff is not there. Please fix those and then this paragraph.
The Dev machine tracks the package versions in Debian testing. Major packages are updated from time to time. This will help ensure development packages remain compatible with recent software releases, and enable development against the newest and greatest software. On the other hand, expect packages to break!
Get an account
Mail User:Spaetz for a user, mysql and svn account, then login using ssh.
For Windows users, the Putty SSH Client is available at PuTTY download or if you prefer a command line ssh try the OpenSSH version from Cygwin
The server is at dev.openstreetmap.org
Getting up and running
Get the source repository
svn co http://svn.openstreetmap.org/
Server details
Your deployed site needs to be able to, for example, talk to the database. Do this
cd ~/svn/ruby/api/osm cp servinfo.rb-CHANGEME servinfo.rb
Now edit servinfo.rb. database server should be localhost. SERVER_NAME should be USERNAME.dev.openstreetmap.org
Note: This file is no longer in SVN since the rails port went active, however some old scripts still use it. Here's an example file:
$DBSERVER = 'localhost' $DATABASE= 'osm' $USERNAME = 'user' $PASSWORD = 'pass' $SERVER_NAME = 'myserver'
Building stuff
To build and deploy, get your install_www script from http://svn.openstreetmap.org/script/install_www (broken link :-() and:
cd ~/svn bash install_www USERNAME
If the applet doesn't build, it's probably due to missing JARs - either go find the dependendent jars (note that plugin.jar (from jre/lib) is needed for compile, but not deploy):
OSMApplet.jar commons-codec-1.3.jar core.jar commons-logging.jar commons-httpclient-3.0-rc3.jar MinML2.jar thinlet.jar plugin.jar
Or comment out the 3 lines calling ant to build the applet.
Your stuff is now deployed in /var/www/USERNAME and is available at http://USERNAME.dev.openstreetmap.org/ for testing.
Hostname
Thanks to the magic of wildcard DNS, you no longer need to set a hostname to view your site.
Create an account
Now navigate to your server, USERNAME.dev.openstreetmap.org, and you should be able to create an account and start hacking.
Debugging
tail -f /var/log/apache2/dev.USERNAME.error.log
Questions about the dev server
Where will require be loaded from? When I do a require 'osm/servinfo.rb', I get a servinfo containing nicks values and not mine.
- I suspect this might be a mod_ruby problem but I'm not sure. David.
Accessing the OSM database with the dev server
As of writing this, planet.osm version 060917 is available through the MySQL server running on dev with current schema. This does not currently include GPS points. select queries only with the following credentials: (NickH 18:05, 22 September 2006 (BST))
$DBSERVER = 'localhost' $DATABASE= 'openstreetmap' $USERNAME = 'dev-planet-user' $PASSWORD = 'dev-planet-user' $SERVER_NAME = 'dev'
To get going, you can try
mysql -udev-planet-user -pdev-planet-user openstreetmap
->SHOW TABLES; ->SELECT * FROM current_nodes LIMIT 10;

