Dashboard > blojsom 3.0 > ... > Installation > Tomcat Setup for MySQL
  blojsom 3.0 Log In   View a printable version of the current page.  
  Tomcat Setup for MySQL
Added by David Czarnecki, last edited by David Czarnecki on Dec 14, 2006  (view change)
Labels: 
(None)

This page describes the setup of blojsom using Tomcat as the application server and MySQL as the database engine.

Configuration Changes

Items marked in bold in the configuration sections below are values to be changed.

Download and Install MySQL

  • Download and install MySQL 5 and the MySQL JDBC Driver.
  • Create a new user in MySQL with full permissions for your given host.

    % mysql -u root -p
    password: *****
    mysql> create database blojsom;
    mysql> grant all on blojsom.* to someuser@'%' identified by 'somepassword';
    mysql> grant all on blojsom.* to someuser@localhost identified by 'somepassword';
    mysql> use blojsom;
    mysql> flush privileges;
    mysql> quit

Download, Install, and Configure Tomcat

  • Download and follow the installation instructions for Tomcat. Installation notes are available from the Tomcat website.
  • Open %TOMCAT_HOME%/conf/server.xml file and check out the settings for various defined <Connector .../> elements. Set the URIEncoding attribute to UTF-8, which is the character encoding format blojsom uses for encoding links. For example:
    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
       maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
       enableLookups="false" redirectPort="8443" acceptCount="100"
       debug="0" connectionTimeout="20000"
       disableUploadTimeout="true" URIEncoding="UTF-8"/>

Setup blojsom

  • Download the blojsom 3.0 blojsom.war file.
  • Create a web application directory for the blojsom 3.0 WAR file in %TOMCAT_HOME%/webapps.

    % mkdir blojsom

  • Copy the blojsom.war file into the %TOMCAT_HOME%/webapps/blojsom directory.
  • Unpack the blojsom.war file.

    jar xvf blojsom.war

  • Delete the blojsom.war file.

Install the MySQL Database Driver

  • After unpacking the MySQL JDBC Driver, copy the mysql-connector-java-3.1.12-bin.jar (or appropriate version) file to %TOMCAT_HOME%/common/lib.

Configure blojsom's Database Settings

  • Edit %TOMCAT_HOME%/webapps/blojsom/WEB-INF/classes/blojsom-helper-beans-include.xml and change only the values for the username and password for your database to the username and password you created earlier.
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost/blojsom?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8"/>
        <property name="username" value="someuser"/>
        <property name="password" value="somepassword"/>
    </bean>
  • Edit %TOMCAT_HOME%/webapps/blojsom/WEB-INF/classes/blojsom.xml.
    <bean id="dbloader" class="org.blojsom.util.database.DatabaseLoader" init-method="init">
        <property name="sessionFactory">
            <ref bean="hibernateSessionFactory"/>
        </property>
        <property name="dbScript" value="/WEB-INF/classes/blojsom-full-initial-data-mysql.sql"/>
        <property name="upgrading" value="false"/>
        <property name="servletConfig">
            <ref bean="servletConfigFactoryBean"/>
        </property>
        <property name="detectBlojsomSQL">
            <value>show tables;</value>
        </property>
    </bean>

Access blojsom

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators