Tuesday, April 27, 2010

Alliance Technologies

http://www.at.co.ke

Deploy Alfresco Record Management v3.3 in Existing Tomcat 6 Server


The solution is to implement Alfresco Record Management. 

I will summarize the how to steps on deploying alfresco.war, share.war in Apache Tomcat 6 Server in any platform, Configuring share for Records Management using alfresco mmt to install RM AMPs.

Assumptions
I assumes the following are installed and running properly, if not so, try googling on how to do so
a. Java 1.6 b. MySQL 5.x c. Apache Tomcat 6.x

Steps
1. Get Alfresco Community Edition
Download alfresco-community-war-3.3.tar.gz and unpack the archive. It contains the alfresco.war and share.war web applications that you’ll need to get Alfresco Share up and running.

2. Create db and db user
On Mac/Linux open a terminal/shell, on Windows open the command line. Log on to MySQL with the root user:
> mysql -u root -p
Next, create the database and a user for Alfresco and grant the according rights to the database user:
mysql> create database alfresco default character set utf8;
mysql> create user alfresco identified by 'alfresco';
mysql> grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
mysql> grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

3. Modifying Tomcat 6 Server
Make sure that your Tomcat installation disposes of the directories /shared/classes and <TOMCAT_HOME>/shared/lib. Tomcat 6 does not get distributed with these directories by default. If they are missing, please create them. Next, open the file /conf/catalina.properties and change the value of shared.loader= to:
shared.loader=${catalina.home}/shared/classes,${catalina.home}/shared/lib/*.jar
That way, Tomcat loads for all web applications any classes/property files and libraries that are located in these directories.
Alfresco does not get shipped with a JDBC driver for MySQL. You can download the current driver from http://dev.mysql.com/downloads/connector/j/5.1.html. Unpack the archive and copy the driver mysql-connector-java-5.1.12-bin.jar (at the time of writing this post this driver was the current one) to /shared/lib.
Copy from your dowloaded unpacked alfresco-community-war-3.2.tar.gz archive the file /extensions/extension/alfresco-global.properties to /shared/classes. Open the file alfresco-global.properties and change the value of db.driver= to (line 29):
db.driver=com.mysql.jdbc.Driver
Before we can start deploying Alfresco, make sure your Tomcat installation has a configured heap size of at least 256 MB. By default, Tomcat is started with the default heap size of your JVM. Usually, with these default settings the deployment of Alfresco will fail.
To increase Tomcat’s heap size on a Unix/Linux system open the file /bin/startup.sh and add following line at the beginning of the file:
export CATALINA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=196m"
On Windows based systems open the file /bin/startup.cmd and add the following line at the beginning of the file:
set CATALINA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=196m"
In case Tomcat was running you have to restart it in order the heap size changes take effect.


Another work around for the memory issues is to edit catalina.sh / catalina.bat found in $TOMCAT_HOME/bin. Simply add the following:
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8  -server -Xms1536m -Xmx1536m
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m
-XX:MaxPermSize=256m -XX:+DisableExplicitGC"


4. Deploy Alfresco war files
Stop Tomcat by executing the start script (Unix/Linux systems) or (Windows systems).
Simply copy the file /alfresco.war to /webapps.
Next, copy the file /share.war to /webapps.

5. Install Alfresco DoD Records Management Module
 Download  Alfresco Module Management tool alfresco-mmt.jar ,Alfresco Records Management repository AMP alfresco-dod5015.amp and Alfresco Records Management Share AMP modules alfresco-dod5015-share.amp .
Place the three files in a directory called RM in your home directory, say /home/joseph/RM, such that - joseph@linux-9fbm:~/RM> ls
alfresco-dod5015.amp  alfresco-dod5015-share.amp  alfresco-mmt.jar  java
On the terminal/shell/command prompt, navigate to the directory RM


The following commands install the two amps to the alfresco.war and share.war respectively:-

 java -jar alfresco-mmt.jar install -verbose
 Example
joseph@linux-9fbm:~/RM> java -jar alfresco-mmt.jar install alfresco-dod5015.amp /home/joseph/Documents/KEY_4_GB/apache-tomcat-6.0.26/webapps/alfresco.war -verbose

joseph@linux-9fbm:~/RM> java -jar alfresco-mmt.jar install alfresco-dod5015-share.amp /home/joseph/Documents/KEY_4_GB/apache-tomcat-6.0.26/webapps/share.war -verbose
NB: tweak both cmds appropriate to fit your case


Let us now test to see what is installed, run
java -jar alfresco-mmt.jar list
This command provides a detailed listing of all the modules currently installed in the WAR file
specified.
Example
joseph@linux-9fbm:~/RM> java -jar alfresco-mmt.jar list /home/joseph/Documents/KEY_4_GB/apache-tomcat-6.0.26/webapps/alfresco.warModule 'org_alfresco_module_dod5015' installed in '/home/joseph/Documents/KEY_4_GB/apache-tomcat-6.0.26/webapps/alfresco.war'
   -    Title:        DOD 5015 Records Management
   -    Version:      1.0
   -    Install Date: Mon Apr 26 21:24:02 EAT 2010
   -    Desription:   Alfresco DOD 5015 Record Management Extension
joseph@linux-9fbm:~/RM> java -jar alfresco-mmt.jar list /home/joseph/Documents/KEY_4_GB/apache-tomcat-6.0.26/webapps/share.war
Module 'org_alfresco_module_dod5015_share' installed in '/home/joseph/Documents/KEY_4_GB/apache-tomcat-6.0.26/webapps/share.war'
   -    Title:        DOD 5015 Records Management Client
   -    Version:      1.0
   -    Install Date: Mon Apr 26 21:25:14 EAT 2010
   -    Desription:   Alfresco DOD 5015 Record Management Share Extension

Start Tomcat by executing the start script (Unix/Linux systems) or (Windows systems).
As long as you have not changed Tomcat’s default deploy settings, Tomcat will deploy the web archive automatically. Have a look at Tomcat’s logfile located at /logs/catalina.out. At the end of the log file there should be an entry similar to
18:52:46,528 User:System INFO  [service.descriptor.DescriptorService] Alfresco started (Community): Current version 3.2.0 (2039) schema 2019 - Installed version 3.2.0 (2039) schema 2019 
At the end of the Tomcat’s log file you should see an entry like
23:56:58,258  INFO  [web.site.FrameworkHelper] Successfully Initialized Web Framework
Well done, we are about to complete. Let’s open Alfresco Share in your favorite browser. Therefore, type http://localhost:8080/share in the address bar. 
 Login with username admin and password admin. Proceed with step 6

6.  Adding the Records Management dashlet
1. Log in to Alfresco Share.
2. Click Customize Dashboard.
3. Click Add Dashlets.
4. Locate the Records Management config dashlet in the Add Dashlets list.
5. Drag the Records Management config dashlet to the desired column.
6. Click OK.
The Records Management dashlet displays in the selected column in your Records Management site dashboard.
 
The following documents and links may be of help to supplement this tutorial
a. Install instructions on > Linux , WIndows , Mac 
c. Alfresco Community Wiki
d.Alfresco Community Edtion 3.3 tutorials 

Well done, we are through. Get yourself Getting_Started_with_Alfresco_Records_Management_for_Community_Edition_3_3.pdf
and enjoy!


Joseph
Software Engineer
Alliance Technologies Ltd

About Me

Melbourne, VIC, Australia
Bsc. Software Engineering