How to Install the SplayWeb interface

This tutorial guides you through the installation of SplayWeb, the web-based interface to the Splay controller, to deploy your experiments over a Splay testbed. You can already test an instance of SplayWeb here.

Note that the instructions in this tutorial are for systems based on apt-get for package management (e.g., ubuntu or debian). If you need to use another OS replace the apt-get install by the corresponding one for your system (e.g., port install for MacOS X)

A. Install required dependencies

SplayWeb depends on RubyGems and Ruby on Rails 2.1.0:
sudo apt-get install rubygems
sudo gem install -v=2.1.0 rails

B. Download SplayWeb

Download the latest release of SplayWeb. In the remainder of this tutorial, we assume a simple configuration where the SplayController, the MySql database and the SplayWeb are installed on the same physical machine. It is possible to distribute these 3 components on several machines for load-balancing, by properly configuring the MySql access policy.

The latest SplayWeb release is available here. Unzip it to a drive on the same machine where the SplayController runs.

C. SplayWeb Configuration

If you used the default settings during the SplayController installation, you can skip this step. Edit the file config/database.yml:
development:
  adapter: mysql
  database: splay
  username: splay
  password: splay
  host: localhost

D. Start SplayWeb

Go in the directory where you unzipped the SplayWeb release and start it:
~/splayweb_1.0$ ruby script/server -p8080
=> Booting WEBrick...
=> Rails 2.1.0 application started on http://0.0.0.0:80
=> Ctrl-C to shutdown server; call with --help for options
[2010-12-17 16:27:29] INFO  WEBrick 1.3.1
[2010-12-17 16:27:29] INFO  ruby 1.8.7 (2010-06-23) [i686-linux]
[2010-12-17 16:27:29] INFO  WEBrick::HTTPServer#start: pid=1626 port=8080
It is possible to use Mongrel as alternative web-server for SplayWeb. To do so, you can install it via rubygems, and start it with the following commands:
sudo gem install mongrel
sudo ruby script/server mongrel -p 80
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.1.0 application starting on http://0.0.0.0:80
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:80
** Starting Rails with development environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).
** Rails signals registered.  HUP => reload (without restart).  It might not work well.
** Mongrel 1.1.5 available at 0.0.0.0:80
** Use CTRL-C to stop.

E. Test your SplayWeb

To test your SplayWeb installation, point your browser to http://www.your-splayweb.com:8080. If everything worked fine, you should get a similar welcome message as there (note that the map representation will not display anything unless you set up the geo-localization feature as explained in the next step).

F. (Optional) Activate Geo-Localization

By default, the geo-localization feature is not activated. You can always use the Splay Controller and the SplayWeb interface without this feature. If you want to use this feature, you will need to perform the following operations:
  1. Install the required geoip library via rubygem:
    sudo gem install geoip
    
  2. Download the geographical database required by the geoip library. This database is available at this address. Uncompress this file into the controller/lib directory in the Splay Controller installation directory.
  3. Activate the geo-localization feature in the Splay Controller, by editing the file lib/config.rb and set Localize = true. Remember to reinitialize your splay database executing the script init_db.rb and to re-start your controller.
  4. In the SplayWeb distribution, edit the file app/controllers/splay_controller.rb and change the value of google_key with your Google Map key. You can signup for a Google Map key here