Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Alfresco 6.x CE without Share
###
# DEPRECATED - checkout https://github.com/Alfresco/acs-deployment/tree/master/docker-compose
#
#! /bin/bash
# Alfresco Community 6.x installation script for CentOS 7.x ; mysql-server 5.x is expected to be installed in the box.
# Started from https://community.alfresco.com/community/ecm/blog/2019/02/05/a-script-to-install-alfresco-community-60
# To test with Docker...
# docker run -u 0 -it centos/mysql-56-centos7 /bin/bash
# When installation is completed, start Alfresco and check logs; should fail on DB connection
# $alf_home/alfresco.sh start ; tail -f $tomcat_home/logs/catalina.out
# Install and configure MySQL Server 5.6
# Useful for dev purposes, remove for production environments
# Install MySQL
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum localinstall mysql57-community-release-el7-11.noarch.rpm
yum install mysql-community-server
systemctl start mysqld.service
mysql_root_pwd=`grep 'temporary password' /var/log/mysqld.log | awk '{print $11}'`
# Alt version for Docker
# mysql_install_db
# chown -R mysql /var/opt/rh/rh-mysql56
# cd /opt/rh/rh-mysql56/root/usr ; /opt/rh/rh-mysql56/root/usr/bin/mysqld_safe &
# sleep 5
# Configure MySQL
mysqladmin -u root -p"$mysql_root_pwd" password 'Alfresco1!'
mysql -h localhost -u root -p'Alfresco1!' -e "CREATE DATABASE alfresco DEFAULT CHARACTER SET utf8"
mysql -h localhost -u root -p'Alfresco1!' -e "CREATE USER 'alfresco'@'127.0.0.1' IDENTIFIED BY 'Alfresco1*';"
mysql -h localhost -u root -p'Alfresco1!' -e "GRANT ALL PRIVILEGES ON alfresco.* TO 'alfresco'@'127.0.0.1'"
# Define versions
TOMCAT_VERSION=8.5.40
ACS_VERSION=6.1.2-ga
ASS_VERSION=1.3.0.1
LIBRE_DL_VERSION=6.2.3
AOS_VERSION=1.2.2
LIBRE_VERSION=6.2.3.2_Linux_x86-64_rpm
IM_VERSION=7.0.8-42.x86_64
MYSQL_JDBC_VERSION=5.1.47
AMQ_VERSION=5.15.9
# Derived vars
alf_home=/opt/alfresco
tomcat_home=$alf_home/tomcat
# Ensure any non-zero exit terminates the script immediately
# if [ "$1" == "quit" ]; then
# set -e
# set -o pipefail
# fi
# Install packages needed
yum install -y epel-release
amazon-linux-extras install epel
yum install -y which wget unzip less java-1.8.0-openjdk openjpeg2
# Create folder structure
mkdir -p $alf_home/dl
mkdir -p $alf_home/modules/platform
# Download all sw packages
cd $alf_home/dl
wget -L http://apache.rediris.es/tomcat/tomcat-8/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.zip
wget -L --no-check-certificate https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-content-services-community-distribution/$ACS_VERSION/alfresco-content-services-community-distribution-$ACS_VERSION.zip
wget -L --no-check-certificate https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/aos-module/alfresco-aos-module/$AOS_VERSION/alfresco-aos-module-$AOS_VERSION.amp
wget -L --no-check-certificate https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-search-services/$ASS_VERSION/alfresco-search-services-$ASS_VERSION.zip
wget -L --no-check-certificate https://ftp.cixug.es/tdf/libreoffice/stable/$LIBRE_DL_VERSION/rpm/x86_64/LibreOffice_${LIBRE_DL_VERSION}_Linux_x86-64_rpm.tar.gz
wget -L --no-check-certificate https://imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-$IM_VERSION.rpm
wget -L --no-check-certificate https://imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-libs-$IM_VERSION.rpm
wget -L --no-check-certificate http://central.maven.org/maven2/mysql/mysql-connector-java/$MYSQL_JDBC_VERSION/mysql-connector-java-$MYSQL_JDBC_VERSION.jar
wget -L --no-check-certificate http://apache.rediris.es//activemq/$AMQ_VERSION/apache-activemq-$AMQ_VERSION-bin.tar.gz
# Unpack Tomcat
cd $alf_home
unzip $alf_home/dl/apache-tomcat-$TOMCAT_VERSION.zip
ln -s $alf_home/apache-tomcat-$TOMCAT_VERSION $alf_home/tomcat
# Unpack alfresco
unzip $alf_home/dl/alfresco-content-services-community-distribution-$ACS_VERSION.zip
mv $alf_home/alfresco-content-services-community-distribution-$ACS_VERSION/* .
rm -rf $alf_home/alfresco-content-services-community-distribution-$ACS_VERSION
# Copy AOS Amp in Alfresco amps folder
cp $alf_home/dl/alfresco-aos-module-*.amp amps/
# Unpack Search
unzip $alf_home/dl/alfresco-search-services-$ASS_VERSION.zip
# Unpack and start ActiveMQ
tar xvzf $alf_home/dl/apache-activemq-$AMQ_VERSION-bin.tar.gz
./apache-activemq-$AMQ_VERSION/bin/activemq start
# Unpack and install LibreOffice
tar -xvf $alf_home/dl/LibreOffice_*
yum -y localinstall ./LibreOffice_*/RPMS/*.rpm
rm -rf ./LibreOffice_*
# Install ImageMagick
yum -y localinstall $alf_home/dl/ImageMagick*.rpm
# Configure tomcat
# Download MySQL Drivers
cp $alf_home/dl/mysql-connector-java-5.1.47.jar $tomcat_home/lib
ln -s $alf_home/web-server/conf/Catalina/ $tomcat_home/conf/
sed -i 's|connectionTimeout=|URIEncoding="UTF-8" connectionTimeout=|' $tomcat_home/conf/server.xml
sed -i 's|shared.loader=|shared.loader=${catalina.base}/shared/classes|' $tomcat_home/conf/catalina.properties
rm -rf $tomcat_home/webapps
ln -s $alf_home/web-server/webapps $tomcat_home/
ln -s $alf_home/web-server/shared $tomcat_home/
cat > $tomcat_home/bin/setenv.sh <<-'END'
JAVA_OPTS="-XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Djava.awt.headless=true -XX:ReservedCodeCacheSize=128m $JAVA_OPTS "
JAVA_OPTS="-Xms512M -Xmx8192M -Djgroups.bind_addr=127.0.0.1 $JAVA_OPTS "
export JAVA_OPTS
END
sed -e "s|JAVA_HOME=|JAVA_HOME=${JAVA_HOME}|" > $alf_home/alfresco.sh <<-'END'
#!/bin/bash
cd `dirname $0`
catalina=tomcat/bin/catalina.sh
export JAVA_HOME=
export LC_ALL="en_US.UTF-8"
export JAVA_OPTS="-Duser.timezone=GMT -Dalfresco.home=$PWD"
export CATALINA_PID=tomcat/temp/catalina.pid
if [ -f $catalina ]; then
if [ "$*" == "stop" ]; then $catalina stop 20 -force; else $catalina "$@"; fi
else
echo ERROR: $PWD/$catalina not found.
fi
END
# Make scripts executable
chmod +x $alf_home/alfresco.sh $alf_home/bin/*.sh $tomcat_home/bin/*.sh
# Remove share
rm -rf $alf_home/web-server/webapps/share.war
rm -rf $alf_home/web-server/conf/Catalina/localhost/share.xml
# Apply AMPs
chmod +x $alf_home/bin/apply_amps.sh
yes y | $alf_home/bin/apply_amps.sh -force -nobackup
# Install PDF renderer
mv $alf_home/alfresco-pdf-renderer $alf_home/pdf-renderers
cd $alf_home/pdf-renderers
tar xzf alfresco-pdf-renderer-*-linux.tgz
mv alfresco-pdf-renderer $alf_home/bin/
cd $alf_home
# Bare minimum properties
cat > $alf_home/web-server/shared/classes/alfresco-global.properties <<END
system.serverMode=PRODUCTION
dir.root=$PWD/alf_data
dir.keystore=\${dir.root}/keystore
db.pool.max=275
db.pool.validate.query=SELECT 1
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost:3306/alfresco?useUnicode=yes&characterEncoding=UTF-8
db.username=alfresco
db.password=Alfresco1*
db.pool.initial=10
db.pool.max=100
jodconverter.officeHome=/opt/libreoffice6.2
jodconverter.portNumbers=8101
jodconverter.enabled=true
img.exe=/bin/convert
alfresco.context=alfresco
alfresco.host=\${localname}
alfresco.port=8080
alfresco.protocol=http
index.subsystem.name=solr6
solr.secureComms=none
solr.port=8983
solr.host=localhost
solr.base.url=/solr
messaging.broker.url=failover:(tcp://localhost:61616)?timeout=3000
alfresco-pdf-renderer.exe=$PWD/bin/alfresco-pdf-renderer
smart.folders.enabled=false
notification.email.siteinvite=false
ooo.enabled=false
cifs.enabled=false
END
@prhr
Copy link

prhr commented Jan 19, 2021

Ta funcional?

@maoo
Copy link
Author

maoo commented Jan 19, 2021

Don't think so. I'd suggest you starting from https://github.com/Alfresco/acs-deployment/tree/master/docker-compose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment