Open-Source Etherpad on MacOSX
About: EtherPad is a very famous web-based texteditor that lets users collaborate on text documents in realtime. While writing or editing texts inside an EtherPad other users can join and you'll see their change just in the moment they type. Just try it out yourself at http://etherpad.com/helges-pad-example.
History: Recently the company behind EtherPad (AppJet) has been acquired by Google to join the Google Wave team. Soon after this acquisition many users complained about Google's plan to shut EtherPad down resulting in a decision to open-source the code behind EtherPad. You're now able to download the code at http://code.google.com/p/etherpad and join the EtherPad developer community at http://groups.google.com/group/etherpad-open-source-discuss.
Running Etherpad on MacOSX: I tried to get the EtherPad code running on my Macbook and ran into several pitfalls. This is a step-by-step introduction for other Mac users trying to get EtherPad running on their local machine.
For the following steps it's very helpful to make invisible files visible inside your Finder (see http://www.mac-forums.com/forums/278026-post5.html).
Completing the instructions on http://code.google.com/p/etherpad/wiki/Instructions follow these steps:
- Download and install Java 1.6 (tested with 1.6.0_10 - I tested it with 1.6.0_17)
MacOSX (Leopard) does not support Java 1.6 out of the box. You can check your Java version by either opening a terminal/console/bash/Terminal.app (Spotlight: Terminal) and runningjava -version
or by checking System Settings.app -> Java. If your Mac does not run Java 1.6 you'll have to download this update from Apple and install it to get Java 1.6 running.
- Download Scala 2.7 (tested with 2.7.4 - I use 2.7.7 without problems), extract and copy it to
/usr/local/scala-2.7.7.final
(path depends on your version of scala).
- Download and install MySQL Server 5.1 (tested with 5.1.41)
Take care to choose the right Version for your OS: 10.5 equals Leopard and 10.6 equals Snow Leopard. Also install the StartupItem that comes with MySQL which makes it easier to start the MySQL server. After that Start the server by running
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
in a terminal (http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html).
- Download the MySQL Connector for Java mysql-connector-java (tested with 5.1.0) and save the .jar file to any place you keep libary files, e.g. ~/lib (create a 'lib' folder inside your user directory).
- Tell your terminal/bash where Java, Scala and your MySQL Connector are located by creating or editing the file .bash_profile inside your user directory
/Users/<myusername>/.bash_profile or
~/.bash_profile
You can do that by running
vi .bash_profile
inside your user directory.
Add the following lines to this file:export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home" export SCALA_HOME="/usr/local/scala-2.7.7.final" export JAVA="$JAVA_HOME/bin/java" export SCALA="$SCALA_HOME/bin/scala" export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:/usr/local/mysql/bin:$PATH" export MYSQL_CONNECTOR_JAR="/Users/<myusername>/lib/mysql-connector-java-5.1.10-bin.jar"
Take care to change each underlined path to whatever suits your settings (use Finder or Terminal to check them). Some remarks:
JAVA_HOME: Most people say that the right path for Java on MacOSX is /Library/Java/Home but that's wrong for our situation because we want to directly link to Java 1.6 (not the systems default Java version). Thus your path should look quite similar to the above one starting with /System/Library/Frameworks... (http://developer.apple.com/mac/library/qa/qa2001/qa1170.html)
SCALA_HOME: keep your attention on the deepth of your path (is it /scala/scala-<version> or only /scala-<version>) and of course on the version!
MYSQL_CONNECTOR_JAR: the absolute path to your MySQL Connector .jar file. Be careful to get the version right.After having saved .bash_profile you'll need to close/restart Terminal either by just closing it or running
killall Terminal
Afterwards you'll be able to check your settings by starting a new terminal and running the following commands:
java -version [java displays it's version - should be something with 1.6]
scala [scala opens and shows it's version - run :quit to exit]
echo $MYSQL_CONNECTOR_JAR [shows the path you entered in .bash_profile] - Now you'll have to checkout the EtherPad source code with Mercurial. http://code.google.com/p/etherpad/source/checkout tells you how to do that. You'll probably need to install Mercurial or use the Netbeans IDE (if you already have it) which comes with a pre-installed Mercurial. Save your EtherPad code to whatever location you prefer. My path is ~/etherpad but different locations should work, too.
- The next step is to complete the database setup. EtherPad has a shell script for that task which you can run in terminal. First you'll have to navigate to the correct path:
- etherpad -- branches -- trunk --- bin --- etherpad <<<< navigate to this path inside your etherpad source --- infrastructure
Then run
sudo bin/setup-mysql-db.sh
to start the database setup. If you run into any problems (such as "Unknown command") you probably don't have your MYSQL Path set correctly (that means: bash does not know which app to use to run mysql commands). I solved this problem by editing bin/setup-mysql-db.sh and adding this line (in bold):
db="etherpad" mysql="/usr/local/mysql/bin/mysql" echo "Creating etherpad ${db}..." echo "create database ${db};" | ${mysql} -u rootI'm sure that there's a better method to solve this. Probably something similar to step 5. Yet, I'm not an expert in using bash and would appreciate any comment on this!
- After having set up your database you'll need to compile the Java and Scala libraries. Navigate to the path mentioned in step 7 and run
bin/rebuildjar.sh
- Finally start your local EtherPad server by running
bin/run-local.sh
This should show you lots of settings stuff and finally a message HTTP server listening on http://localhost:9000
That's it. If you've any questions have a look at the Google Group http://groups.google.com/group/etherpad-open-source-discuss or leave a comment over here.
- Misc. ,
- Scala ,
- OSX ,
- open source ,
- Mac ,
- javascript ,
- Java ,
- Etherpad
User login
Recent comments
- Thank you, this was great! :)
19 weeks 4 days ago - I run bin/rebuildjar.sh but
34 weeks 16 hours ago - Coole Bilder :) Paris...lange
1 year 34 weeks ago - Creating the database in the terminal
1 year 44 weeks ago

Comments
I run bin/rebuildjar.sh but
I run bin/rebuildjar.sh but it show a message : The path to $MYSQL_CONNECTOR_JAR (Users/csie/lib/mysql-connector-java-5.1.16-bin.jar) does not exist, please check and try again.I can't solve the problem. Could you help me??
Creating the database in the terminal
It's easy to create the database in the terminal. If you have contact with mysql in the terminal, you can write:<br />mysql> create database etherpad; (press return)<br />Query OK, 1 row affected (0.03 sec)<br />mysql> grant all privileges on etherpad.* to 'etherpad'@'localhost' identified by 'password' ; (press return)<br />Query OK, 0 rows affected (0.04 sec)<br />mysql><br />If you change the password from 'password' to something else (which you should) you have to update the configuration file inside <your etherpad folder>/trunk/etherpad/etc/etherpad.localdev-default.properties with the new password.
Post new comment