Install Alfresco Community Edition

, , Leave a comment

Overview

These are the instructions I arrived at for install Alfresco Community Edition 4.0b under JBoss. Much of this is taken from the Alfreso Wiki albeit documention is soemwhat scattered and hard to find. Feel free to comment and good luck!

Create the Alfresco MySQL database and Alfresco user.

mysql -u root -padmin

cut and past the following lines or run as a script (not noted here)

create database alfresco default character set utf8 collate utf8_bin;
grant all on alfresco.* to ‘alfresco’@’localhost’ identified by ‘alfresco’ with grant option;
grant all on alfresco.* to ‘alfresco’@’localhost.localdomain’ identified by ‘alfresco’ with grant option;

Get a Copy of Alfresco and JBoss

JBoss
mkdir /opt/community
cd /opt/community
wget http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA.zip
unzip jboss-5.1.0.GA.zip

Alfresco
mkdir alf
cd alf
unzip alfresco-community-4.0.b.zip
wget http://dl.alfresco.com/release/community/build-3835/alfresco-community-4.0.b.zip

You should now see the following:

[root@ericktwo community]# pwd
/opt/community
[root@ericktwo community]# ls
alf jboss-5.1.0.GA
[root@ericktwo community]#

Move Alfresco “Extension” Diretory to JBoss

Note that the Alfresco Wiki says to create an alfresco directory under (in this example) /opt/community/jboss-5.1.0.GA/server/default/conf/alfresco though I put in the directory shown and everything works.

mv /opt/community/alf/web-server/shared/classes/alfresco/extension /opt/community/jboss-5.1.0.GA/server/default/deploy/extension

Move and Explode “WAR” files under JBoss

Note that you’re renaming “.war” to “.jar”

mv /opt/community/alf/web-server/webapps/alfresco.war
/opt/community/jjboss-5.1.0.GA/server/default/deploy/alfresco.jar

mv /opt/community/alf/web-server/webapps/share.war /opt/community/jboss-5.1.0.GA/server/default/deploy/share.jar

Make required directories

mkdir alfresco.war share.war
cd /opt/community/jboss-5.1.0.GA/server/default/deploy

Move the “.jar” files to the associated “.war” directories.

mv alfresco.jar alfresco.war
mv share.jar share.war

Change to the appropriate directories and explode the “.jar” files.

cd alfresco.war
jar -xvf alfresco.jar
cd ..
cd share.war
jar -xvf share.jar

Reduce Logging

Note that I did not modify this as directed in the Alfresco Wiki.

<root>
     <priority value="INFO" />
     <appender-ref ref="CONSOLE"/>
     <appender-ref ref="FILE"/>
  </root>

JDBC Connector

Download the appropriate MySQL Connector/J from the MySQL website: http://dev.mysql.com/downloads/connector/j/ and place in the following JBoss directory:

/opt/community/jboss-5.1.0.GA/server/default/lib

MySQL Connection Pooling

Create connection pooling by creating the file, /opt/community/jboss-5.1.0.GA/server/default/deploy/mysql-ds.xml.

Note change the name of the MySQL database, user name and passowrd to match your environment.

<local-tx-datasource>
   <jndi-name>alfresco-datasource</jndi-name>
   <connection-url>jdbc:mysql://localhost:3306/alfresco</connection-url>
   <driver-class>org.gjt.mm.mysql.Driver</driver-class>
   <user-name>alfresco</user-name>
   <password>alfresco</password>
   <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
   <metadata>
   <type-mapping>mySQL</type-mapping>
   </metadata>
 </local-tx-datasource>

UTF8 Support

Edit the following file, /opt/beta/jboss-5.1.0.GA/server/default/deploy/jbossweb.sar/server.xml. You’ll see two sections (port 8080 and port 8009) that you’ll need to append, “URIEncoding=”UTF-8”” to as shown in bold.

Note that the Alfresco Wiki also says to modify, /opt/beta/jboss-5.1.0.GA/server/all/deploy/jbossweb.sar/server.xml as well though I did not do this for my install and everything appears to work.

<!-- A HTTP/1.1 Connector on port 8080 -->
   <Connector protocol="HTTP/1.1" port="8080" URIEncoding="UTF-8" address="${jboss.bind.address}"
            connectionTimeout="20000" redirectPort="8443" />
<!-- A AJP 1.3 Connector on port 8009 -->
   <Connector protocol="AJP/1.3" port="8009" URIEncoding="UTF-8" address="${jboss.bind.address}"
      redirectPort="8443" />

Hibernate

Edit the file,
/opt/community/jboss-5.1.0.GA/server/default/deployers/ejb3.deployer/META-INF/jpa-deployers-jboss-beans.xml

<entry>
<key>hibernate.bytecode.provider</key>
<value>cglib</value>
</entry>

Create Alfresco Global Properties

Create the file, /opt/community/jboss-5.1.0.GA/server/default/conf/alfresco-global.properties as shown below. Ensure that the “dir.root” directory and “dir.contentstore” directories exist. You can refer to the previous section, “MySQL Connection Pooling” above as the database name, database user and password should match the file, mysql-ds.xml.

Refer to the following website in obtaining Open Office, http://download.openoffice.org/other.html.

dir.root=/opt/alfresco/alf_data
dir.indexes=${dir.root}/lucene-indexes
dir.contentstore=/opt/alf_file_share/contentstore
dir.contentstore.deleted=/opt/alf_file_share/contentstore.deleted
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.pool.initial=10
db.pool.max=100
ooo.exe=/opt/openoffice.org3
ooo.enabled=false
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost:3306/${db.name}
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
index.recovery.mode=FULL
mail.host=smtp.lifeway.org
mail.port=25
cifs.enabled=true
cifs.serverName=alfresco-dev
cifs.ipv6.enabled=false
img.root=/usr/local/ImageMagick-6.6.9-10
swf.exe=/usr/local/swftools-0.9.0/bin

Edit Startup Options

Edit the file /opt/community/jboss-5.1.0.GA/bin/run.conf. to include JMX monitoring and automatic discovery of Alfresco by the Hyperic plugin. Add the section shown in bold to the “JAVA_OPTS” parameter.

JAVA_OPTS="-Xms256m -Xmx1024m -XX:MaxPermSize=512m -Dorg.jboss.resolver.warning=true -Dcom.sun.management.jmxremote -Dalfresco.home=. -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

Also ensure that the following minimum values shown below as related to the Java heap. Modiy the “JAVA_OPTS” parameter shown above if requrired.

-Xms128m -Xmx512m -XX:MaxPermSize=128m

Edit the Filter Packages

Edit the file, /opt/community/jboss-5.1.0.GA/server/default/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml and replace the “WarClassLoaderDeployer” section with the following. This will avoid collisions between JVM bootstrap classes and those embedded in the “war”.

<bean name="WarClassLoaderDeployer" class="org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer">
    <property name="relativeOrder">-1</property>
    <property name="filteredPackages">javax.activation,javax.servlet,javax.servlet.jsp,javax.servlet.jsp.jstl,javax.servlet.jsp.jstl.core,javax.servlet.jsp.jstl.fmt,javax.servlet.jsp.jstl.sql,javax.servlet.jsp.jstl.tlv,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.messaging,javax.xml.namespace,javax.xml.parsers,javax.xml.rpc,javax.xml.rpc.encoding,javax.xml.rpc.handler,javax.xml.rpc.handler.soap,javax.xml.rpc.holders,javax.xml.rpc.server,javax.xml.rpc.soap,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.ws.wsaddressing,javax.xml.xpath,org.apache.commons.logging,org.apache.commons.logging.impl,org.apache.xerces,org.apache.xerces.dom,org.apache.xerces.dom.events,org.apache.xerces.dom3,org.apache.xerces.dom3.as,org.apache.xerces.impl,org.apache.xerces.impl.dtd,org.apache.xerces.impl.dtd.models,org.apache.xerces.impl.dv,org.apache.xerces.impl.dv.dtd,org.apache.xerces.impl.dv.util,org.apache.xerces.impl.dv.xs,org.apache.xerces.impl.io,org.apache.xerces.impl.msg,org.apache.xerces.impl.validation,org.apache.xerces.impl.xpath,org.apache.xerces.impl.xpath.regex,org.apache.xerces.impl.xs,org.apache.xerces.impl.xs.identity,org.apache.xerces.impl.xs.models,org.apache.xerces.impl.xs.opti,org.apache.xerces.impl.xs.traversers,org.apache.xerces.impl.xs.util,org.apache.xerces.jaxp,org.apache.xerces.jaxp.datatype,org.apache.xerces.jaxp.validation,org.apache.xerces.parsers,org.apache.xerces.util,org.apache.xerces.xinclude,org.apache.xerces.xni,org.apache.xerces.xni.grammars,org.apache.xerces.xni.parser,org.apache.xerces.xpointer,org.apache.xerces.xs,org.apache.xerces.xs.datatypes,org.apache.xml,org.apache.xml.resolver,org.apache.xml.resolver.apps,org.apache.xml.resolver.etc,org.apache.xml.resolver.etc.catalog.dtd,org.apache.xml.resolver.etc.catalog.rng,org.apache.xml.resolver.etc.catalog.xsd,org.apache.xml.resolver.etc.xcatalog.dtd,org.apache.xml.resolver.helpers,org.apache.xml.resolver.readers,org.apache.xml.resolver.tools,org.apache.xml.security,org.apache.xml.security.algorithms,org.apache.xml.security.algorithms.implementations,org.apache.xml.security.c14n,org.apache.xml.security.c14n.helper,org.apache.xml.security.c14n.implementations,org.apache.xml.security.encryption,org.apache.xml.security.exceptions,org.apache.xml.security.keys,org.apache.xml.security.keys.content,org.apache.xml.security.keys.content.keyvalues,org.apache.xml.security.keys.content.x509,org.apache.xml.security.keys.keyresolver,org.apache.xml.security.keys.keyresolver.implementations,org.apache.xml.security.keys.storage,org.apache.xml.security.keys.storage.implementations,org.apache.xml.security.resource,org.apache.xml.security.resource.schema,org.apache.xml.security.signature,org.apache.xml.security.transforms,org.apache.xml.security.transforms.implementations,org.apache.xml.security.transforms.params,org.apache.xml.security.utils,org.apache.xml.security.utils.resolver,org.apache.xml.security.utils.resolver.implementations,org.apache.xml.serialize,org.apache.xmlcommons,org.xml,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,org.w3c.css,org.w3c.css.sac,org.w3c.css.sac.helpers,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.smil,org.w3c.dom.stylesheets,org.w3c.dom.svg,org.w3c.dom.traversal,org.w3c.dom.views,org.w3c.dom.xpath</property>
 

Leave a Reply