Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.

Etherpad building & installation (using OpenJDK instead of Sun Java JDK)

dermatthias edited this page Sep 13, 2010 · 2 revisions

Etherpad building & installation (using OpenJDK instead of Sun Java JDK)

Tested with Etherpad 1.0.1 on Debian GNU/Linux Lenny (stable) with Scala 2.7.7 backported from Debian GNU/Linux Squeeze (testing).
The original howto can be found here .

Introduction

Etherpad is a web-based collaborative real-time editor.

  • http://etherpad.org/
  • http://github.com/ether/pad
  • http://code.google.com/p/etherpad/

Get the Etherpad code from one of the sites above.

Install dependencies

Install Scala, OpenJDK and the libmysql-java package. You will also need a MySQL server and the m4 macro processor.

On Debian Lenny (stable), the scala package needs to be backported from Squeeze (testing). http://packages.debian.org/scala

This backported package can be found here (Architecture: all) : http://deb.bearstech.com/scala/

aptitude install scala openjdk-6-jdk libmysql-java mysql-server m4

According to the INSTALL recomandation, uninstall the gcj compiler and its libraries.

aptitude remove gcj ‘~nlibgcj’

Hack Etherpad for OpenJDK

Edit the file bin/build.sh and change the paths to match your system. Basicaly, just do a s/sun/openjdk/.

export JAVA_HOME=“/usr/lib/jvm/java-6-openjdk/”
export SCALA_HOME=“/usr/share/java”
export SCALA_LIBRARY_JAR=“/usr/share/java/scala-library.jar”
export MYSQL_CONNECTOR_JAR=“/usr/share/java/mysql-connector-java.jar”
export JAVA=“/usr/lib/jvm/java-6-openjdk/bin/java”
export SCALA=“/usr/bin/scala”
export PATH=“/usr/lib/jvm/java-6-openjdk/bin:$PATH

Use the following workaround to fix the bug with Rhino. http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=179

export JAVA_OPTS=“-Xbootclasspath/p:lib/rhino-js-1.7r1.jar”

Then launch the build : ./bin/build.sh.

Edit the file bin/run.sh and change the paths to match your system. Here also a s/sun/openjdk/ is enough.

export JAVA_HOME=“/usr/lib/jvm/java-6-openjdk/”
export SCALA_HOME=/usr/share/java
export MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
export JAVA=“/usr/lib/jvm/java-6-openjdk/bin/java”
export SCALA=“/usr/bin/scala”
export PATH=“/usr/lib/jvm/java-6-openjdk/bin:$PATH

Use the same workaround for Rhino and add the path of the Scala library.

export JAVA_OPTS=“-Xbootclasspath/p:../infrastructure/lib/rhino-js-1.7r1.jar:/usr/share/java/scala-library.jar”

Customize Etherpad for your system

Edit etherpad/bin/run-local.sh to set a coherent value for the memory usage, for example MXRAM=“256m”.

Copy etherpad/etc/etherpad.localdev-default.properties to etherpad/etc/etherpad.local.properties and edit it to fit your needs. It contains the settings and the passwords for etherpad.

Create the database

Create a MySQL database etherpad, a database user etherpad and grant him all the privileges on his base. You will need a mysql-client and the commands will look like this :

CREATE DATABASE etherpad;
GRANT ALL privileges ON etherpad.* TO "etherpad"@"localhost" IDENTIFIED BY ‘password’;

or

CREATE DATABASE etherpad;
CREATE user "etherpad"@"localhost";
SET PASSWORD FOR ’etherpad’@’localhost’ = PASSWORD;
GRANT ALL ON etherpad.* TO "etherpad"@"localhost";

Launch Etherpad and create a init.d script

Run the ./bin/run.sh.

You can write a /etc/init.d/etherpad or edit the example in debian/etherpad.init. Don’t forget to execute update-rc.d etherpad defaults 99.