Etherpad

Differences between revisions 1 and 19 (spanning 18 versions)
Revision 1 as of 2009-12-19 15:07:35
Size: 2162
Editor: pool-96-243-197-55
Comment:
Revision 19 as of 2010-03-24 17:20:26
Size: 5811
Editor: vie-078-142-167-053
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
sudo apt-get install sun-java6-jdk scala libmysql-java Install pre-requisite packages for getting and building Etherpad.

{{{
sudo apt-get install sun-java6-jdk scala mysql-server mysql-client libmysql-java mercurial
}}}

Etherpad will not build or run with openjdk-6-jdk or openjdk-6-jre. It also is best to use Sun's jar since fastjar seems to have some issues.

If you get this error:
{{{
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate
}}}
Checkout /etc/apt/sources.list and add this line if missing:
{{{
deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
}}}
Then
{{{
apt-get update
}}}
and try again.

It is necessary to ensure that the server's host name is in the /etc/hosts for the IP 127.0.0.1 . If this is not there you will have a compile time error like this :

"Unable to establish connection to compilation daemon
       Compilation failed."

Furthermore, it might be necessary to tell Ubuntu to switch from OpenJDK to Sun’s Java:
{{{
update-java-alternatives -s java-6-sun
}}}
Line 9: Line 42:

There are no releases of Etherpad at the moment, so we grab directly from mercurial.
Line 14: Line 49:
You will need to patch the etherpad code to build on Ubuntu: If you are running this command from behind an office firewall, you might run into a bug in Python for HTTPS from behind a proxy (http://bugs.python.org/issue1424152). Clone from the http URL instead.

{{{
hg clone http://etherpad.googlecode.com/hg/ etherpad
}}}

You might want to patch the etherpad code to build on Ubuntu:
The description below shows the difference between the original file and changes, leading + shows where lines are added or changed. This example show two changes to trunk/infrastructure/bin/makejar.sh, both removing /lib from a path.
Line 35: Line 77:
(As of Dec. 23, 2009 the patching instructions above are either incomplete or do not provide any explanation on what to do. Typing the first command directly into the command line produces a "not found" error. Please revise these instructions to be more clear in a step-by-step fashion rather than assuming a user should know what to do.) Yes and Update would be nice :)

What these patching instructions means is to edit the file (for example : trunk/infrastructure/bin/makejar.sh )
and find the lines starting with a - and replace them with the line starting with a +. If there's only a line with a +, that means add that line to where it is shown in the file.

Alternatively (and to avoid modifying the source file), you could use a symbolic link pointing to the desired directory:
{{{
ln -s /usr/share/java /tmp/lib
export SCALA_HOME=/tmp
}}}

If your mysql was updated you may need to restart mysql now.
Line 44: Line 99:
+ 'growingupfree.org': true,
+ 'quinncoincorporated.org': true,
+ 'yourdomain.com': true,
+ 'yourdomain.org': true,
Line 49: Line 104:
Line 52: Line 108:
#!sh
export JAVA_HOME=/usr/lib/jvm/java-6-sun/
export SCALA_HOME=/usr/share/java
export MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
$ export JAVA_HOME=/usr/lib/jvm/java-6-sun
$ export JAVA="$JAVA_HOME/bin/java"
$
export SCALA_HOME=/usr/share/java    # or =/tmp – see above
$ export SCALA="$SCALA_HOME/bin/scala" # Shouldn’t it be =/usr/bin/scala ?
$ export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:$PATH"
$
export MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
Line 57: Line 115:
Line 60: Line 119:
Set the variable "mysql" in the db setup script, to the name of your mysql client executable.
Line 61: Line 122:
#!sql
INSERT INTO `user` VALUES ('localhost','etherpad','YOUR_PASSWORD_HASH','N','N','N','N','N','N','N','N','N','N',
'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0);
diff -r 81287c8af1ac -r 5ea3ba9d10f7 trunk/etherpad/bin/setup-mysql-db.sh
--- a/trunk/etherpad/bin/setup-mysql-db.sh Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/etherpad/bin/setup-mysql-db.sh Sun Dec 20 15:53:08 2009 +0530
@@ -19,6 +19,7 @@
   exit 1
 fi
 
+mysql="mysql"
 db="etherpad"
 
 echo "Creating etherpad ${db}..."
}}}
Line 65: Line 135:
INSERT INTO `db` VALUES ('localhost','etherpad','etherpad','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y') Alternatively, you also could simply enter {{{export mysql=/usr/bin/mysql}}} without editing the source file.

Run the db setup script.

{{{
#!sh
$ cd trunk/etherpad
$ sudo bin/setup-mysql-db.sh
}}}

Note if you had setup a password for the root account on the mysql server, then this won't work directly. You can edit the setup-mysql-db.sh as needed to fix this. For example (there are two instances of this in the file)

{{{
- echo "create database ${db};" | ${mysql} -u root
+ echo "create database ${db};" | ${mysql} --user=root --password=secret
#and same for the other instances of ${mysql}
}}}

Alternatively, you could setup your ~/.my.cnf accordingly:
{{{
[client]
user = root
password = secret

Install packages

Install pre-requisite packages for getting and building Etherpad.

sudo apt-get install sun-java6-jdk scala mysql-server mysql-client libmysql-java mercurial

Etherpad will not build or run with openjdk-6-jdk or openjdk-6-jre. It also is best to use Sun's jar since fastjar seems to have some issues.

If you get this error:

Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate

Checkout /etc/apt/sources.list and add this line if missing:

deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse

Then

apt-get update

and try again.

It is necessary to ensure that the server's host name is in the /etc/hosts for the IP 127.0.0.1 . If this is not there you will have a compile time error like this :

"Unable to establish connection to compilation daemon

  • Compilation failed."

Furthermore, it might be necessary to tell Ubuntu to switch from OpenJDK to Sun’s Java:

update-java-alternatives -s java-6-sun

Get Etherpad code

There are no releases of Etherpad at the moment, so we grab directly from mercurial.

hg clone https://etherpad.googlecode.com/hg/ etherpad

If you are running this command from behind an office firewall, you might run into a bug in Python for HTTPS from behind a proxy (http://bugs.python.org/issue1424152). Clone from the http URL instead.

hg clone http://etherpad.googlecode.com/hg/ etherpad

You might want to patch the etherpad code to build on Ubuntu: The description below shows the difference between the original file and changes, leading + shows where lines are added or changed. This example show two changes to trunk/infrastructure/bin/makejar.sh, both removing /lib from a path.

diff -r 81287c8af1ac trunk/infrastructure/bin/makejar.sh
--- a/trunk/infrastructure/bin/makejar.sh       Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/infrastructure/bin/makejar.sh       Sat Dec 19 09:50:05 2009 -0500
@@ -32,11 +32,11 @@
 
 TMPSTORE=/tmp/ajbuild-tmpstore-`date +%s`
 
-JARFILES=`echo $SCALA_HOME/lib/scala-library.jar lib/*.jar lib/manifest`
+JARFILES=`echo $SCALA_HOME/scala-library.jar lib/*.jar lib/manifest`
 function genjar {
     echo "unzipping JARs..."
     pushd $1 >> /dev/null
-    $JAR xf $SCALA_HOME/lib/scala-library.jar
+    $JAR xf $SCALA_HOME/scala-library.jar
     rm -rf META-INF
     for a in ../../lib/*.jar; do
        $JAR xf $a

(As of Dec. 23, 2009 the patching instructions above are either incomplete or do not provide any explanation on what to do. Typing the first command directly into the command line produces a "not found" error. Please revise these instructions to be more clear in a step-by-step fashion rather than assuming a user should know what to do.) Yes and Update would be nice Smile :)

What these patching instructions means is to edit the file (for example : trunk/infrastructure/bin/makejar.sh ) and find the lines starting with a - and replace them with the line starting with a +. If there's only a line with a +, that means add that line to where it is shown in the file.

Alternatively (and to avoid modifying the source file), you could use a symbolic link pointing to the desired directory:

ln -s /usr/share/java /tmp/lib
export SCALA_HOME=/tmp

If your mysql was updated you may need to restart mysql now.

Be sure to add you domain to the list of SUPERDOMAINs:

diff -r 81287c8af1ac trunk/etherpad/src/etherpad/globals.js
--- a/trunk/etherpad/src/etherpad/globals.js    Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/etherpad/src/etherpad/globals.js    Sat Dec 19 09:50:05 2009 -0500
@@ -29,6 +29,8 @@
 var SUPERDOMAINS = {
   'localbox.info': true,
   'localhost': true,
+  'yourdomain.com': true,
+  'yourdomain.org': true,
   'etherpad.com': true
 };

Configure Environment

$ export JAVA_HOME=/usr/lib/jvm/java-6-sun
$ export JAVA="$JAVA_HOME/bin/java"
$ export SCALA_HOME=/usr/share/java    # or =/tmp – see above
$ export SCALA="$SCALA_HOME/bin/scala" # Shouldn’t it be =/usr/bin/scala ?
$ export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:$PATH"
$ export MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar

Configure MySQL

Set the variable "mysql" in the db setup script, to the name of your mysql client executable.

diff -r 81287c8af1ac -r 5ea3ba9d10f7 trunk/etherpad/bin/setup-mysql-db.sh
--- a/trunk/etherpad/bin/setup-mysql-db.sh      Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/etherpad/bin/setup-mysql-db.sh      Sun Dec 20 15:53:08 2009 +0530
@@ -19,6 +19,7 @@
   exit 1
 fi
 
+mysql="mysql"
 db="etherpad"
 
 echo "Creating etherpad ${db}..."

Alternatively, you also could simply enter export mysql=/usr/bin/mysql without editing the source file.

Run the db setup script.

$ cd trunk/etherpad
$ sudo bin/setup-mysql-db.sh

Note if you had setup a password for the root account on the mysql server, then this won't work directly. You can edit the setup-mysql-db.sh as needed to fix this. For example (there are two instances of this in the file)

- echo "create database ${db};" | ${mysql} -u root
+ echo "create database ${db};" | ${mysql} --user=root --password=secret
#and same for the other instances of ${mysql}

Alternatively, you could setup your ~/.my.cnf accordingly:

[client]
user = root
password = secret

Compiling Etherpad

From trunk/etherpad:

$ bin/rebuildjar.sh

Running Etherpad

$ bin/run-local.sh

Etherpad (last edited 2012-02-15 09:24:13 by 135)