Etherpad Lite is a lightweight version of (probably) the most popular web-based collaborative real-time editor - Etherpad. This great peace of software allows multiple users to edit the same document in real-time. To make collaboration easier, users have built-in chat at their disposal. History playback, infinite undo, easy import and export of documents are some of the cool stuff it has to offer. Compared to the original, EL has very short system requirements list, which makes it very easy to deploy. Since it’s written in server-side JavaScript using Node.js, to make it functional for testing/development purposes you’ll need only Node.js, but for everyday/production usage it’s recommended that you use a web server (e.g. Apache or Nginx) and MySQL.
Prerequisites
First you’ll need to install dependencies. If you’re using Red Hat based distro (like CentOS or Fedora) you can use yum:
# yum install gzip git-core curl python openssl-devel make gcc gcc-c++
If you’re using Debian based distro (like Ubuntu), you can use apt-get:
# apt-get install gzip git-core curl python libssl-dev build-essential
Installation
Download the latest stable version of Node.js, unpack it and compile it:
# tar xf node-v0.6*
# cd node-v0.6*
# ./configure && make && make install
Now you can download the latest version of EL and install its dependencies:
# cd /home/etherpad/ && git clone 'git://github.com/ether/etherpad-lite.git'
# ./etherpad-lite/bin/installDeps.sh
At this point you have basic setup for testing EL. To run it, simply execute the startup script (preferably as etherpad user and not as root):
$ ./etherpad-lite/bin/run.sh
By default, EL binds itself to port 9001, so you can use it by opening http://localhost:9001
Configuration
I’ll assume that you have Nginx and MySQL installed, so I’m not going to explain how to install and configure them. Instead, I’m going to jump right onto the configuration of EL.
MySQL
Connect to MySQL server and create a database for EL.
# mysql -u root -p
mysql> create database etherpad;
mysql> grant all privileges on etherpad.* to 'etherpad'@'localhost' identified by 'SomePassword';
mysql> exit
Now you can set up the connection string in EL’s configuration file - settings.json
. There are couple of variables you’ll need to change/set. Default values for ip
and port
are alright, however you’ll have to change dbType
from dirty
to mysql
and, of course, change dbSettings
. If you want to restrict access to EL you can uncomment httpAuth
variable and enter username and password. Example of settings.json
file:
/*
This file must be valid JSON. But comments are allowed
Please edit settings.json, not settings.json.template
*/
{
//Ip and port which etherpad should bind at
"ip": "127.0.0.1",
"port" : 9001,
/* An Example of MySQL Configuration*/
"dbType" : "mysql",
"dbSettings" : {
"user" : "etherpad",
"host" : "localhost",
"password": "SomePassword",
"database": "etherpad"
},
//the default text of a pad
"defaultPadText" : "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad Lite on Github: http:\/\/j.mp/ep-lite\n",
/* Users must have a session to access pads. This effectively allows only group pads to be accessed. */
"requireSession" : false,
/* Users may edit pads but not create new ones. Pad creation is only via the API. This applies both to group pads and regular pads. */
"editOnly" : false,
/* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly,
but makes it impossible to debug the javascript/css */
"minify" : true,
/* This is the path to the Abiword executable. Setting it to null, disables abiword.
Abiword is needed to enable the import/export of pads*/
"abiword" : null,
/* This setting is used if you need http basic auth */
//"httpAuth" : "user:pass",
/* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */
"loglevel": "INFO"
}
After editing the configuration file, it’s time to start EL in order to check if everything is in order. Just like before, you just need to execute run.sh
script. If you configured everything correctly, EL will start successfully and create single database table named store
.
Just to make sure, you should set utf8 character set and collation to both database and its table:
# mysql -u root -p
mysql> use etherpad;
mysql> ALTER DATABASE `etherpad` CHARACTER SET utf8 COLLATE utf8_bin;
mysql> ALTER TABLE `store` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
mysql> exit
Nginx
To put EL behind reverse proxy (in this case Nginx), you will need an virtualhost that looks something like this:
server {
listen 80;
server_name your.domain.tld;
access_log /var/log/nginx/your.domain.tld.log;
error_log /var/log/nginx/your.domain.tld.log;
location / {
proxy_pass http://localhost:9001/;
proxy_set_header Host $host;
proxy_buffering off;
}
}
Init script
To make your life easier, you should configure EL to run as a service. If you’re running Red Hat based distro, just copy the init script shown below to /etc/init.d/etherpad
, just make sure that you have defined correct paths for variables path
, prog
, log
, conf
and lockfile
:
|
|
When you’re done, make the init script executable and start etherpad:
# chmod 755 /etc/init.d/etherpad
# service etherpad start
Init scripts for other distributions can be found here.
Upgrading
Upgrading EL is super easy and it’s done by pulling the changes from git repository:
$ cd /home/etherpad/etherpad-lite/
$ git pull origin
You don’t have to worry about settings.json
configuration file. It won’t be overwritten 😉