success on Ubuntu 9.04 server

93 views
Skip to first unread message

Tom

unread,
Dec 19, 2009, 12:31:55 PM12/19/09
to EtherPad Open Source Discussion
HOWTO for Ubuntu 9.04 server:

apt-get install sun-java6-jre scala mysql-server-5.1 libmysql-java
adduser --system etherpad
su - etherpad
cd /home/etherpad/
hg clone https://etherpad.googlecode.com/hg/ etherpad
mv etherpad/.hg etherpad/trunk .
# create virtual scala home
mkdir scala
cd scala
ln -s /usr/bin
ln -s /usr/share/java lib
cd ..
export JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.16/"
export SCALA_HOME="/home/etherpad/trunk/etherpad/scala"
export JAVA="/usr/lib/jvm/java-6-sun-1.6.0.16//bin/java"
export SCALA="/home/etherpad/trunk/etherpad/scala/bin/scala"
export MYSQL_CONNECTOR_JAR="/usr/share/java/mysql-connector-
java-5.1.6.jar"
mysql="mysql -p" bin/setup-mysql-db.sh
bin/rebuildjar.sh
# first test on http://localhost:9000
bin/run-local.sh

then replace $mailhost, adminpassword, mysqlpassword, myserver,
mydomain
in the following patch and apply

patch -p1 < etherpad.diff

diff -r 81287c8af1ac trunk/etherpad/etc/etherpad.localdev-
default.properties
--- a/trunk/etherpad/etc/etherpad.localdev-default.properties Fri Dec
18 18:44:23 2009 +1100
+++ b/trunk/etherpad/etc/etherpad.localdev-default.properties Sat Dec
19 18:06:51 2009 +0100
@@ -1,14 +1,16 @@
ajstdlibHome = ../infrastructure/framework-src/modules
appjetHome = ./data/appjet
-devMode = true
-etherpad.adminPass = password
+devMode = false
+smtpServer = $mailhost:25
+etherpad.adminPass = $adminpassword
etherpad.fakeProduction = false
-etherpad.isProduction = false
+etherpad.isProduction = True
etherpad.SQL_JDBC_DRIVER = com.mysql.jdbc.Driver
etherpad.SQL_JDBC_URL = jdbc:mysql://localhost:3306/etherpad
-etherpad.SQL_PASSWORD = password
+etherpad.SQL_PASSWORD = $mysqlpassword
etherpad.SQL_USERNAME = etherpad
listen = 9000
+listenSecure = 9001
logDir = ./data/logs
modulePath = ./src
transportPrefix = /comet
diff -r 81287c8af1ac trunk/etherpad/src/etherpad/control/
global_pro_account_control.js
--- a/trunk/etherpad/src/etherpad/control/
global_pro_account_control.js Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/etherpad/src/etherpad/control/
global_pro_account_control.js Sat Dec 19 18:06:51 2009 +0100
@@ -125,7 +125,7 @@
response.redirect(_recoverLink(accountList[0], domainList[0]));
}
if (accountList.length > 1) {
- var fromAddr = '"EtherPad Support" <sup...@etherpad.com>';
+ var fromAddr = '"EtherPad Support" <etherpad@$mydomain>';
var subj = "EtherPad: account information";
var body = renderTemplateAsString(
'pro/account/global-multi-domain-recover-email.ejs', {
diff -r 81287c8af1ac trunk/etherpad/src/etherpad/control/pad/
pad_control.js
--- a/trunk/etherpad/src/etherpad/control/pad/pad_control.js Fri Dec
18 18:44:23 2009 +1100
+++ b/trunk/etherpad/src/etherpad/control/pad/pad_control.js Sat Dec
19 18:06:51 2009 +0100
@@ -661,7 +661,7 @@
{toEmails: toEmails, padId: padId, username: username,
subject: subject, message: message});

- var fromAddr = '"EtherPad" <nor...@etherpad.com>';
+ var fromAddr = '"EtherPad" <etherpad@$mydomain>';
// client enforces non-empty subject and message
var subj = '[EtherPad] '+subject;
var body = renderTemplateAsString('email/padinvite.ejs',
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 18:06:51 2009
+0100
@@ -27,12 +27,13 @@
}

var SUPERDOMAINS = {
- 'localbox.info': true,
+ //'localbox.info': true,
'localhost': true,
- 'etherpad.com': true
+ '$myserver': true
+ //'etherpad.com': true
};

-var PNE_RELEASE_VERSION = "1.1.3";
+var PNE_RELEASE_VERSION = "1.1.3my";
var PNE_RELEASE_DATE = "June 15, 2009";

var PRO_FREE_ACCOUNTS = 1e9;
diff -r 81287c8af1ac trunk/etherpad/src/etherpad/pro/pro_utils.js
--- a/trunk/etherpad/src/etherpad/pro/pro_utils.js Fri Dec 18 18:44:23
2009 +1100
+++ b/trunk/etherpad/src/etherpad/pro/pro_utils.js Sat Dec 19 18:06:51
2009 +0100
@@ -145,11 +145,11 @@
}

function getEmailFromAddr() {
- var fromDomain = 'etherpad.com';
+ var fromDomain = '$mydomain';
if (pne_utils.isPNE()) {
fromDomain = getFullProDomain();
}
- return ('"EtherPad" <noreply@'+fromDomain+'>');
+ return ('"EtherPad" <etherpad@'+fromDomain+'>');
}

function renderGlobalProNotice() {
diff -r 81287c8af1ac trunk/etherpad/src/main.js
--- a/trunk/etherpad/src/main.js Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/etherpad/src/main.js Sat Dec 19 18:06:51 2009 +0100
@@ -269,7 +269,7 @@
}

// redirect to etherpad.com
- var newurl = "http://etherpad.com"+request.path;
+ var newurl = "http://$myserver"+request.path;
if (request.query) { newurl += "?"+request.query; }
response.redirect(newurl);
}
diff -r 81287c8af1ac trunk/etherpad/src/static/crossdomain.xml
--- a/trunk/etherpad/src/static/crossdomain.xml Fri Dec 18 18:44:23
2009 +1100
+++ b/trunk/etherpad/src/static/crossdomain.xml Sat Dec 19 18:06:51
2009 +0100
@@ -5,6 +5,6 @@
<allow-http-request-headers-from domain="*" headers="*"/>
<allow-access-from domain="*.tokbox.com" to-ports="*"/>
<allow-access-from domain="tokbox.com" to-ports="*"/>
-<allow-access-from domain="*.etherpad.com" to-ports="*"/>
-<allow-access-from domain="etherpad.com" to-ports="*"/>
+<allow-access-from domain="*.$myserver" to-ports="*"/>
+<allow-access-from domain="$myserver" to-ports="*"/>
</cross-domain-policy>

--------------------------------------------------------------------------------

copy etc/etherpad.localdev-default.properties to
data/etherpad.local.properties

and install the startup script in /etc/init.d:

#! /bin/sh
### BEGIN INIT INFO
# Provides: etherpad
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/src/
NAME=etherpad
DESC="etherpad server"
DIR=/home/etherpad/trunk/etherpad

set -e

case "$1" in
start)
cd $DIR
mkdir -p data/appjet

MXRAM="1G"
CP="appjet-eth-dev.jar:data"
for f in lib/*.jar; do
CP="$CP:$f"
done
# etherpad properties file
cfg_file=./data/etherpad.local.properties
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet -d $DIR --pidfile /var/run/
$NAME.pid --chuid etherpad --background -m \
--exec /usr/bin/java -- -classpath $CP \
-server \
-Xmx${MXRAM} \
-Xms${MXRAM} \
-Djava.awt.headless=true \
-XX:MaxGCPauseMillis=500 \
-XX:+UseConcMarkSweepGC \
-XX:+CMSIncrementalMode \
-XX:CMSIncrementalSafetyFactor=50 \
-XX:+PrintGCDetails \
-XX:+PrintGCTimeStamps \
-Xloggc:./data/logs/backend/jvm-gc.log \
-Dappjet.jmxremote=true \
net.appjet.oui.main \
--configFile=${cfg_file}
echo "$NAME."
;;

stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --oknodo --user etherpad --
retry 5 \
--pidfile /var/run/$NAME.pid 2>&1 > /dev/null
echo "$NAME."
;;
reload)
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0


Apurva

unread,
Dec 19, 2009, 3:47:41 PM12/19/09
to EtherPad Open Source Discussion
What about SSL setup ?


On Dec 19, 10:31 pm, Tom <thomas.tan...@gmail.com> wrote:
> HOWTO for Ubuntu 9.04 server:
>
> apt-get install sun-java6-jre scala  mysql-server-5.1 libmysql-java
> adduser --system etherpad
> su - etherpad
> cd /home/etherpad/
> hg clonehttps://etherpad.googlecode.com/hg/etherpad
> mv etherpad/.hg etherpad/trunk .
> # create virtual scala home
> mkdir scala
> cd scala
> ln -s /usr/bin
> ln -s /usr/share/java lib
> cd ..
> export JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.16/"
> export SCALA_HOME="/home/etherpad/trunk/etherpad/scala"
> export JAVA="/usr/lib/jvm/java-6-sun-1.6.0.16//bin/java"
> export SCALA="/home/etherpad/trunk/etherpad/scala/bin/scala"
> export MYSQL_CONNECTOR_JAR="/usr/share/java/mysql-connector-
> java-5.1.6.jar"
> mysql="mysql -p"  bin/setup-mysql-db.sh
> bin/rebuildjar.sh

> # first test onhttp://localhost:9000

> -    var fromAddr = '"EtherPad Support" <supp...@etherpad.com>';


> +    var fromAddr = '"EtherPad Support" <etherpad@$mydomain>';
>      var subj = "EtherPad: account information";
>      var body = renderTemplateAsString(
>        'pro/account/global-multi-domain-recover-email.ejs', {
> diff -r 81287c8af1ac trunk/etherpad/src/etherpad/control/pad/
> pad_control.js
> --- a/trunk/etherpad/src/etherpad/control/pad/pad_control.js    Fri Dec
> 18 18:44:23 2009 +1100
> +++ b/trunk/etherpad/src/etherpad/control/pad/pad_control.js    Sat Dec
> 19 18:06:51 2009 +0100
> @@ -661,7 +661,7 @@
>               {toEmails: toEmails, padId: padId, username: username,
>                subject: subject, message: message});
>

> -  var fromAddr = '"EtherPad" <nore...@etherpad.com>';

slacker2d

unread,
Dec 19, 2009, 4:55:36 PM12/19/09
to EtherPad Open Source Discussion
I tried to install etherpad on Ubuntu 9.10. My System have 1G RAM.
But

./bin/run-local.sh

produce

$ ./bin/run-local.sh
Using config file: ./etc/etherpad.localdev-default.properties
Exception in thread "main" java.lang.NoClassDefFoundError: net/appjet/
oui/main
Caused by: java.lang.ClassNotFoundException: net.appjet.oui.main
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
320)
Heap
def new generation total 14784K, used 263K [0x6f9e0000, 0x709e0000,
0x709e0000)
eden space 13184K, 2% used [0x6f9e0000, 0x6fa21ec8, 0x706c0000)
from space 1600K, 0% used [0x706c0000, 0x706c0000, 0x70850000)
to space 1600K, 0% used [0x70850000, 0x70850000, 0x709e0000)
concurrent mark-sweep generation total 1032192K, used 0K [0x709e0000,
0xaf9e0000, 0xaf9e0000)
concurrent-mark-sweep perm gen total 16384K, used 1585K [0xaf9e0000,
0xb09e0000, 0xb39e0000)
Could not find the main class: net.appjet.oui.main. Program will
exit.


The rebuild script works great and all env variables set fine.

Any Ideas?

klauer

unread,
Dec 20, 2009, 12:00:09 AM12/20/09
to EtherPad Open Source Discussion
I'm guessing 1GB is not enough. I had to up mine to approx. ~1500
MB. Then it worked just dandy.

On Dec 19, 3:55 pm, slacker2d <falk.scheerschm...@googlemail.com>
wrote:

Raja

unread,
Dec 20, 2009, 3:02:24 AM12/20/09
to EtherPad Open Source Discussion
Ive been able to run this with as low as 128M on Ubuntu 8.04

raja@raja-laptop:/sources/etherpad/trunk/etherpad$ cat /etc/lsb-
release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04"
raja@raja-laptop:/sources/etherpad/trunk/etherpad$ ./bin/run-local.sh
128M

Note: Use the memory size as an argument to run-local.sh

-- Raja

Raja

unread,
Dec 20, 2009, 3:08:18 AM12/20/09
to EtherPad Open Source Discussion
Did you have any issues with
./bin/rebuildjar.sh

That command above seems to be building the jar containing
net.appjet.oui.main. So if your rebuildjar.sh failed, then this could
happen.

-- raja

On Dec 19, 1:55 pm, slacker2d <falk.scheerschm...@googlemail.com>
wrote:

Tom

unread,
Dec 20, 2009, 3:21:06 AM12/20/09
to EtherPad Open Source Discussion
I have not tried it yet, but according to
http://etherpad.com/ep/pne-manual/configuration-guide
you just need to add sslKeyStore and sslKeyPassword
to the configuration.

Tom

unread,
Dec 20, 2009, 3:24:38 AM12/20/09
to EtherPad Open Source Discussion
I got the same error when my java classpath was not set correctly,
i.e. specifying relative directories to etherpad/trunk but starting it
from
another directory.

On 19 Dez., 22:55, slacker2d <falk.scheerschm...@googlemail.com>
wrote:


> I tried to install etherpad on Ubuntu 9.10. My System have 1G RAM.
> But
>
> ./bin/run-local.sh

slacker2d

unread,
Dec 20, 2009, 9:10:15 AM12/20/09
to EtherPad Open Source Discussion
$ ./bin/rebuildjar.sh
using JAR fastjar...
unzipping JARs...
making cached JAR....
compiling...
compiling with 'fsc'...
compiling common...
Note: net.appjet.common/util/HttpServletRequestFactory.java uses or
overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: net.appjet.common/util/HttpServletRequestFactory.java uses
unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
compiling sars...
compiling cli...
done with cli
compiling rhino abstraction...
warning: there were deprecation warnings; re-run with -deprecation for
details
one warning found
compiling appserver source...
warning: there were deprecation warnings; re-run with -deprecation for
details
warning: there were unchecked warnings; re-run with -unchecked for
details
two warnings found
compiling ajstdlib...
warning: there were deprecation warnings; re-run with -deprecation for
details
one warning found
compilng etherpad...
compiling ooservice...
copying files...
obfuscating...
building javascript classfiles...
done.
copying cached JAR...
making JAR...
write: Success

Chris Ball

unread,
Dec 21, 2009, 12:08:13 AM12/21/09
to etherpad-open-...@googlegroups.com
Hi,

On Sun, Dec 20, 2009 at 06:10:15AM -0800, slacker2d wrote:
> copying cached JAR...
> making JAR...
> write: Success

I was hitting this too, and discovered that you can get past it with
"export JAR=jar" -- fastjar is failing on appjet.jar with "write:
Success" for me, but Sun's jar isn't.

gdb pinpointed the failing code, which is in fastjar 0.97 and 0.98,
but not earlier versions:

#2 0x0804b6ad in add_file_to_jar (jfd=7, ffd=9, fname=0x81437ca "t",
statbuf=0xbfffee80, updating=1) at jartool.c:1261
(gdb) list
1259 /* write the file name to the zip file */
1260 if (1 == write(jfd, fname, file_name_length))
1261 exit_on_error("write");

I think that "1" looks suspiciously like a typo of "-1", which means
that modern versions of fastjar always fail on adding one-character
filenames! I'll send the fastjar folks a patch.

Many thanks to Google/AppJet for such a tremendous gift,

- Chris.
--
Chris Ball <c...@laptop.org>

Reply all
Reply to author
Forward
0 new messages