cancel
Showing results for 
Search instead for 
Did you mean: 

Post install changes best practices?

karlbowden
Champ in-the-making
Champ in-the-making
For the sake of testing I have been working on a script to complete the changes I need in a fresh full linux install to allow me to extract a backup of mysql and alf_data and test alfresco in different environments.

So far I have:

#!/bin/sh
BASE=/opt/Alfresco
#JAVA_VER="java-6-sun"
JAVA_VER="java-1.5.0-sun"

ln -s $BASE/alfresco.sh /etc/init.d/alfresco
ln -s $BASE/virtual_alf.sh /etc/init.d/virtual_alf

cd $BASE
for TARGET in alfresco.sh virtual_alf.sh ; do
        sed -i 's/@@ALFRESCO_DIR@@/\/opt\/Alfresco/' "$BASE/$TARGET"
        sed -i "s/@@JAVA_HOME@@/\/usr\/lib\/jvm\/$JAVA_VER\//" "$BASE/$TARGET"
done

#only required if this is a new mysql install
sudo mysql -p < /opt/Alfresco/extras/databases/mysql/db_setup.sql

DIR=tomcat/shared/classes/alfresco/extension
TARGET=$DIR/custom-repository.properties
sed -i 's/#dir.root=\/srv\/alfresco\/alf_data/dir.root=\/opt\/Alfresco\/alf_data/' "$BASE/$TARGET"
sed -i 's/db.driver=org.apache.derby.jdbc.EmbeddedDriver/#db.driver=org.apache.derby.jdbc.EmbeddedDriver/' "$BASE/$TARGET"
sed -i 's/db.url=jdbc:derby:alf_data\/derby_data\/alfresco;create=true/#db.url=jdbc:derby:alf_data\/derby_data\/alfresco;create=true/' "$BASE/$TARGET"
sed -i 's/#db.driver=org.gjt.mm.mysql.Driver/db.driver=org.gjt.mm.mysql.Driver/' "$BASE/$TARGET"
sed -i 's/#db.url=jdbc:mysql:\/\/localhost\/alfresco/db.url=jdbc:mysql:\/\/localhost\/alfresco/' "$BASE/$TARGET"

TARGET=$DIR/custom-hibernate-dialect.properties
sed -i 's/hibernate.dialect=org.hibernate.dialect.DerbyDialect/#hibernate.dialect=org.hibernate.dialect.DerbyDialect/' "$BASE/$TARGET"
sed -i 's/#hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect/hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect/' "$BASE/$TARGET"

# Fix for openoffice not being started
DIR=tomcat/shared/classes/alfresco/extension/bootstrap
TARGET=$DIR/openoffice-startup-context.xml
sed -i 's/"soffice"/\/usr\/lib\/openoffice\/program\/soffice.bin/' "$BASE/$TARGET"

# Fix for virtual_alf not starting
if [ "$1" = '–postwar' ]; then
        DIR=tomcat/webapps/alfresco/WEB-INF/classes/alfresco
        TARGET=$DIR/repository.properties
        sed -i 's/avm.rmi.service.port=50501/avm.rmi.service.port=50509/' "$BASE/$TARGET"
fi

I have chosen to use sed for file changes as using the sub command in this way has it is safe to run the script multiple times and only have the changes made once.

Process:
Install linux-full
Run script
start alfresco till wars are extracted, stop alfresco.
run script –postwar
alfresco start
virtual_alf start

So my questions:
Is there a better way of making those file changes?

What other changes should I be adding in?

Is there another way of changing tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties without having to start alfresco first? (it would just be a bit cleaner if I could run the script only once then start alfresco)

Any other suggestions?

Platform notes: ubuntu-8.10-server-i386, java, oo, etc managed by puppet, alfresco-labs-3c, mysql-5.0.67, sun-java5-jre-1.5.0
3 REPLIES 3

zaizi
Champ in-the-making
Champ in-the-making
You can just unzip alfresco.war and make changes to config files. However, you can overwrite most configurations by placing your custom configuration in the Alfresco extension folder. See http://wiki.alfresco.com/wiki/Web_Client_Configuration_Guide. You can over write repository.properties. See http://wiki.alfresco.com/wiki/Repository_Configuration.

You might want to think about checking in your Alfresco installation into subversion. This will let you provision new instances by simply checking out. Also will let you manage all the configurations through tagging and branching.

mikeh
Star Contributor
Star Contributor
Does this wiki article help? http://wiki.alfresco.com/wiki/Repository_Configuration

Thanks,
Mike

karlbowden
Champ in-the-making
Champ in-the-making
Thanks for the posts guys. Repository Configuration seems to be just the page I was after.
And CVS is a very good idea for storing configuration changes.
Has anybody already posted a list of excludes for git (or svn) to help in setting up the repository?