Monday, July 15, 2013

Etherpad in Sakai CLE

Ethepad is an interesting tool to have in a LMS. It allows to build collaborative documents in real time. If you are teacher and you are looking for a way to make your students work together and see their work step by step, probably that tool is for you.

Today, in this post, I'm gonna tell you how to configure Etherpad-lite in a server join with a LTI connector. That will allow you to create pads into your Sakai sites.

Install Etherpad-lite and the LTI connector on Centos 6.4


For this job you will need to install two services. First is the Etherpad-lite it self. It's powered by node.js technology and should be installed too.

The second service is the LTI connector. It will handle the LTI requests from a LMS like Sakai, Moodle, Canvas, ... and will launch Etherpad tool in your LMS site.

Installing Etherpad-lite


First of all, as root, you should install node.js and all dependencies needed by the two services. So, log in as root and install the needed packages:
yum -y groupinstall "Development Tools" yum -y install wget gzip subversion git-core curl python openssl-devel unzip java-1.6.0-openjdk.x86_64 ant
Then download node.js sources and compile them. wget http://nodejs.org/dist/v0.10.13/node-v0.10.13.tar.gz
tar xvfz node-v0.10.13.tar.gz
cd node-v0.10.13
./configure
make

That step can spend a lot of time. When finished install all on the system. make install
Now you can download etherpad-lite and configure it. First, for sercurity reasons, create a new user and log in. adduser -m etherpad
su - etherpad

Download the etherpad-lite code and update it. git clone git://github.com/ether/etherpad-lite.git
cd etherpad-lite
git pull origin

Copy the configuration template and set it up. cp settings.json.template settings.json
Modify the following parts.
"ip": "your.host.name",
...
"editOnly" : true,
...
"requireSession" : true,

Uncomment "users" block and change passwords. "users": {
  "admin": {
    "password": "changeme1",
    "is_admin": true
  },
   "user
...


Now you can start the etherpad-lite for first time. Execute it from console. It will take some time on the first start.
bin/run.sh
You will notice that a new file exists 'APIKEY.txt'. That contains a key that let external applications connect with etherpad API. You will need that value later to allow LTI connector use the API to create and edit pads.
Note: If you get an error on startup, update again code again and start it.

Later, when all are configured and all dependencies installed, you can execute it as a background service if you want. nohup bin/run.sh &

Install Basic LTI Connector for etherpad

It's time to install the LTI connector. We are going to install it on the etherpad's home so, if you exited "etherpad" user session, remember to log in again: su - etherpad, and ensure you are in the home directory cd.
Create a directory to store all necessary. mkdir etherpad-lti-service
cd etherpad-lti-service

Download an old version of tomcat 5.5 . It could be installed on a newer Tomcat, but it would be harder to explain how to set it up. wget http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.36/bin/apache-tomcat-5.5.36.zip
unzip apache-tomcat-5.5.36.zip
cd apache-tomcat-5.5.36
chmod +x bin/*.sh

Edit .bashrc file from etherpad's home to include Java and Tomcat system required variables: vim /home/etherpad/.bashrc
Add the following lines at the top, just after the # .bashrc export JAVA_HOME=/usr/share/java
export CATALINA_HOME=/home/etherpad/etherpad-lti-service/apache-tomcat-5.5.36

Save and execute
bash
Now check out the LTI connector for etherpad. That connector provides the LTI integration to Etherpad Lite. It was designed and developed by Mark J. Norton of Nolaria Consulting
cd ..
svn co https://source.sakaiproject.org/contrib/mnorton/etherpad-lti/
cd etherpad-lti

Create a file called build.properties and add the following line:
catalina.home=/home/etherpad/etherpad-lti-service/apache-tomcat-5.5.36

Compile with the command ant
Copy the needed libraries to the tomcat's common/lib directory.
cp lib/* ../apache-tomcat-5.5.36/common/lib/

Create a directory on tomcat to store the configuration, and copy it from the sample that exists in the source code
mkdir ../apache-tomcat-5.5.36/etherpad
cp web/eplti.properties ../apache-tomcat-5.5.36/etherpad

Configure the connector editing the file eplti.properties you just copied:
Oauth LTI secret. It will be used in Sakai basic LTI tool as shared secret
oauth.secret= YOUR-ETHERPAD-LITE-LTI-SECRET
Etherpad's API key. Fill it with the value you found in APIKEY.txt on etherpad-lite
api.key = ...
Set the the etherpad service URL and the administrator roles allowed to create and delete pads on a site: etherpad.url= http://your.host.name:9001
access.create.roles=Admin,Instructor,maintain
access.delete.roles=Admin,Instructor,maintain

Now, you can start the service:
cd ~/etherpad-lti-service/apache-tomcat-5.5.36
bin/startup.sh

Configure your sakai Basic LTI tool instance

Add a Basic Lti Tool on a site
Press the edit button on the top right of the tool and provide the following values:
Remote Tool Url: http://your.host.name:8080/eplti
Remote Tool Key: admin
Remote Tool Secret: YOUR-ETHERPAD-LITE-LTI-SECRET

That's all, if you access to the tool as Instructor you will see an screen that allows you to create a new pads associated with this site. Enjoy it.

Set up this as a service

If you look to keep it as a service, you must write two scripts on /etc/init.d to allow system start and stop the service on boot.
You can follow the instructions on Setup etherpad-lite as a service, or you can download the one I created to set up my server here
Also, you can download my version of Apache Tomcat script to set it up as a service here
After that you can register them with command chkconfig --add tomcat-lti
chkconfig --add etherpad-lite-lti setup
Then go to 'System services' and check the recent installed scripts.

Some references used to write that post that you would find useful.


How to install and run a node.js app on centos 6.4 64bit
Etherpad installation guide
Etherpad LTI Connector

No comments:

Post a Comment