Friday, April 2, 2010

Etherpad Open Source Installation Step-By-Step

Today I wanted to create a blog post documenting the steps necessary to create a Etherpad virtual machine in our organization.  This should work great for anyone else as well.  This article is a mix of instructions from Ubuntu documentations found here and here.  This Etherpad virtual machine was also built on VMware vSphere 4.0, so there are a couple of steps specific to that environment, but in previous testing, I know that the same process works just fine in VMware Fusion as well.

Virtual Machine Setup:

First thing to do is to create a new virtual machine and installing the OS.  We will be using Ubuntu 9.10 server and using the minimal virtual machine installation.  You can see in the picture below how you can get this installation option, it is under the modes section you can access by hitting F4.

Once you work through the installation of the OS which I won't go through here, you will be left with a very minimal Linux installation that we will then want to get brought up-to-date for the rest of the install.

Once you log in for the first time, you will want to make sure the system is up-to-date.  This is very important especially on ESX because there is a bug in the default Kernel that will not let you mount CD's which is necessary to install the VMware Tools.  The commands for doing this are below:

$ sudo apt-get update
$ sudo apt-get upgrade

This should get you the latest versions of everything installed by default.

You will then need to install three sets of packages that are required for the installation of VMware Tools.

$ sudo apt-get install build-essential linux-headers-$(uname -r) psmisc

Once these are installed, then you can ask VMware to install the tools, and you will complete the install by issuing the following steps.

$ mount /media/cdrom0
$ cd /tmp
$ tar xvzf /media/cdrom0/VMwareTools*.gz
$ sudo vmware-tools-distrib/ -d
$ rm -rf vmware-tools-distrib
$ umount /media/cdrom0

Once this has been done, I always install a couple of other packages to make it easier to administer the server.  These are optional, but I will keep them in the documentation in case you are interested.

$ sudo apt-get install openssh-server nano

This concludes the basic setup of the Virtual Machine.  Now we can move on to the specifics of setting up Etherpad on this machine.

Etherpad Installation:

The next thing we need to do for the process of install Etherpad is to install the dependencies that are required for this to run.  We will do that with the following command:

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

One thing to be careful of is that when you install the mysql server it is going to ask you for a password for the root user.  Make sure that you write this down or remember it so we can use it later in the process.

Next you will want to download the source code from Google.  I prefer to put all of this code in the /opt directory on your server, but I have been known to use the /tmp directory as well.

The following lines will get you all the source code necessary.

$ cd /opt
$ hg clone etherpad

You will then need to make some changes to this source code to get it to compile on Ubuntu, but I will try and simplify that as much as possible.

The first file you will need to modify is titled which can be found in /opt/etherpad/trunk/infrastructure/bin.  You will want to modify the file to make changes to two specific lines.  You can use the command below to open the file for editing.

$ sudo nano /opt/etherpad/trunk/infrastructure/bin/

On Line 35 of, you will want to change this:

JARFILES=`echo $SCALA_HOME/lib/scala-library.jar lib/*.jar lib/manifest`

Into this:

JARFILES=`echo $SCALA_HOME/scala-library.jar lib/*.jar lib/manifest`

Also, on line 39 you will want to change this:

$JAR xf $SCALA_HOME/lib/scala-library.jar

Into this:

$JAR xf $SCALA_HOME/scala-library.jar

You will see that in both cases you are strictly removing the /lib directory out of the path.

By using ctrl-o and ctrl-x in nano you will be able to save and close.

You will then need to add your server to /opt/etherpad/trunk/etherpad/src/etherpad/globals.js

$ sudo nano /opt/etherpad/trunk/etherpad/src/etherpad/globals.js

On line 30, you will want to add a couple of lines: (Of course changing and server.ip.address to match the name and ip address in your environment)

'': true,
'server.ip.address': true,

Again, ctrl-o ctrl-x to save your changes.  

You will now need to set a bunch of environment variables to make sure the code will compile correctly.

$ 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

You have two more files to make changes to, and then we can run the compile and start the application.  For this modification, we need to make a couple of setup changes to the database script so that it will work correctly with your password you setup earlier.

$ sudo nano /opt/etherpad/trunk/etherpad/bin/

On line 22, add the following line:


Then on line 26, change:

echo "create database ${db};" | ${mysql} -u root

To this: (yourpass should be what you setup earlier)

echo "create database ${db};" | ${mysql} --user=root --password=yourpass

Also, change line 29 from this:

echo "grant all privileges on ${db}.* to 'etherpad'@'localhost' identified by 'password';" | ${mysql} -u root

To this: (again, yourpass should be what you setup earlier)

echo "grant all privileges on ${db}.* to 'etherpad'@'localhost' identified by 'password';" | ${mysql} --user=root --password=etherpad

Save the file with ctrl-o ctrl-x and then run it

$ cd /opt/etherpad/trunk/etherpad
$ sudo bin/

You will want to make one final change, and that is to change the default port to port 80 instead of port 9000 which is what is in the code by default.

$ sudo nano /opt/etherpad/trunk/etherpad/etc/

On line 11, change the listen port from 9000 to 80 so it looks like this:

listen = 80

Once you save the file, you can then build the application:

$ cd /opt/etherpad/trunk/etherpad
$ bin/

Once that completes, you can start the application:

$ bin/

That is it, if everything worked out correctly you should see the following screen:

Clicking on the big button will get you the interface you may have been accustomed to:

If you have any problems, or questions about this, please feel free to let me know.

Thursday, March 4, 2010

NCCE Presentation Slides

Below you will find the slides for our presentation later today on using Google Apps in our district.

Thursday, February 4, 2010

Google Apps Directory Sync - Specific Group/OU Selection

Over the past year people have asked me how they can go about deploying Google Apps in their organization, and how they can do it on a limited basis at first.  That answer is a bit more complex than I want to tackle today, but in the last few days I had a colleague in a local school district ask how he could deploy a few accounts while still using GADS.  That is something I will tackle today, if you would like to follow along, I would hope you have some experience (at least installing) Google Apps Directory Sync.

The situation here is the following, my colleague wanted to create a group in Active Directory, and then when specific users needed to have accounts in Google Apps, he would just drop them into there, and the next run of GADS will create the accounts in Google Apps.  I knew this could be done, but had never done it, so here without further ado is what is necessary.  After the break you will find the entire instructions for successfully setting this up.

Wednesday, January 20, 2010

Errors Moving Virtual Machines From Thick Provisioned To Thin Provisioned in Vsphere 4.0

So, as a part of my plan to try and blog more in 2010, and also to try and document more of what I am doing for my own reference as well, I present you with the following article...

Over the last couple of months I have been trying to come up with ways that we could reclaim some of the space on our Equallogic SAN that is quickly being used up. One of the obvious options is to move some of our virtual machines that were created in the ESX 3.5 days where the option to thin provision wasn't available to the new thin provisioned format supported in vSphere 4.0.

Before this week I had tried before to perform a storage vmotion to change from thick to thin provisioned but had always just tried to keep it on the same datastore. In listening to the VMware Communities Podcast over the past year I have caught onto many hints and tips that have lead me to new ideas, and this same thing happened about a week ago. They were discussing something about performing storage vmotions between datastores to change formats and I thought wow, I need to try that and see if it would work.

Of course this did exactly what I wanted, shrinking the actual usage of disk space on my SAN. This process is not without minor issues though, and that really is the purpose of this blog post. Once I had moved the machine from one datastore to another and changed to thin provisioned format, I was getting errors that would not allow the machine to be moved back to its original datastore:

These errors shown here: "A general system error occured: The virtual machine has virtual disk in link-cloned mode that prevents migration" lead me to find the following KB article at VMware which gives four options to solve the issue.

I took the path that seemed easiest to me, and that was to vmotion the machine to another host. Of course, as expected this solution solved the problem, and I was able to then migrate the machine back to its original datastore, but now in thin provisioned mode. All in all, I migrated 8 machines, and this resulted in a gain of approx. 700gb of usable disk space reclaimed which will definitely help us as we move forward in the future.