Installing Tomcat with bemokoLive in 5 minutes

From bemoko developer wiki

Jump to: navigation, search

Installing Tomcat

Follow the documentation for full details at Tomcat site to install Tomcat.

Within this bemoko documentation, the variable $TOMCAT_HOME represents the installation location of Tomcat.

Tomcat Configuration

By default bemokoLive works without any external dependencies. It is designed this way to make it easy to install and spin up the application. However, to unlock the full potential of live it is likely you will want to enable some of the features that do have external dependencies, such as JDBC Database persistence.

These can be enabled with the following bemokoLive platform parameters - See Platform Parameters for details on setting platform parameters

Feature JVM Parameter Description
JDBC -Dbemoko.datasource.mode=jndi Indicate that the JDBC connection should be resolved by JNDI lookup

The JCR and JDBC JNDI resources can be configured in the tomcat conf/context.xml as follows:

<?xml version="1.0" encoding="utf-8"?>
<Context>
  <Resource name="jdbc/BemokoLiveDB" auth="Container"
    type="javax.sql.DataSource" removeAbandoned="true"
    removeAbandonedTimeout="30" maxActive="100"
    maxIdle="30" maxWait="10000" username="bemoko"
    testOnBorrow="true" validationQuery="select 1"
    password="password"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost/bemoko"/>
</Context>

where:

  • /opt/local/tomcat/ is the Tomcat installation directory, i.e. $TOMCAT_HOME

Deploy bemokoLive Application

Copy the bemokoLive war to $TOMCAT_HOME/webapps/ROOT.war

Start up and Test

Setup - FAQ

I get the error ... Cannot load JDBC driver class 'com.mysql.jdbc.Driver'

Problem - You need a JDBC Driver to hook up bemokoLive to your database
Solution - Place your JDBC Driver .jar file in $TOMCAT_HOME/lib

The MySql JDBC Driver (known as Connector/J) used for this purpose can be downloaded at http://dev.mysql.com/downloads/connector/j