Step by step installation of Liferay 6.1.1 CE GA2 on Ubuntu 12.04 LTS 64bit and JBoss 7… no bundle please!

liferay-logoIn this post is shared the installation of Liferay 6.1.1 Community Edition GA2 on Ubuntu 12.04 LTS 64bit with JBoss Application Server 7.1 Community Edition and PostgreSQL 8.4.15. The purpose installation is not the bundle one but the more “robust” alternative for an enterprise configuration.

As we like and prefer, the installation is a step by step list of commands and tasks… simpler to understand, to do and to test. Hope you’ll be agree.

Sources

In this paragraph are collected the used sources for the installation. I suggest to download and store them in a safe repository for future purposes (re-installation, maintainance, etc.).

Creation of a Virtual Machine with Ubuntu 12.04 LTS – 64bit – Desktop

For development purpose you should create your own environment on a virtual machine useful to customizations and tests. Of course if you are in a production environment you can jump directly to the next paragraph talking about the JDK installation.

In this case we use the Oracle VirtualBox as virtualization product but nothing should happen if you prefer VMPlayer or other solutions.

As first step, create the virtual machine with at least 2Gb RAM and start it using the ‘ubuntu-12.04.1-desktop-amd64.iso’ file. During the installation you receive some easy questions, driving you in the installation task.

Below some suggestions:

  • Admit downloading and installation of third party software and update during installation.
  • Machine name: liferay
  • Password: liferay
  • Launch update manager and reboot (more times until no update or errors). This task is not mandatory but suggested.
  • VirtualBoxMenu -> Devices -> Install Guest Additions
  • Open a terminal and execute:
sudo apt-get update
  • VirtualBoxMenu -> Devices -> Shared folders -> Add a new folder called ‘Desktop’ linked to your desktop.
  • Execute in the terminal:
sudo mount -t vboxsf Desktop /mnt
ls -la /mnt

The last command is done to check everything is properly set.

Java 1.7u9

  • Execute in the terminal:
sudo mkdir -p /opt/java
sudo chown liferay:liferay /opt/java
sudo cp -r /mn/.../jdk-7u9-linux-x64.tar.gz /opt/java
cd /opt/java
gunzip jdk-7u9-linux-x64.tar.gz
tar xvf jdk-7u9-linux-x64.tar
rm jdk-7u9-linux-x64.tar
sudo nano /etc/profile.d/java.sh

.

export JAVA_HOME=/opt/java/jdk1.7.0_09
export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
  • Exit saving the file content.
  • Exit from the user session (disconnect the user session) and reconnect again to receive the changes.
  • Open a terminal and execute the commands below to test if everything is properly set.
java -version
javac -version

Postgresql 8.4.15

We always prefer to compile PostgreSQL from the sources to have a full control of the installation and customizations.

  • Execute in the terminal:
sudo mkdir -p /opt/postgresql
sudo chown liferay:liferay /opt/postgresql
sudo cp /mnt/.../postgresql-8.4.15.tar.gz /opt/postgresql
cd /opt/postgresql
gunzip postgresql-8.4.15.tar.gz
tar xvf postgresql-8.4.15.tar
rm postgresql-8.4.15.tar
mkdir -p /opt/postgresql/8.4.15
cd /opt/postgresql/postgresql-8.4.15/
sudo apt-get install libreadline-dev
sudo apt-get install zlib1g-dev
./configure exec_prefix=/opt/postgresql/8.4.15
sudo make exec_prefix=/opt/postgresql/8.4.15
sudo make install exec_prefix=/opt/postgresql/8.4.15
  • Let’s create the data directory to store all data files and some configurations comprise defining the postgres user.
mkdir /opt/postgresql/8.4.15/data
mkdir /opt/postgresql/8.4.15/log
sudo adduser postgres
  • Use ‘postgres’. Other informations are optional.
sudo chown -R postgres:postgres /opt/postgresql
 su - postgres
  • Digit the password ‘postgres’.
nano .environment-8.4.15

.

export POSTGRES_VERSION=8.4.15
export LD_LIBRARY_PATH=/opt/postgres/${POSTGRES_VERSION}/lib
export PATH=/opt/postgres/${POSTGRES_VERSION}/bin:${PATH}
  • Exit from the editor saving the file content.
chmod 777 .environment-8.4.15
. .environment-8.4.15
/opt/postgresql/8.4.15/bin/initdb -D /opt/postgresql/8.4.15/data/ --encoding=UNICODE
exit
  • Back to the liferay user, let’s define some scripts used to manage the services.
sudo nano /etc/init.d/postgresql.8.4.15

.

case "$1" in

start)
 echo "Starting postgres"
 /bin/su - postgres -c "/home/postgres/postgresql-8.4.15 start"
 ;;
stop)
 echo "Stopping postgres"
 /bin/su - postgres -c "/home/postgres/postgresql-8.4.15 stop"
 ;;
* )
 echo "Usage: /sbin/service postgresql.8.4.15 {start|stop}"
 exit 1

esac

exit 0
  • Exit from the editor saving the file content.
sudo chmod 777 /etc/init.d/postgresql.8.4.15
su - postgres
  • Digit the password ‘postgres’.
. .environment-8.4.15
nano /home/postgres/postgresql-8.4.15

.

# Parameters: start or stop.
export POSTGRES_VERSION=8.4.15
# Check parameter.
if [ "$1" != "start" ] && [ "$1" != "stop" ]; then
 echo "Specify start or stop as first parameter."
 exit
fi

# Add stop switch.
__STOP_SWITCH=""
if [ "$1" = "stop" ]; then
 __STOP_MODE="smart"
 __STOP_SWITCH="-m $__STOP_MODE"
 echo "Stop switch is: $__STOP_SWITCH"

fi

# Do it.
export LD_LIBRARY_PATH=/opt/postgresql/${POSTGRES_VERSION}/lib
~/.environment-${POSTGRES_VERSION}
/opt/postgresql/${POSTGRES_VERSION}/bin/pg_ctl \
    -D /opt/postgresql/${POSTGRES_VERSION}/data \
    -l /opt/postgresql/${POSTGRES_VERSION}/log/postgresql.log \
    $1 $__STOP_SWITCH

# Alternative command.
# /opt/postgresql/${POSTGRES_VERSION}/bin/postgres -D /opt/postgresql/${POSTGRES_VERSION}/data
  • Exit from the editor saving the file content.
chmod 777 /home/postgres/postgresql-8.4.15
service postgresql.8.4.15 start
exit
  • Back to the liferay user, let’s create the database used from liferay.
su - postgres
  • Digit the password ‘postgres’.
. .environment-8.4.15
/opt/postgresql/8.4.15/bin/psql

.

CREATE ROLE liferay WITH PASSWORD 'liferay' LOGIN;
CREATE DATABASE lportal WITH OWNER liferay;
<ctrl> + d

.

/opt/postgresql/8.4.15/bin/psql -U liferay -d lportal
ALTER USER liferay WITH PASSWORD 'liferay';
<ctrl> + d

.

exit
  • Back to the liferay user.

JBoss AS 7.1 CE

Now it’s time to install JBoss Application Server Community Edition.

sudo mkdir /opt/liferay
sudo chown liferay:liferay /opt/liferay
cp /mnt/.../jboss-as-7.1.1.Final.tar.gz /opt/liferay
cd /opt/liferay
tar -xvf jboss-as-7.1.1.Final.tar.gz
rm -rf jboss-as-7.1.1.Final.tar.gz
sudo chown -R liferay:liferay /opt/liferay
mv /opt/liferay/jboss-as-7.1.1.Final /opt/liferay/jboss
cd /opt/liferay/jboss/bin
./add-user.sh

.

What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a

We select “a”, next you should see the following message:

Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : jboss
Password : jb0ss
Re-enter Password : jb0ss
  • Done! Let’s start JBoss to test everything is working properly.
/opt/liferay/jboss/bin/standalone.sh -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0 &
/opt/liferay/jboss/bin/jboss-cli.sh --connect command=:shutdown

Liferay 6.1.1 Community Edition GA2 on JBoss

Not many documentations are well done like the Liferay ones. To this link the steps for JBoss installation of Liferay.

mkdir -p /opt/liferay/jboss/modules/com/liferay/portal/main
cd /opt/liferay/jboss/modules/com/liferay/portal/main
cp /mnt/.../liferay-portal-dependencies-6.1.1-ce-ga2-...zip .
unzip liferay-portal-dependencies-6.1.1-ce-ga2-...zip
rm -rf liferay-portal-dependencies-6.1.1-ce-ga2-...zip
mv liferay-portal-dependencies-6.1.1-ce-ga2/* .
rm -rf liferay-portal-dependencies-6.1.1-ce-ga2
cp /mnt/.../postgresql-8.4-703.jdbc4.jar .
nano /opt/liferay/jboss/modules/com/liferay/portal/main/module.xml

.

<?xml version="1.0"?>
<module xmlns="urn:jboss:module:1.0" name="com.liferay.portal">
    <resources>
       <resource-root path="postgresql-8.4-703.jdbc4.jar" />
       <resource-root path="portal-service.jar" />
       <resource-root path="portlet.jar" />
    </resources>
    <dependencies>
       <module name="javax.api" />
       <module name="javax.mail.api" />
       <module name="javax.servlet.api" />
       <module name="javax.servlet.jsp.api" />
       <module name="javax.transaction.api" />
    </dependencies>
</module>
  • Exit from the editor saving the file content.
nano /opt/liferay/jboss/modules/sun/jdk/main/module.xml

.

<!-- Add -->
<path name="com/sun/crypto"/>
<path name="com/sun/crypto/provider"/>
  • Exit from the editor saving the file content.
nano /opt/liferay/jboss/standalone/configuration/standalone.xml

.

...
<!-- Set the attribute with this value -->
... enable-welcome-root="false" ...
...
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
  <datasources>
    <!-- Comment the hsql datasource -->
    <datasource jndi-name="java:jboss/datasources/PostgreSQLDS" enabled="true" use-java-context="true" pool-name="PostgreSQLDS" use-ccm="true">
      <connection-url>jdbc:postgresql://localhost:5432/lportal</connection-url>
      <driver>postgresql</driver>
      <security>
        <user-name>liferay</user-name>
        <password>liferay</password>
      </security>
    </datasource>
    ...
  </datasources>
  <drivers>
    ...
    <!-- Comment the hsql driver -->
    <driver name="postgresql" module="com.liferay.portal">
      <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
    </driver>
    ...
  </drivers>
...
<subsystem xmlns="urn:jboss:domain:web:1.1" ... >
  ...
  <!-- Add this -->
  <configuration>
    <jsp-configuration development="true" />
  </configuration>
</subsystem>
...
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1" ... >
  <deployment-scanner ... deployment-timeout="120"/>
</subsystem>
...
<subsystem xmlns="urn:jboss:domain:security:1.1" ... >
  <security-domains>
    ...
    <security-domain name="PortalRealm">
      <authentication>
        <login-module code="com.liferay.portal.security.jaas.PortalLoginModule" flag="required"/>
      </authentication>
    </security-domain>
    ...
  </security-domains>
</subsystem>
...
  • Exit from the editor saving the file content.
nano /opt/liferay/jboss/bin/standalone.conf

.

...
# Append at the end.
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"

# ATTENTION: Remove from JAVA_OPTS the params defined before (if any).
...
  • Exit from the editor saving the file content.
mkdir -p /opt/liferay/jboss/standalone/deployments/ROOT.war
cd /opt/liferay/jboss/standalone/deployments/ROOT.war
cp /mnt/.../liferay-portal-6.1.1-ce-ga2-...war .
jar -xf liferay-portal-6.1.1-ce-ga2-...war
rm -rf liferay-portal-6.1.1-ce-ga2-...war
touch ../ROOT.war.dodeploy
rm -rf /opt/liferay/jboss/standalone/deployments/ROOT.war/WEB-INF/lib/eclipselink.jar
nano /opt/liferay/jboss/standalone/deployments/ROOT.war/WEB-INF/classes/portal-ext.properties

.

jdbc.default.jndi.name=java:jboss/datasources/PostgreSQLDS
  • Exit from the editor saving the file content.
nano /opt/liferay/portal-setup-wizard.properties

.

setup.wizard.enabled=false
  • Exit from the editor saving the file content.
  • Now it’s the time to start JBoss for the first time with Liferay. Could happen a failed deploy because of timeout of 120 seconds. In that case don’t worry… stop and restart again, everything will work properly!
/opt/liferay/jboss/bin/standalone.sh -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0 &
/opt/liferay/jboss/bin/jboss-cli.sh --connect command=:shutdown
sudo nano /etc/init.d/liferay

.

case "$1" in

start)
 /bin/su - liferay -c "/opt/liferay/jboss/bin/standalone.sh -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0 &"
 ;;
stop)
 /bin/su - liferay -c "/opt/liferay/jboss/bin/jboss-cli.sh --connect command=:shutdown"
 ;;
* )
 echo "Usage:service liferay {start|stop}"
 exit 1

esac

exit 0
  • Exit from the editor saving the file content.
sudo chmod 777 /etc/init.d/liferay
service liferay start

My personal compliments… Liferay on JBoss and PostgreSQL is installed with success!

Advertisements

Alfresco Audit Analysis and Reporting (A.A.A.R.)

Who is using the Alfresco E.C.M.?
Which are the most viewed contents in the Alfresco E.C.M. last week?
Who are the most active users in the Alfresco E.C.M. in the last quarter?
Which is the created content during last week? And during last month?
Which is the most accessed content of the last month?
How many failed login?

These are only some of the questions that are often done about an Alfresco E.C.M. and is well known that Alfresco has not a powered reporting system (and honestly is not it’s job). Unfortunately the need is still there and most of the answers are tricky solutions, quite hard to manage and scale. By the way Alfresco E.C.M. has a detailed audit service that exposes a lot of (potentially) useful informations.

alfresco-pentaho

With this post I would like to introduce Alfresco Audit Analysis and Reporting (A.A.A.R.) solution, published in the Alfresco Addon and Google Code and realeased under LGPLv3 license.

Read more >>

Step by step installation of Alfresco Community 4.2.c on Ubuntu 12.04 LTS minimal 64bit… please, no bundle!

Alfresco Community 4.2.cIn this post is shared the installation of Alfresco Community 4.2.c on Ubuntu 12.04 LTS minimal 64bit with Apache Tomcat 7.0.30 and PostgreSQL 9.0.4. The purpose installation is not the bundle installation but a more “robust” for an enterprise configuration. As we like and prefer the installation is a step by step list of commands and tasks… simpler to understand, to do and to test. Hope you’ll be agree.

Before stating…

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get purge openjdk-\*
  • adduser alfresco
Enter new UNIX password: alfresco
  • adduser postgres
Enter new UNIX password: postgres
  • sudo adduser alfresco sudo
  • sudo adduser postgres sudo
  • su – alfresco
  • sudo mkdir -p /opt/alfresco
  • sudo chown alfresco:alfresco /opt/alfresco
  • sudo mkdir -p /opt/postgresql
  • sudo chown postgres:postgres /opt/postgresql

JDK 1.7u7

http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • mkdir -p /opt/alfresco/java
  • Get ‘jdk-7u7-linux-x64.tar.gz’ in ‘/opt/alfresco/java’ with owner alfresco (use chown command) and ‘execute’ permits (use chmod command).
  • tar xvzf jdk-7u7-linux-x64.tar.gz
  • chown -R alfresco:alfresco jdk1.7.0_07
  • rm -rf jdk-7u7-linux-x64.tar.gz
  • sudo nano /etc/profile.d/java.sh
export JAVA_HOME=/opt/alfresco/java/jdk1.7.0_07
export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
  • Exit
  • su – alfresco
  • java -version
  • javac -version

ImageMagick

  • sudo apt-get install ghostscript
  • sudo apt-get install imagemagick
  • whereis convert
  • convert –version

FFMpeg

  • sudo apt-get install ffmpeg
  • whereis ffmpeg
  • ffmpeg

LibreOffice

  • sudo apt-get install libreoffice
  • whereis soffice
  • soffice –version (suggested v3.5)

SWFTools

PostgreSQL 9.0.4

  • su – postgres
  • cd /opt/postgresql
  • wget ftp://ftp.postgresql.org/pub/source/v9.0.4/postgresql-9.0.4.tar.gz
  • chmod a+x postgresql-9.0.4.tar.gz
  • gunzip postgresql-9.0.4.tar.gz
  • tar xvf postgresql-9.0.4.tar
  • rm -rf postgresql-9.0.4.tar
  • sudo apt-get install gcc libreadline-dev bison flex zlib1g-dev make
  • mkdir /opt/postgresql/9.0.4
  • cd /opt/postgresql/postgresql-9.0.4/
  • ./configure exec_prefix=/opt/postgresql/9.0.4
  • make exec_prefix=/opt/postgresql/9.0.4
  • sudo make install exec_prefix=/opt/postgresql/9.0.4
  • sudo chown -R postgres:postgres /opt/postgresql/9.0.4
  • mkdir /opt/postgresql/9.0.4/data
  • mkdir /opt/postgresql/9.0.4/log
  • nano /home/postgres/.environment-9.0.4
#!/bin/sh

export POSTGRESQL_VERSION=9.0.4
export LD_LIBRARY_PATH=/opt/postgresql/${POSTGRESQL_VERSION}/lib
export PATH=/opt/postgresql/${POSTGRESQL_VERSION}/bin:${PATH}
  • chmod a+x /home/postgres/.environment-9.0.4
  • /home/postgres/.environment-9.0.4
  • /opt/postgresql/9.0.4/bin/initdb -D /opt/postgresql/9.0.4/data/ –encoding=UNICODE
  • nano /home/postgres/postgresql-9.0.4
#!/bin/sh -e

# Parameters: start or stop.
export POSTGRESQL_VERSION=9.0.4

# Check parameter.
if [ "$1" != "start" ] && [ "$1" != "stop" ]; then
  echo "Specify start or stop as first parameter."
  exit
fi

# Add stop switch.
__STOP_SWITCH=""
if [ "$1" = "stop" ]; then
  __STOP_MODE="smart"
  __STOP_SWITCH="-m $__STOP_MODE"
  echo "Stop switch is: $__STOP_SWITCH"
fi

# Do it.
export LD_LIBRARY_PATH=/opt/postgresql/${POSTGRESQL_VERSION}/lib
~/.environment-${POSTGRESQL_VERSION}
/opt/postgresql/${POSTGRESQL_VERSION}/bin/pg_ctl \
     -D /opt/postgresql/${POSTGRESQL_VERSION}/data \
     -l /opt/postgresql/${POSTGRESQL_VERSION}/log/postgresql.log \
     $1 $__STOP_SWITCH
  • The command ‘~/.environment-${POSTGRESQL_VERSION}’ could not work. Use ‘. .environment-${POSTGRESQL_VERSION}’ instead.
  • chmod a+x /home/postgres/postgresql-9.0.4
  • exit
  • sudo nano /etc/init.d/postgresql.9.0.4
#!/bin/sh -e

case "$1" in

 start)
  echo "Starting postgres"
  /bin/su - postgres -c "/home/postgres/postgresql-9.0.4 start"
  ;;
 stop)
  echo "Stopping postgres" 
  /bin/su - postgres -c "/home/postgres/postgresql-9.0.4 stop"
  ;;
 * )
  echo "Usage: service postgresql-9.0.4 {start|stop}"
  exit 1

esac

exit 0
  • sudo chmod a+x /etc/init.d/postgresql.9.0.4
  • service postgresql.9.0.4 start

Schema creation (user: alfresco, password: alfresco, schema: alfresco)

  • su – postgres
  • . .environment-9.0.4
  • psql
  • CREATE ROLE alfresco WITH PASSWORD ‘alfresco’ LOGIN;
  • CREATE DATABASE alfresco WITH OWNER alfresco;
  • ctrl+d
  • psql -U alfresco -d alfresco
  • ALTER USER alfresco WITH PASSWORD ‘alfresco’;
  • ctrl+d
  • exit.

Tomcat 7.0.30

http://tomcat.apache.org/

  • cd /opt/alfresco
  • Download ‘Tomcat 7.0’ -> Quick Navigation -> Archives -> 7.0.30 -> bin -> apache-tomcat-7.0.30.tar.gz
  • wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.30/bin/apache-tomcat-7.0.30.tar.gz
  • chmod a+x apache-tomcat-7.0.30.tar.gz
  • tar -xvf apache-tomcat-7.0.30.tar.gz
  • rm -rf apache-tomcat-7.0.30.tar.gz
  • mv apache-tomcat-7.0.30 /opt/alfresco/tomcat
  • /opt/alfresco/tomcat/bin/startup.sh
  • ps -ef | grep java or http://localhost:8080 on the browser
  • /opt/alfresco/tomcat/bin/shutdown.sh
  • cp /opt/alfresco/tomcat/conf/catalina.properties /opt/alfresco/tomcat/conf/catalina.properties.orig
  • nano /opt/alfresco/tomcat/conf/catalina.properties
  • Add ‘shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar’
  • cp /opt/alfresco/tomcat/conf/server.xml /opt/alfresco/tomcat/conf/server.xml.orig
  • nano /opt/alfresco/tomcat/conf/server.xml
  • Add ‘URIEncoding=”UTF-8″‘ to ‘<Connector port=”8080″ protocol=”HTTP/1.1″…’.
  • nano /opt/alfresco/tomcat/conf/context.xml
  • Add:
<Valve className="org.apache.catalina.authenticator.SSLAuthenticator" securePagesWithPragma="false" />

Alfresco 4.2.c

  • mkdir /opt/alfresco/tomcat/shared
  • mkdir /opt/alfresco/tomcat/shared/classes
  • mkdir /opt/alfresco/tomcat/shared/lib
  • mkdir /opt/alfresco/tomcat/endorsed
  • wget http://dl.alfresco.com/release/community/build-04576/alfresco-community-4.2.c.zip
  • chmod a+x alfresco-community-4.2.c.zip
  • sudo apt-get install unzip
  • unzip alfresco-community-4.2.c.zip
  • mv web-server/endorsed/* /opt/alfresco/tomcat/endorsed
  • mv web-server/shared/* /opt/alfresco/tomcat/shared
  • mv web-server/lib/* /opt/alfresco/tomcat/lib
  • mv web-server/webapps/* /opt/alfresco/tomcat/webapps/
  • rm -rf README.txt
  • rm -R web-server/
  • rm -rf alfresco-community-4.2.c.zip
  • nano /opt/alfresco/start_oo.sh
#!/bin/sh -e

SOFFICE_ROOT=/usr/bin
"${SOFFICE_ROOT}/soffice" "--accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" --nologo --headless &
  • chmod uga+x /opt/alfresco/start_oo.sh
  • /opt/alfresco/start_oo.sh
  • killall soffice.bin
  • nano /opt/alfresco/alfresco.sh
#!/bin/sh -e

# Start or stop Alfresco server

# Set the following to where Tomcat is installed
ALF_HOME=/opt/alfresco
cd "$ALF_HOME"
APPSERVER="${ALF_HOME}/tomcat"
export CATALINA_HOME="$APPSERVER"

# Set any default JVM values
export JAVA_OPTS='-Xms512m -Xmx768m -Xss768k -XX:MaxPermSize=256m -XX:NewSize=256m -server'
export JAVA_OPTS="${JAVA_OPTS} -Dalfresco.home=${ALF_HOME} -Dcom.sun.management.jmxremote"

if [ "$1" = "start" ]; then
 "${APPSERVER}/bin/startup.sh"
 if [ -r ./start_oo.sh ]; then
  "${ALF_HOME}/start_oo.sh"
 fi
elif [ "$1" = "stop" ]; then
 "${APPSERVER}/bin/shutdown.sh"
 killall -u alfresco java
 killall -u alfresco soffice.bin
fi
  • chmod uga+x /opt/alfresco/alfresco.sh
  • sudo nano /etc/init.d/alfresco
#!/bin/sh -e

ALFRESCO_SCRIPT="/opt/alfresco/alfresco.sh"

if [ "$1" = "start" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "start"
elif [ "$1" = "stop" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "stop"
elif [ "$1" = "restart" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "stop"
 su - alfresco "${ALFRESCO_SCRIPT}" "start"
else
 echo "Usage: /etc/init.d/alfresco [start|stop|restart]"
fi
  • sudo chmod uga+x /etc/init.d/alfresco
  • sudo chown alfresco:alfresco /etc/init.d/alfresco
  • mkdir /opt/alfresco/alf_data
  • cp /opt/alfresco/tomcat/shared/classes/alfresco-global.properties.sample /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
  • nano /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
dir.root=/opt/alfresco/alf_data
#IMPORTANT: comment dir.keystore

db.username=alfresco
db.password=alfresco

db.schema.update=true

db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco

index.recovery.mode=AUTO

authentication.chain=alfrescoNtlm1:alfrescoNtlm

alfresco.rmi.services.host=0.0.0.0
  • service alfresco start
  • tail -f /opt/alfresco/tomcat/logs/catalina.out -c 10000

Configure optional (but important) services

  • service alfresco stop
  • nano /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
#
# External locations
#-------------
# OpenOffice
ooo.exe=/usr/lib/libreoffice/program/soffice.bin
ooo.enabled=false
jodconverter.officeHome=/usr/lib/libreoffice
jodconverter.portNumbers=8100
jodconverter.enabled=true
# ImageMagick installation
img.root=/usr/share/doc/imagemagick
img.exe=/usr/bin/convert
# SWFTools exe
swf.exe=/usr/bin/pdf2swf