Installing Labs 3 on Linux with command line interface

Document created by resplin Employee on Jun 6, 2015
Version 1Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



Labs 33.0


Introduction


These instructions worked for me on an install for CentOS 5.2 running on VMWare Server 2.0.
My CentOS install had little to no packages installed. I tried to make this as generic as possible so it should work on other distributions. Sorry for the references to yum.


Install JAVA


Before you install Alfresco Labs 3b, ensure that you have JDK 5 or 6 installed on your machine.


Install JDK 1.6


First we need to go to Sun and get the Java files:

http://java.sun.com/javase/downloads/index.jsphttp://java.sun.com/javase/downloads/index.jsp

Select Download for JDK 6 Update 6

Select Linux from the Platform drop down list.

Select Agree if you decide too.

Select Continue.

Download this file jdk-6u6-linux-i586-rpm.bin

[root@localhost alfresco]# chmod +x jdk-6u6-linux-i586-rpm.bin

[root@localhost alfresco]# ./jdk-6u6-linux-i586-rpm.bin

You will have to agree to a few things, but it self installs.

[root@localhost alfresco]# rpm –Uvh java-1.6.0-sun-compat-1.6.0.06-1jpp.i586.rpm

To make sure your system is configured to use this latest version of Java by default, run the command:

[root@localhost alfresco]# alternatives --config java

You should see that there are two programs that provide Java.

   Selection    Command

    1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2           /usr/lib/jvm/jre-1.6.0-sun/bin/java

If number 2 has the *+ next to it, you should be fine. There is no need to do anything, just press Enter. If, for some reason, 1 is selected, then type 2 and press Enter.

As a final Java configuration test, you can run:

[root@localhost alfresco]# rpm -qa | grep java

Check to see that java-1.6.0-sun-compat-1.6.0.06-1jpp is listed

[root@localhost alfresco]#rpm -qa | grep java
java-1.4.2-gcj-compat-1.4.2.0-40jpp.112
sun-javadb-demo-10.3.1-4.1
java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.112
sun-javadb-common-10.3.1-4.1
sun-javadb-docs-10.3.1-4.1
gcc-java-4.1.2-14.el5
sun-javadb-core-10.3.1-4.1
sun-javadb-javadoc-10.3.1-4.1
sun-javadb-client-10.3.1-4.1
java-1.6.0-sun-compat-1.6.0.06-1jpp

Install Alfresco Labs 3b


64 bits setup


If you are running a x64 kernel, you should consider installing the 'ia32-libs' package in order to run the Alfresco installer in console mode.

apt-get install ia32-libs

If not, the installer will simply not run without returning any error. (Tested with lenny x64 under OpenVZ)

Then follow the general setup instructions.


General setup


  1. Ensure you have downloaded Alfresco-Labs-3b-Linux-x86-Install.

Now make it an executable file.

chmod 777 Alfresco-Labs-3b-Linux-x86-Install.

  1. Run Alfresco-Labs-3b-Linux-x86-Install.
./Alfresco-Labs-3b-Linux-x86-Install

  1. The installer will ask you if you want to install Alfresco [n/Y]
  2. The installer will ask you where you want to install Alfresco. The default is /opt/Alfresco.

For example:

[root@alfresco tmp]# ./Alfresco-Labs-3b-Linux-x86-Install
This will install Alfresco Labs on your computer.  Continue? [n/Y]
Where do you want to install Alfresco Labs? /opt/Alfresco
Installing Alfresco Labs...
Installing Program Files...
Installing Program Files Linux...
Installing Samples...
Installing WCM...
Installing WCM Linux...
Installation complete.
[root@alfresco tmp]#

Now change a few variables in the /opt/Alfresco/alfresco.sh file:


  1. Change ALF_HOME=@@ALF_HOME@@ to ALF_HOME=/opt/Alfresco or where ever you installed Alfresco.
  2. Change export JAVA_HOME='@@JAVA_HOME@@' to export JAVA_HOME=/usr/java/jdk1.6.0_06/ or where ever you put the Java files.
#!/bin/sh
# 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 JAVA_HOME=/usr/java/jdk1.6.0_06/
......

The installation is complete.

Start Alfresco, you might have to to give tomcat a minute to start up.

/opt/Alfresco/alfresco.sh start

The website can be found at

http://HOSTNAME:8080/share

Login as:

user: admin
pass: admin



If you wish to use the Website Preview feature, you will need to start
the Alfresco Virtualization server:

vi /opt/Alfresco/virtual_alf.sh

  1. Change ALF_HOME=@@ALF_HOME@@ to ALF_HOME=/opt/Alfresco or where ever you installed Alfresco.
  2. Change export JAVA_HOME='@@JAVA_HOME@@' to export JAVA_HOME=/usr/java/jdk1.6.0_06/ or where ever you put the Java files.
#!/bin/sh
# Start or stop Alfresco server
# Set the following to where Tomcat is installed
ALF_HOME=/opt/Alfresco
cd '$ALF_HOME'
APPSERVER='$ALF_HOME'/virtual-tomcat
export JAVA_HOME=/usr/java/jdk1.6.0_06/
.........

Start Alfresco


sh virtual_alf.sh start

Then the website can found at:

http://HOSTNAME:8080/alfresco/

Login into Alfresco


Login as:

user: admin
pass: admin



For SMB access try:

\\HOST_IP_ADDRESS\alfresco

Login as:

user: admin
pass: admin

For FTP access try:

ftp HOST_IP_ADDRESS

Login as:

user: admin
pass: admin

Change HSQL Database to MySQL Database


Install mysql from packages:

yum install mysql-server

Start mysql

/etc/init.d/mysqld start

Test mysql is running:

mysql -u root -p

Add Alfresco user etc to mysql


mysql

#!/bin/bash
#
# Installs and configures Alfresco Labs 3.0 on Ubuntu
# 2009/04/01 Gregory Buchenberger
#

##Install dependencies using Apt
apt-get -y update
apt-get -y install openoffice.org-headless \
openoffice.org-writer \
openoffice.org-calc \
openoffice.org-impress \
openoffice.org-java-common \
imagemagick \
libjpeg62-dev \
libfreetype6-dev \
build-essential \
linux-headers-$(uname -r) \
zlib1g-dev \
sun-java6-jdk

##Build SWF Tools
cd /tmp
wget http://www.swftools.org/swftools-2009-02-16-1757.tar.gz
tar -xvf swftools-2009-02-16-1757.tar.gz
cd swftools-2009-02-16-1757
./configure
make
make install
cd /tmp
rm swftools-2009-02-16-1757.tar.gz
rm -rf swftools-2009-02-16-1757

##Create MySQL Database
mysql -u root -e 'create database alfresco;
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;'

##Install Alfresco
mkdir /opt/alfresco
cd /opt/alfresco
wget http://downloads.sourceforge.net/alfresco/alfresco-labs-tomcat-3Stable.tar.gz
tar -xvf alfresco-labs-tomcat-3Stable.tar.gz
rm alfresco-labs-tomcat-3Stable.tar.gz
mkdir -p /var/alfresco/alf_data

##Install MySQL
cd /opt/alfresco/tomcat/lib/
wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.7.tar.gz/from/http://mirror.sourceshare.org/mysql/
tar -xvf mysql-connector-java-5.1.7.tar.gz
cp ./mysql-connector-java-5.1.7/mysql-connector-java-5.1.7-bin.jar ./
rm -rf ./mysql-connector-java-5.1.7
rm mysql-connector-java-5.1.7.tar.gz

##Create Alfresco initiation script at /etc/init.d/alfresco
echo '#! /bin/bash
#
# alfresco      This shell script takes care of starting and stopping Alfresco
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: alfresco
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Description: Alfresco Labs 3.0
# Short-Description: start and stop Alfresco
### END INIT INFO
#

NAME='$(basename $0)'
unset ISBOOT
if [ '${NAME:0:1}' = 'S' -o '${NAME:0:1}' = 'K' ]; then
    NAME='${NAME:3}'
    ISBOOT='1'
fi

# Path to alfresco root dir
_ALFRESCO='/opt/alfresco'

# Path to the alfresco launch script
_SCRIPT='${_ALFRESCO}/alfresco.sh'

# Alfresco program name
_PROG='$NAME'

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:/usr/bin
echo $PATH
SHUTDOWN_WAIT=30

RETVAL='0'

function checkpid() {
    local i
    for i in $* ; do
        if [ -d '/proc/${i}' ]; then
            return 0
        fi
    done
    return 1
}

function echo_failure() {
    echo -en '\\033[60G'
    echo -n '[  '
    echo -n $'FAILED'
    echo -n '  ]'
    echo -ne '\r'
    return 1
}

function echo_success() {
    echo -en '\\033[60G'
    echo -n '[  '
    echo -n $'OK'
    echo -n '  ]'
    echo -ne '\r'
    return 0
}

function getIP() {
ipaddr=''

    inet=$(ip addr show dev eth0 | grep 'inet')

if [ '$inet' != '' ]; then
      set -- $inet
      shift
 
  echo ${1%%/*} | grep -E \([0-9]\{1,3\}.\{3\}\)[0-9]\{1,3\} > /dev/null

  if [ $? -ne 1 ]; then
       ipaddr=$(echo ${1%%/*} | sed -e s/[.]/-/g)
  fi
fi

if [ $ipaddr = '' ]; then
  return -1
fi
}

function updateVirtDomain() {
virt_server=${_ALFRESCO}/virtual-tomcat/conf/alfresco-virtserver.properties
virt_server_property=alfresco.virtserver.domain

if [ -e $virt_server ]; then
  grep -E ^alfresco\.virtserver\.domain=\([0-9]\{1,3\}-\)\{3\}[0-9]\{1,3\} $virt_server
  if [ $? -eq 0 ]; then
   sed -i -r -e s/^${virt_server_property}=\([0-9]\{1,3\}-\)\{3\}[0-9]\{1,3\}/${virt_server_property}=${ipaddr}/ \
   $virt_server
  else
   sed -i -r -e s/^${virt_server_property}=/${virt_server_property}=${ipaddr}/ \
   $virt_server
  fi
fi
}

# See how we were called.
function start() {
    echo -n 'Starting ${_PROG}: '
        if [ -f '/var/run/${NAME}.pid' ]; then
            read kpid

Use some method (scp, ftp, samba, cd, usb) to get the file to your home folder on the server and make the script executable like so:

chmod +x alfresco-install.sh

Execute the script as root:

sudo ./alfresco-install.sh

Attachments

    Outcomes