Alfresco Community Installer For Ubuntu 9.04

Want to support HowtoForge? Become a subscriber!
 
Submitted by linuxunixmadrid (Contact Author) (Forums) on Tue, 2009-09-15 11:32. :: Ubuntu

Alfresco Community Installer For Ubuntu 9.04

This script automates the setting up of Alfresco Community on Ubuntu Server 9.0.4 & Ubuntu Desktop 9.0.4. Alfresco is an enterprise content management system for Microsoft Windows and Unix-like operating systems. Alfresco comes in two flavours . Alfresco Community Edition is free software, GPL licensed open source and open standards, but never officially stable. Alfresco Enterprise Edition is commercially / proprietary licensed open source, open standards and enterprise scale. Its design is geared towards users who require a high degree of modularity and scalable performance. Alfresco includes a content repository, an out-of-the-box web portal framework for managing and using standard portal content, a CIFS interface that provides file system compatibility on Microsoft Windows and Unix-like operating systems, a web content management system capable of virtualizing webapps and static sites via Apache Tomcat, Lucene indexing, and jBPM workflow. The Alfresco system is developed using Java technology.

 

Requirements:

A fresh installation of Ubuntu 9.0.4 Server or Desktop without Apache. Only the core of the system is needed, so during the installation of your Ubuntu Server don’t select software to install like LAMP Server in the “Software Selection” menu (except for OpenSSH Server). This script installs Apache and expects to deal with default config files.

TIP: test this script within a Virtual Machine after installing Ubuntu 9.04 from scratch. Run the virtual machine in a bridged network (host and guest have same subnet and can be reached from the LAN).

Run the script as non-root with the following commands:

$ chmod +x alfresco-installer-for-ubuntu9.04.sh
$ ./alfresco-installer-for-ubuntu9.04.sh

You will be asked for:

1) The DNS Name your Alfresco service will be available at
2) IP address your Alfresco service will be listening on
3) Your LANG
4) Etc.

Your brandnew Alfresco Community Edition will be reached with a web browser at:

http://YOUR-DNS-NAME/alfresco/faces/ (admin/admin)
http://YOUR-DNS-NAME/alfresco (guest)

Language Pack Installation: http://wiki.alfresco.com/wiki/Language_Pack_Installation

 

Content of the script "alfresco-installer-for-ubuntu9.04.sh":

#!/bin/bash
echo "Enter the DNS Name of your Alfresco Service (i.e.: www.myalfresco.com): "
echo "Press ENTER for default one (www.myalfresco.com)"
read url
if [ -z "$url" ];
then
url=www.myalfresco.com
fi
echo "\"your DNS Name is\" = "$url""
echo "---------------------------------------------------------------------"


echo "Modifying /etc/hosts file. Enter your IP address: "
echo "Press ENTER for default one (127.0.1.1)"
read ipaddrvar
if [ -z "$ipaddrvar" ];
then
ipaddrvar=127.0.1.1
fi
echo "\"your IP address is\" = "$ipaddrvar""
echo "---------------------------------------------------------------------"


for lang in `apt-cache pkgnames language-pack-gnome- | grep -i base`;
do
array=( "${array[@]}" "$lang" )
done

element_count=${#array[@]}
# Special syntax to extract number of elements in array.
index=0
while [ "$index" -lt "$element_count" ];
do    # List all the elements in the array.
  echo $index.${array[$index]}
  #    ${array[index]} also works because it's within ${ ... } brackets.
  let "index+=1"
done

langnumber=200
array[$langnumber]="language-pack-gnome-es-base"
while [ $langnumber -ge $element_count -o $langnumber -lt 0 ];
do
echo
echo "---------------------------------------------------------"
echo "Please enter the number of your language pack            "
echo "Press ENTER for default one (language-pack-gnome-es-base)"
echo "---------------------------------------------------------"
read langnumber
if [ -z "$langnumber" ];
then
array[0]="language-pack-gnome-es-base"
break
fi
echo
done
LANGTOINSTALL=${array[$langnumber]}
echo "Your selected language pack to install is" $LANGTOINSTALL
echo

# Install the alfresco-community package after activating the "partner" repository in /etc/apt/sources.list :
# $ sudo vi /etc/apt/sources.list
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu jaunty partner
# deb-src http://archive.canonical.com/ubuntu jaunty partner

sudo sed -i "s/\(^#[[:space:]]*\)\(deb http:\/\/archive.canonical.com\/ubuntu jaunty partner\)/\2/g" /etc/apt/sources.list
sudo sed -i "s/\(^#[[:space:]]*\)\(deb-src http:\/\/archive.canonical.com\/ubuntu jaunty partner\)/\2/g" /etc/apt/sources.list

sudo apt-get update -y
sudo apt-get install alfresco-community -y
sudo /etc/init.d/tomcat6 restart

sudo apt-get -y install $LANGTOINSTALL

sudo apt-get install apache2 -y
sudo a2enmod ssl
sudo a2ensite default-ssl
sudo a2enmod rewrite
sudo a2enmod suexec
sudo a2enmod include
sudo sed -i "s/\(^ServerRoot.*\)/\1\nServerName localhost/g" /etc/apache2/apache2.conf
#Forcing Apache to redirect HTTP traffic to HTTPS
sudo sed -i "s/\(ServerAdmin.*\)/\1\nRedirect \/ https:\/\/$url\//g" /etc/apache2/sites-available/default
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_connect
sudo a2enmod proxy_ftp
HOSTNAME=`hostname -s`
HOSTNAME=$(echo "$HOSTNAME"|tr -d " ")
sudo sed -i "s/\(^127\.0\.1\.1.*\)\($HOSTNAME\).*/#\0\n$ipaddrvar $url $HOSTNAME/g" /etc/hosts
sudo sed -i "s/\(ServerAdmin.*\)/\1\nServerName $url\n\<Proxy \*\>\nOrder deny,allow\nAllow from all\n\<\/Proxy\>\nProxyRequests Off\nProxyPass        \/   http:\/\/127.0.0.1:8080\/\nProxyPassReverse \/   http:\/\/127.0.0.1:8080\//g" /etc/apache2/sites-available/default-ssl
sudo /etc/init.d/apache2 restart
echo "######################################################################################################################"
echo " The installation process will stop here with the following warning if you launch the script through a SSH session:"
echo "           \"This command may affect the current SSH connections. Do you want to continue (y | n)?\""
echo " SOLUTION: Press \"y\" to complete the rest of the process"
echo "######################################################################################################################"
# FIREWALL:
sudo ufw enable
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
clear
echo "######################################################################################################################"
echo " Your Alfresco System can now be reached with a web browser at:"
echo
echo "        http://$url/alfresco/faces/ (admin/admin)"
echo "        http://$url/alfresco (guest)"
echo
echo "Language Pack Installation: http://wiki.alfresco.com/wiki/Language_Pack_Installation"
echo "######################################################################################################################"

This script and related stuff can be found at: http://opensourceconsulting.wordpress.com/2009/08/03/alfresco-installation-script-for-ubuntu9-04-sh/.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by David Baker (not registered) on Wed, 2009-09-30 14:57.

Getting CIFS working was always an issue for me, so I've written a short How-To on Installing Alfresco Community Edition 3.2 on Ubuntu Server 9.04