My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
InstallGuide  
This document describes how to install the Gaixie Micrite software.
Phase-Deploy, Featured
Updated Aug 28, 2009 by bitorb@gmail.com

Introduction

This document describes how to install the Gaixie Micrite software.
It explains what you need to install first, how to download Micrite, how to configure Micrite and how to install it to your existing java application server and relation database.



Ready?

First, let's make sure you have everything you need to install and run Micrite.

Micrite is a database-driven Java web application. To run it you need Java, a Java Servlet container such as Tomcat and a database such as MySQL. More specifically, here's what you need to install and run Micrite:

  • The Java development kit, specifically the Sun Java 2 SE 1.6 JDK. The computer on which you install Micrite should be configure to run with the Java SE 6.
  • A Java aplication server, or more specifically a Servlet container that supports the Servlet 2.4 API. Hereinafter, we'll just call this your server. The Micrite community tends to use and is best able to answer questions about Tomcat 5.5, Tomcat 6.0.
  • A relational database such as MySQL, Apache Derby or PostgreSQL. Micrite includes database creation scripts for Derby, MySQL, PostgreSQL and MsSQL.



Download and un-package Micrite

Download the Gaixie Micrite release file from http://code.google.com/p/micrite/downloads/list and use your favorite ZIP program to unzip the release into a directory on your computer's disk.

Installation directory layout

Once you've unpackaged the files you'll find a directory structure like this:

gaixie-micrite-x.x
  |--README.txt
  |--LICENSE.txt
  |--src
  |--dbscripts
  |--webapp
       |--micrite

The Micrite War

The Micrite application itself is in the directory webapp/micrite and is organized using the standard Java EE WAR directory structure.Generally speaking, you won't need to modify and files in side the director. You can deploy it as is, in directory form, or you can package it up as a .war if you prefer to deploy as a file.

For example, here's how you'd package it up as a WAR:

% cd gaixie-micrite/webapp/micrite
% jar cvf ../micrite.war *



Prepare your database for Micrite

Before you can install Micrite you'll probably need to some work to prepare your database for Micrite.

You need some place to put the Micrite tables. Some folks call this a table-space, but we refer to it as a database.
You need to create a database for Micrite, or get your database administrator to do it for you. And second, you need to have a JDBC driver installed for you database of choice.

Note: If you want take a glance at micrite v0.11 or higher, you can use hsqldb in memory, just skip to Deploy Micrite

Create a database for Micrite

If you're luck enough to have your own database administrator, ask them to setup a database for Micrite. When they are done, ask them to provide you with this information, you'll need it later:

  • Username and password for connecting to database
  • JDBC connection URL for database
  • JDBC driver class name

If you don't have a database administrator then you'll have to refer to the documentation for your database and do it yourself. You need to create a database for Micrite, protected by username and password.

  • For example, if you're using Derby you might do something like this:
    1. To control derby, from project root directory run:
    2. gaixie-micrite-x.x> java -cp webapp/micrite/WEB-INF/lib/derbytools-10.4.2.0.jar:webapp/micrite/WEB-INF/lib/derby-10.4.2.0.jar -Dderby.ui.codeset=utf8 org.apache.derby.tools.ij
      
      # Windows users need replace “:” (colon) with “;” (semi-colon), like this:
      gaixie-micrite-x.x> java -cp webapp/micrite/WEB-INF/lib/derbytools-10.4.2.0.jar;webapp/micrite/WEB-INF/lib/derby-10.4.2.0.jar -Dderby.ui.codeset=utf8 org.apache.derby.tools.ij
    3. Connect Derby ,create database and tables:
    4. ij> connect 'jdbc:derby:micritedb;create=true;user=micrite;password=micrite';
      ij> run 'dbscripts/derby/createdb.sql';
      ij> exit;
    5. Now, A directory has been created , check directory structure like this:
    6. gaixie-micrite-x.x
        |--README.txt
        |--LICENSE.txt
        |--src
        |--dbscripts
        |--micritedb
        |--webapp
             |--micrite
  • MySQL like this:
  • $ mysql -u root -p
    password: *****
    mysql> create database micritedb;
    mysql> grant all on micritedb.* to micrite@'%' identified by 'micrite';
    mysql> use micritedb;
    mysql> source {project_home}/dbscripts/mysql/createdb.sql
  • PostgreSQL like this:
  • $createdb -h localhost -p 5432 --encoding=utf8 -U postgres micritedb
    # login database use postgresql admin account
    $ psql -h localhost -p 5432 -U postgres
    postgres>CREATE USER micrite_user WITH PASSWORD 'yourpassowrd';
    postgres>ALTER DATABASE micritedb OWNER TO micrite_user;
    postgres>\q
    #relogin as micrite_user
    $ psql -h localhost -p 5432 -U micrite_user micritedb
    # execute script file
    micritedb>\i {project_home}/dbscripts/postgresql/createdb.sql

Check your JDBC driver setup

Make sure that you have the correct JDBC driver installed in your server. Usually, this is as simple as downloading the JDBC driver jar(s) and placing it (or them) into your server's classpath. For example, on Tomcat 5.5 you place them in common/lib, on Tomcat 6.0 in lib.



Configure Micrite

Here is how to configure database connection for Micrite.

  1. Find your WEB-INF/classes/databaseResource-hibernate.xml file and open it in a text editor.
  2. Search the beans with ids dataSource and change the value field of the following property.
  3. <property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
    <property name="url" value="jdbc:derby:{ProjectHome}/micritedb" />
    <property name="username" value="micrite" />
    <property name="password" value="micrite" />
  4. Find your WEB-INF/classes/hibernate.properties file and open it in a text editor.
  5. Search "Platforms" text and comment-out your database part,then comment default database. For example, if you're useing Derby you might do it like this:
  6. ## Derby
    hibernate.dialect org.hibernate.dialect.DerbyDialect
    
    ## PostgreSQL
    #hibernate.dialect org.hibernate.dialect.PostgreSQLDialect



Deploy Micrite

Use your server's administration console to deploy the Micrite web application. You can deploy as a directory, in which case you'll have to enter the path to your Micrite installation's webapp/micrite directory. Or you can deploy as a WAR file, in which case you will have to have created a WAR file as we described in Section The Micrite War.

Deploying to Apache Tomcat 6.0

You can deploy to Tomcat as either a directory or a WAR file.

  • Deploy directory (Windows)
  • Context Path : /micrite
    WAR or Directory URL : c:\gaixie-micrite-0.9\webapp\micrite
  • WAR file to deploy
  • Just select micrite.war file to deploy.

Once Micrite is deployed, you'll see that it's listed among the other applications. There's a /micrite link to Micrite itself and there are options to start, stop, reload and undeploy.
If Micrite doesn't start-up, look for the problem in the logs. You can find them in Tomcat's logs directory. The Tomcat log file is catalina.out.



Getting started with Micrite

Visit http://localhost:8080/micrite with following default account.

Username Password Role
admin 123456 ROLE_ADMIN
user 123456 ROLE_USER

Comment by Milos.I...@gmail.com, Nov 21, 2009

In the latest version there is no WEB-INF/classes/databaseResource-hibernate.xml

Comment by project member bitorb@gmail.com, Dec 1, 2009

In v0.11+ you don't need to configure anything, just Deploy Micrite


Sign in to add a comment
Powered by Google Project Hosting