Install TeamHub on Ubuntu

Installing TeamHub on your server is a fairly straight forward process for those who have some exposure to deploying WAR packages to Tomcat servers.
TeamHub is written on JRuby and is fully compatible with Tomcat7 and above. The procedure to deploy TeamHub on Tomcat7 on a Linux ( Debian 7 / Ubuntu 14.04 / Ubuntu 15.04) Operating system is as below.
Before we begin:
Let us start with a fresh minimal install of Ubuntu 14.04 / 15.04, we recommend a 32 bit install for servers with minimum 2 processing cores and RAM less than 4 GB as Java performance is significantly better on 32 bit systems with limited resources compared to 64 bit systems with RAM < = 4 GB.
To try out, we recommend both Digital Ocean virtual servers on the cloud as their $20 / month servers are well suited for a quick 25 user deployment without much hassle. Click here to sign up with Digital Ocean.
Once you have fired up the Ubuntu 14.04 / 15.04 server, the first step is to update the sources and upgrade the system to the latest version.
Note: change into super user mode before you proceed with this tutorial else things will fail!

Now we need to install a database server, TeamHub supports MySQL, PostgreSQL, Microsoft SQL.
We prefer to use MySQL so here is the setup using MySQL.
Install MySQL server by issuing the following commands

Set a root password for your MySQL instance when it asks you.
Log into your MySQL instance using

enter the root password when prompted, now create a database named

Please use the same database name and password as mentioned in this guide,
otherwise TeamHub application will not be able to connect to the database.
Now we install the Java Runtime,

TeamHub is well tested with Oracle Java 8 and we recommend it to deploy TeamHub on a production ready server.
Please note that OpenJDK is not supported and the performance will be very sluggish even if you get it working!
Now we will install Oracle Java 8

Once the installation of Oracle Java 8 is completed, run the following command to append JAVA_HOME to your environment.

Reload the environment

Now install Tomcat 7

Now we shall install the JCE policies

unzip it

and copy it

Specify memory used by the server by adding this to your file just after the shebang.

Or you can run the following command to do it for you.

this allocates a minimum of 512 MB and a maximum of 1 GB to your system for the java server.

Now open /var/lib/tomcat7/conf/server.xml and look for

The following line : URIEncoding="UTF-8" and then append to the following lines

as you can see, we are setting up some parameters for maximum number of threads and buffers.
you can also execute the following lines to do the same for you

Restarting Tomcat again for the settings to apply

Now we need to install JRuby

Now add this directory to the system path by running the following command

load the modified environment

now you can check JRuby install by typing

you should get the JRuby version number and java version as the output,
if you get something else, please verify your JRuby install.
( We don’t use rvm, for this is a dedicated production machine and rvm causes unnecessary complexity in configurations while running scheduled rake tasks)

Now the server is pretty much ready, we now need to an Apache server reverse proxy our Tomcat installation.

enable proxy module by

create a proxy configuration file by

and then add this configurations to it

Change to sites available directory

and now disable the default sites

later you can also remove them to make this a bit cleaner to understand

Now enable teamhub.conf by

restart the apache server to apply the new configurations

At this point when you browse to your server’s ip you will see the Tomcat Server’s default page instead of the
Apache2 default page. This confirms that both out Tomcat and Apache reverse proxy are working fine.
Now lets deploy TeamHub!

Change to your home directory and download TeamHub

uncompress the file

Stop the Tomcat server now

navigate to the Tomcat webapps directory and

Now wait for some time while Tomcat auto deploys the war file.
Now let us create some additional folders for temp files and log files

Now we need to create a folder to store user uploaded files, by default it is /home/teamhub/teamhub_files
So let us create the folder

Being a JRuby app, we need to install the required gems to run it, but before that, lets do a quick reboot

Now you can use TeamHub by pointing your browser to your server’s ip address.
Follow the initial setup wizard to register for a free 14 day trial.
If you would want to save this effort, consider running the automated installer script!