HOWTO install the rjb gem on Ubuntu and Mac OS X

Here’s how to install the Ruby Java Bridge (rjb) gem on Ubuntu Linux and Mac OS X:

Ubuntu Linux (10.10)

# aptitude install openjdk-6-jre-headless openjdk-6-jdk
# JAVA_HOME=/usr/lib/jvm/java-6-openjdk gem install rjb

Mac OS X 10.6.4

# JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home gem install rjb

Note: rjb 1.3.2 requires the Java for Mac OS X 10.6 Update 3 Developer Package. If you don’t want to download it, you can use 1.3.1:

JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home gem install rjb -v=1.3.1

How to install MediaWiki on a subdomain

Here is how to set up MediaWiki on a subdomain and use pretty/short URLs. This was tested on July 1, 2010 with MediaWiki 1.15.4, PHP 5.2.8, MySQL 5.0.90 and Apache 2.2.11.

This assumes you are in a shared hosting situation, and do not have root access and cannot edit the Apache configuration files directly.

Your setup

Suppose you have a site, www.ilikefish.com. Its DocumentRoot is /var/www/ilikefish.com. You then create a subdomain, wiki.ilikefish.com, with a DocumentRoot of /var/www/ilikefish.com/wiki.

Configuring Apache

  1. In /var/www/ilikefish.com/.htaccess, set up a redirect

    RedirectMatch /wiki/(.*) http://wiki.ilikefish.com/$1

  2. In /var/www/ilikefish.com/wiki/.htaccess, set up rewrite rules:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

Configuring MediaWiki

  1. In LocalSettings.php, set the following variables:

    $wgScriptPath = "";
    $wgArticlePath = "/$1";
    $wgUsePathInfo = true;
    $wgLogo = "/my_fish_logo.png";
    $wgScriptExtension = ".php";