Alfresco On CentOS 5 with PosgtreSQL

Downloads:

wget \
http://switch.dl.sourceforge.net/sourceforge/alfresco/alfresco-labs-war-3a.1032.tar.gz \
http://switch.dl.sourceforge.net/sourceforge/alfresco/alfresco-labs-sample-extensions-3a.1032.tar.gz \
http://kent.dl.sourceforge.net/sourceforge/alfresco/alfresco-labs-wcm-3a.1032.tar.gz \
http://kent.dl.sourceforge.net/sourceforge/alfresco/alfresco-labs-sp-emulation.1032.zip \
http://switch.dl.sourceforge.net/sourceforge/alfresco/alfresco-mmt-3a.1032.jar \
http://kent.dl.sourceforge.net/sourceforge/alfresco/alfresco-labs-tomcat-3a.1032.tar.gz \
http://download.softagency.net/MySQL/Downloads/Connector-J/mysql-connector-java-5.1.6.tar.gz \
http://jdbc.postgresql.org/download/postgresql-8.3-603.jdbc4.jar \
ftp://ftp.pbone.net/mirror/dag.wieers.com/packages/swftools/swftools-0.8.1-1.el5.rf.i386.rpm \
ftp://ftp.pbone.net/mirror/atrpms.net/sl5-i386/atrpms/stable/libmp3lame0-3.98.2-18.el5.i386.rpm

Installing EPEL repository

# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm

Additional Packages to be installed:

Installing flash tools

$ yum install t1lib giflib
$ yum -y localinstall libmp3lame0-3.98.2-18.el5.i386.rpm --nogpgcheck
$ yum -y localinstall swftools-0.8.1-1.el5.rf.i386.rpm --nogpgcheck

Installing java and jdbc drivers:

$ yum install java-1.6.0-openjdk postgresql-jdbc

Configuring PostgreSQL Server

Start postgresql server

$ service postgresql start

Configure postgresql server to use password authentications

As user postgres edit file /var/lib/pgsql/data/pg_hba.conf and change the lines to look like:

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
local   all         all                               password
host    all         all         127.0.0.1/32           password
host    all         all         ::1/128               password

As user root restart postgresql server.

$ service postgresql restart

As user postgres create database and user for alfresco

$ createuser -S -D -R -l -P -E
$ createdb -E UTF-8 -O alfresco alfresco

Configuring TOMCAT5 server

Edit /etc/tomcat5/server.xml and comment out next lines:

<!--- disable the listener to avoid the warning during shutdown
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
-->

....
    <!-- Define an AJP 1.3 Connector on port 8009 
    <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
     -->

Edit /etc/sysconfig/tomcat5 and set:

JAVA_HOME="/usr/lib/jvm/jre-1.6.0-openjdk"
...
### At the end of the file add:
# Alfresco requirements:
JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx512m"

Additional Configuration for tomcat:

$ cd /usr/share/java
$ rebuild-jar-repository /var/lib/tomcat5/common/endorsed xalan-j2-serializer-2.7.0.jar
$ rebuild-jar-repository /var/lib/tomcat5/common/endorsed xalan-j2-2.7.0.jar
$ rebuild-jar-repository /var/lib/tomcat5/common/endorsed postgresql-jdbc-8.1.407.jar

Installing and configuring alfresco.

Preparing installation

$ mkdir /tmp/alfresco-war
$ cd /tmp/alfresco-war
$ tar zxf /root/Download/alfresco-labs-war-3b.tar.gz
$ mkdir /tmp/alfresco
$ cd /tmp/alfresco
$ jar xf /tmp/alfresco-war/alfresco.war

Configuring alfresco war log settings

Edit file /tmp/alfresco/WEB-INF/classes/log4j.properties and set next option in file:

log4j.appender.File.File=/var/log/tomcat5/alfresco.log

Configuring alfresco war CIFS settings:

Edit file /tmp/alfresco/WEB-INF/classes/alfresco/file-servers.properties

cifs.domain=TESTDOMAIN

And then you edit file /tmp/alfresco/WEB-INF/classes/alfresco/file-servers.xml and uncomment next lines:
<tcpipSMB port="1445" platforms="linux,solaris,macosx"/>
<netBIOSSMB sessionPort="1139" namePort="1137" datagramPort="1138" platforms="linux,solaris,macosx"/>

Configuring alfresco EXACT_LANGUAGE_AND_ALL logging:

Edit file /tmp/alfresco/WEB-INF/classes/alfresco/core-services-context.xml and comment out nex values which you will meet twice in the file and you have to comment out them both:

<!--
                <property name="defaultMLIndexAnalysisMode">
           <value>EXACT_LANGUAGE</value>
       </property>
               <property name="defaultMLSearchAnalysisMode">
           <value>EXACT_LANGUAGE</value>
       </property>   
          -->

Recreate alfresco war file:

$ pwd
# /tmp/alfresco
$ jar cf /tmp/alfresco.war *

Installing vti-module.amp module to alfresco war file

$ cp /Download/alfresco-mmt-3a.1032.jar /tmp
$ cd /tmp
$ mkdir /tmp/alfresco-sp
$ cd /tmp/alfresco-sp
$ unzip /Download/alfresco-labs-sp-emulation.1032.zip
$ cd /tmp
$ java -jar alfresco-mmt-3a.1032.jar install /tmp/alfresco-sp/vti-module.amp alfresco.war

Installing alfresco shared classes into tomcat

$ cd /var/lib/tomcat5/shared/classes
$ tar zxf /Download/alfresco-labs-sample-extensions-3b.tar.gz
$ cd /var/lib/tomcat5/shared/classes/alfresco/extension
$ cp custom-repository-context.xml.sample custom-repository-context.xml
$ cp custom-repository.properties.sample custom-repository.properties
$ cp custom-hibernate-dialect.properties.sample custom-hibernate-dialect.properties

Configuring alfresco shared classes:

Edit file /var/lib/tomcat5/shared/classes/alfresco/extension/custom-repository.properties

dir.root=/var/lib/alfresco/alf_data
...
db.username=alfresco
db.password=alfresco
db.pool.initial=10
db.pool.max=100
...
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco

Configure alfreso postgresql hibernate settings:

edit file /var/lib/tomcat5/shared/classes/alfresco/extension/custom-hibernate-dialect.properties

hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.query.substitutions=true TRUE, false FALSE

Configuring alfresco datastore:

$ mkdir -p /var/lib/alfresco/alf_data
$ chown -R tomcat:tomcat /var/lib/alfresco

Installing alfresco.war file into tomcat

cp /tmp/alfresco.war /var/lib/tomcat5/webapps/

Starting OpenOffice.org as a service:

$ /usr/lib/openoffice.org/program/soffice \
"-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" \
-nologo -headless -nofirststartwizard

Configure Firewall

echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 445 -j REDIRECT --to-ports 1445
iptables -t nat -A PREROUTING -p tcp --dport 139 -j REDIRECT --to-ports 1139
iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 1137
iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 1138

Starting Tomcat

$ service tomcat5 start
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License