RoboRumble/Set up your own RoboRumble server

From Robowiki
< RoboRumble
Revision as of 15:03, 29 December 2009 by Nat (talk | contribs) (Pavel asked me to write this 3 months ago =P)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Darkcanuck's RoboRumble server is open source, so you can use it to set up your own RoboRumble server. Of course, this is not to creating a competing RoboRumble server to Darkcanuck's currently main server, but you can use it for various purpose, such as setting up RoboRumble server for your students in classes or set up a testing server for yourself. And it doesn't require much resource or effort.

Basic Guide

The server source code is available at http://darkcanuck.net/svn/rumbleserver/trunk. You need an SVN client to check it out.

You also need a MySQL server, version 5.0 or later and PHP 5.2 or later to run it. Apache Web Server is recommended, but it should works on any web server. The only part that rely on Apache is the URL redirectation (i.e. /UploadedResults to upload_results.php), which use Apache's mod_rewrite. You can also use ISAPI_REWRITE or equivalent on IIS, but you have to configure it manually. The redirectation also make it easier to reconfigure the RoboRumble client.

The database structure is located at schema/schema.sql under the root directory. You also have create new user with SELECT, INSERT, UPDATE and DELETE with the database you created for the rumble server.

Next, rename the config.php-sample to config.php. Modified it with your database information.

You should be able to see your Rumble Server by now.

Step-by-step Guide

If you have absolutely no idea what the guide above is, or is confusing with the step, here is the step-by-step guide.

Windows

Setting up Apache, PHP and MySQL on Windows is a painful process, so instead you can download a packed version. Currently, the most famous pack is ApacheFriends XAMPP. So download and install it.

To get the sourcecode of the server, you must have a SVN client. A very good SVN client for Windows is TortoiseSVN, which you can download at http://tortoisesvn.tigris.org/. Install it too.

Now, open Windows Explorer and browse to C:\xampp\htdocs (assuming you install XAMPP to C:\xampp) Config it like this:

Rumbleserver-checkout.jpg

After you finished checking out, open your browser and browse to http://localhost/phpmyadmin/ to access the MySQL server. Default login is root with no password. Create new database rumbleserver or other name you wanted. Use phpMyAdmin's Import feature to import the database structure from C:\xampp\htdocs\rumble\schema\schema.sql. You can create new Database user here, but make sure you grate permission on the database to it.

Now browse to C:\xampp\htdocs\rumble\config and rename config.php-sample to config.php. Then open it edit it like this:

<?php
/******************************************************************************
 * Configuration file  --  Darkcanuck's Roborumble Server
 *
 * This is a sample version only.  Change the data to match your server's
 * credentials and save the file as "config.php"
 *
 * $HeadURL$
 * $Date$
 * $Revision$
 * $Author$
 *
 * Copyright 2008-2009 Jerome Lavigne (jerome@darkcanuck.net)
 * Released under GPL version 3.0 http://www.gnu.org/licenses/gpl-3.0.html
 *****************************************************************************/

$db_creds = array(
    'db'     => 'rumbleserver',
    'user'   => 'root',
    'server' => 'localhost',
    'passwd' => ''
);

Replace rumbleserver with your database name; root with your new username if you created; and the blank password to your new password if you set.

Now point your browser to http://localhost/rumble and you should be able to see your Rumble Server running.

To config your client, simply replace darkcauck.net with locahost in the config file of the client.

Ubuntu

The easiest way to install Apache, PHP and MySQL is to run:

$ sudo tasksel

... and choose LAMP server. If you want to install each package manually, do:

$ sudo apt-get install apache2
$ sudo apt-get install php5 php5-mysql php5-mysqli
$ sudo apt-get install mysql-server mysql-client

You also need to install an SVN client too:

$ sudo apt-get install subversion

Default DocumentRoot directory for Apache under Ubuntu is /var/www, so:

$ cd /var/www
$ svn co http://darkcanuck.net/svn/rumbleserver/trunk rumble

Now it's time to import MySQL database.

$ cd /var/www/rumble/schema
$ mysql -u root -p
mysql> create database rumbleserver;
$ mysql -u root -p rumbleserver < ./schema.sql

Before you can run the server, make sure you have enable mod_rewrite and have set permission correctly:

$ sudo a2enmod rewrite
$ cd /var/www/rumble
$ chmod 777 ./cache
$ chmod 777 ./template_c

Now enjoy the rumble server!