Ручная установка Alfresco Community 4.2.c на Ubuntu 12.04 LTS

Автор Itworkroom

В этой статье рассматривается установка Alfresco Community 4.2.c на Ubuntu 12.04 LTS минимальной 64bit с Apache Tomcat 7.0.30 и PostgreSQL 9.0.4.

Установка будет ручная, те каждый компонент будет установлен ручками, это более надежный и гибкий метод для предприятия.
Большинство IT специалистов предпочитают ручной вид установок, так сказать «шаг за шагом по списку команд и задач» … это проще понять, сделать и испытать.

Процедуры перед началом:

  • 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

автор: Francesco Corti

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *