Install Jdk
sudo apt-get install sun-java6-jdk
Install Openoffice
sudo apt-get install openoffice.org
/* To prevent the X display error */
apt-get install openoffice.org-headless
Install swftools
sudo apt-get install swftools
/* The installer will ask the path for Java and Openoffice */
Download the Alfresco Labs 3c installer
Alfresco-Labs-3c-Linux-x86-Install
/* Rename the installe into .bin so it will run. */
sudo chmod +x Alfresco-Labs-3c-Linux-x86-Install
sudo mv Alfresco-Labs-3c-Linux-x86-Install Alfresco-Labs-3c-Linux-x86-Install.bin
sudo ./Alfresco-Labs-3c-Linux-x86-Install.bin
Alfresco.sh configuration
sudo vi /opt/Alfresco/alfresco.sh
export JAVA_OPTS=’-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -server’
Repository (alf_data, lucene-indexes and database)
sudo vi /opt/Alfresco/tomcat/shared/classes/alfresco/extension/custom-repository.properties
dir.root=/opt/Alfresco/alf_data
dir.indexes=/opt/Alfresco/alf_data/lucene-indexes
db.name=alfresco
db.username=alfresco
db.password=password
db.pool.initial=10
db.pool.max=100
#
# Property to control whether schema updates are performed automatically.
# Updates must be enabled during upgrades as, apart from the static upgrade scripts,
# there are also auto-generated update scripts that will need to be executed. After
# upgrading to a new version, this can be disabled.
#
db.schema.update=true
#
# Derby connection
#
#db.driver=org.apache.derby.jdbc.EmbeddedDriver
#db.url=jdbc:derby:/opt/Alfresco/alf_data/derby_data/alfresco;create=true
#
# HSQL connection
#
#hsql#db.driver=org.hsqldb.jdbcDriver
#hsql#db.url=jdbc:hsqldb:file:/opt/Alfresco/alf_data/hsql_data/alfresco;ifexists=true;shutdown=true;
#
# MySQL connection (This is default and requires mysql-connector-java-5.0.3-bin.jar, which ships with the Alfresco server)
#
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco |
dir.root=/opt/Alfresco/alf_data
dir.indexes=/opt/Alfresco/alf_data/lucene-indexes
db.name=alfresco
db.username=alfresco
db.password=password
db.pool.initial=10
db.pool.max=100
#
# Property to control whether schema updates are performed automatically.
# Updates must be enabled during upgrades as, apart from the static upgrade scripts,
# there are also auto-generated update scripts that will need to be executed. After
# upgrading to a new version, this can be disabled.
#
db.schema.update=true
#
# Derby connection
#
#db.driver=org.apache.derby.jdbc.EmbeddedDriver
#db.url=jdbc:derby:/opt/Alfresco/alf_data/derby_data/alfresco;create=true
#
# HSQL connection
#
#hsql#db.driver=org.hsqldb.jdbcDriver
#hsql#db.url=jdbc:hsqldb:file:/opt/Alfresco/alf_data/hsql_data/alfresco;ifexists=true;shutdown=true;
#
# MySQL connection (This is default and requires mysql-connector-java-5.0.3-bin.jar, which ships with the Alfresco server)
#
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco
Hibernate dialect
sudo vi /opt/Alfresco/tomcat/shared/classes/alfresco/extension/custom-hibernate-dialect.properties
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
Configuring CIFS
/* Custom Config Folder is in /opt/Alfresco/tomcat/shared/classes/alfresco/extension/ */
/* Config Folder is in /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/ */
sudo vi /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.xml
vi /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.properties
cifs.localname=${localname}
cifs.domain=SPE3CH
cifs.broadcast=255.255.255.255
vi /opt/Alfresco/tomcat/shared/classes/alfresco/extension/file-servers-custom.xml
<config evaluator=”string-compare” condition=”CIFS Server” replace=”true”>
<serverEnable enabled=”true”/>
<host name=”${cifs.localname}A” domain=”SPE3CH”/>
<comment>Alfresco CIFS Server</comment>
<broadcast>192.168.1.255</broadcast>
<tcpipSMB platforms=”linux,solaris,macosx,windows”/>
<netBIOSSMB platforms=”linux,solaris,macosx,windows”/>
<tcpipSMB port=”1445″ platforms=”linux,solaris,macosx”/>
<netBIOSSMB sessionPort=”1139″ namePort=”1137″ datagramPort=”1138″ platforms=”linux,solaris,macosx”/>
<hostAnnounce interval=”5″/>
<Win32NetBIOS/>
<Win32Announce interval=”5″/>
<authenticator type=”enterprise”>
</authenticator>
<sessionDebug flags=”Negotiate,Socket”/>
</config>
Test Alfresco CIFS
smbclient -U admin \\\\127.0.0.1\\alfresco admin
if
smbclient -U admin \\\\192.168.1.101\\alfresco admin
Error connecting to 192.168.1.101 (Connection refused)
Connection to 192.168.1.101 failed (Error NT_STATUS_CONNECTION_REFUSED)
Check if you have DNS is On. If not or you still get the error like above:
vi /etc/hosts
127.0.0.1 localhost
192.168.1.101 ubuntu unbuntua
CIFS server debugging
vi /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties log4j.logger.org.alfresco.smb.protocol=debug
Using init script
groupadd alfresco
useradd -m -g alfresco alfresco
chown -R alfresco.alfresco /opt/Alfresco
vi /opt/Alfresco/tomcat/bin/setenv.sh
export JAVA_HOME=”/usr/lib/jvm/java-6-sun”
export JAVA_OPTS=’-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -server -Djava.io.tmpdir=/opt/Alfresco/tomcat/temp’
vi /opt/Alfresco/tomcat/bin/catalina.sh
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export JRE_HOME=/usr/lib/jvm/java-6-sun export JAVA_OPTS=’-Xms1024m -Xmx1024m’
sudo vi /etc/init.d/alfresco
chmod +x /etc/init.d/alfresco
Alfresco init script
#
# Alfresco init script for Ubuntu
# 2 nov 2007 Joost Horward
#
export ALFRESCO_HOME=/opt/Alfresco
export CATALINA_BASE=/opt/Alfresco/tomcat
export CATALINA_HOME=/opt/Alfresco/tomcat
export PIDFILE=/var/run/alfresco
export LOGFILE=/opt/Alfresco/alfresco.log
# Set any default JVM values
export JAVA_OPTS='-Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -server -Djava.io.tmpdir=/opt/Alfresco/tomcat/temp'
cd "$ALFRESCO_HOME"
#
# redirect FROM TO PROTOCOL
# setup port redirect using iptables
redirect() {
echo "Redirecting port $1 to $2 ($3)"
iptables -t nat -A OUTPUT -d localhost -p $3 --dport $1 -j REDIRECT --to-ports $2
iptables -t nat -A PREROUTING -d $HOSTNAME -p $3 --dport $1 -j REDIRECT --to-ports $2
iptables -t nat -A OUTPUT -d $HOSTNAME -p $3 --dport $1 -j REDIRECT --to-ports $2
}
#
# setup_iptables
# setup iptables for redirection of CIFS and FTP
setup_iptables () {
echo "1" >/proc/sys/net/ipv4/ip_forward
# Clear NATing tables
iptables -t nat -F
# FTP NATing
redirect 21 2021 tcp
# CIFS NATing
redirect 445 1445 tcp
redirect 139 1139 tcp
redirect 137 1137 udp
redirect 138 1138 udp
}
#
# start_openoffice
#
start_openoffice(){
sudo -H -u alfresco /usr/lib/openoffice/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard &
}
case $1 in
start)
if [ -f $PIDFILE ] ; then
echo "Alfresco is already running!"
exit 1
fi
touch $PIDFILE
echo "Starting OpenOffice service ..."
start_openoffice
echo "Setting up iptables ..."
setup_iptables
echo "Starting Alfresco ..."
echo -e "\n\n\n\n\n\n\n\n\n\n`date` Starting Alfresco ..." >>$LOGFILE
sudo chown alfresco:alfresco $LOGFILE
sudo -H -u alfresco sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sudo -H -u alfresco sh $CATALINA_HOME/bin/shutdown.sh
killall -w -u alfresco
echo -e "`date` Stopping Alfresco ..." >>$LOGFILE
rm $PIDFILE
;;
restart)
rm $PIDFILE
sudo -H -u alfresco sh $CATALINA_HOME/bin/shutdown.sh
killall -w -u alfresco
echo -e "\n\n\n\n\n\n\n\n\n`date` Restarting Alfresco ..." >>$LOGFILE
sudo -H -u alfresco sh $CATALINA_HOME/bin/startup.sh
touch $PIDFILE
;;
zap)
echo "Zapping $PIDFILE ..."
rm $PIDFILE
;;
*)
echo "Usage: alfresco [start|stop|restart|zap] [tail]"
exit 1
;;
esac
case $2 in
tail)
tail -f $LOGFILE
;;
esac
exit 0 |
#
# Alfresco init script for Ubuntu
# 2 nov 2007 Joost Horward
#
export ALFRESCO_HOME=/opt/Alfresco
export CATALINA_BASE=/opt/Alfresco/tomcat
export CATALINA_HOME=/opt/Alfresco/tomcat
export PIDFILE=/var/run/alfresco
export LOGFILE=/opt/Alfresco/alfresco.log
# Set any default JVM values
export JAVA_OPTS='-Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -server -Djava.io.tmpdir=/opt/Alfresco/tomcat/temp'
cd "$ALFRESCO_HOME"
#
# redirect FROM TO PROTOCOL
# setup port redirect using iptables
redirect() {
echo "Redirecting port $1 to $2 ($3)"
iptables -t nat -A OUTPUT -d localhost -p $3 --dport $1 -j REDIRECT --to-ports $2
iptables -t nat -A PREROUTING -d $HOSTNAME -p $3 --dport $1 -j REDIRECT --to-ports $2
iptables -t nat -A OUTPUT -d $HOSTNAME -p $3 --dport $1 -j REDIRECT --to-ports $2
}
#
# setup_iptables
# setup iptables for redirection of CIFS and FTP
setup_iptables () {
echo "1" >/proc/sys/net/ipv4/ip_forward
# Clear NATing tables
iptables -t nat -F
# FTP NATing
redirect 21 2021 tcp
# CIFS NATing
redirect 445 1445 tcp
redirect 139 1139 tcp
redirect 137 1137 udp
redirect 138 1138 udp
}
#
# start_openoffice
#
start_openoffice(){
sudo -H -u alfresco /usr/lib/openoffice/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard &
}
case $1 in
start)
if [ -f $PIDFILE ] ; then
echo "Alfresco is already running!"
exit 1
fi
touch $PIDFILE
echo "Starting OpenOffice service ..."
start_openoffice
echo "Setting up iptables ..."
setup_iptables
echo "Starting Alfresco ..."
echo -e "\n\n\n\n\n\n\n\n\n\n`date` Starting Alfresco ..." >>$LOGFILE
sudo chown alfresco:alfresco $LOGFILE
sudo -H -u alfresco sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sudo -H -u alfresco sh $CATALINA_HOME/bin/shutdown.sh
killall -w -u alfresco
echo -e "`date` Stopping Alfresco ..." >>$LOGFILE
rm $PIDFILE
;;
restart)
rm $PIDFILE
sudo -H -u alfresco sh $CATALINA_HOME/bin/shutdown.sh
killall -w -u alfresco
echo -e "\n\n\n\n\n\n\n\n\n`date` Restarting Alfresco ..." >>$LOGFILE
sudo -H -u alfresco sh $CATALINA_HOME/bin/startup.sh
touch $PIDFILE
;;
zap)
echo "Zapping $PIDFILE ..."
rm $PIDFILE
;;
*)
echo "Usage: alfresco [start|stop|restart|zap] [tail]"
exit 1
;;
esac
case $2 in
tail)
tail -f $LOGFILE
;;
esac
exit 0
/etc/init.d/alfresco start
Logging
Tomcat
mkdir -p /var/log/alfresco/tomcat/logs
chown -R alfresco.alfresco /var/log/alfresco/
rm -r /opt/Alfresco/tomcat/logs
ln -s /var/log/alfresco/tomcat/logs /opt/Alfresco/tomcat/logs
Alfresco
rm /opt/Alfresco/alfresco.log
ln -s /var/log/alfresco/alfresco.log /opt/Alfresco/alfresco.log
vi /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties
log4j.appender.File.File=/var/log/alfresco/alfresco.log
Troubleshooting
Repairing a trashed install. backup your alf_data
rm -rf /opt/Alfresco/alf_data
mkdir /opt/Alfresco/alf_data
chown -R alfresco.alfresco /opt/Alfresco/alf_data
rm -rf /opt/Alfresco/tomcat/temp/Alfresco
mkdir -rf /opt/Alfresco/tomcat/temp/Alfresco
chown -R alfresco.alfresco /opt/Alfresco/tomcat/temp/Alfresco
mysql -uroot -p
drop database alfresco;
create database alfresco;
exit;
/etc/init.d/alfresco start |
rm -rf /opt/Alfresco/alf_data
mkdir /opt/Alfresco/alf_data
chown -R alfresco.alfresco /opt/Alfresco/alf_data
rm -rf /opt/Alfresco/tomcat/temp/Alfresco
mkdir -rf /opt/Alfresco/tomcat/temp/Alfresco
chown -R alfresco.alfresco /opt/Alfresco/tomcat/temp/Alfresco
mysql -uroot -p
drop database alfresco;
create database alfresco;
exit;
/etc/init.d/alfresco start
Fixing openoffice not found
vi /opt/Alfresco/tomcat/shared/classes/alfresco/extension/bootstrap/openoffice-startup-context.xml
change soffice to soffice.bin and remove the quotes
/* Fixing permission denied on soffice */
chmod -R 755 /usr/lib/openoffice/
Refreshing lucene index
rm -rf /alf_data/lucene-indexes
sudo vi /tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties
# The index recovery mode (NONE, VALIDATE, AUTO, FULL)
index.recovery.mode=FULL
Reference
Installing Alfresco on Ubuntu 7.10
Installing Alfresco on Ubuntu 8.04