Step 4: Installing Infoglue with automation

Instead of using the installer many people and projects prefer to set up a deployment environment which let’s them redeploy a configuration by running automated scripts. This is from my experience the quickest, safest and least error-prone way to keep an easy to maintain, upgradable and redeployable server. Therefor we recommended this way for most setups. When using this method in production however you should only use stable official releases.

Here is how to create a sample setup.

Prerequisites

First we create a Build-folder:

#(can be anywhere – this is just an example)
cd /root
mkdir BuildProject
cd BuildProject
mkdir infoglue
cd infoglue

Download this build.xml and place it in the infoglue folder.

wget ANGE_FULL_URL_OVAN

 Also paste the following into a build.properties-file in the same folder and change the paths etc that is custom in your case:

project.version=3.0
# deployment directories for each version of the InfoGlue webapp
deploy.dir.shared=/usr/share/tomcat6/

#Only needed if you want the cms and working apps installed on this server
deploy.dir.cms=/var/lib/tomcat6/webapps/infoglueCMS
deploy.dir.working=/var/lib/tomcat6/webapps/infoglueDeliverWorking

#Only needed if you want the live app installed on this server
deploy.dir.live=/var/lib/tomcat6/webapps/infoglueDeliverLive

externalWebServerAddress=
#webServerAddress=http://localhost:8080
#liveWebServerAddress=http://localhost:8080
context.root.cms=infoglueCMS
context.root.working=infoglueDeliverWorking
#context.root.preview=infoglueDeliverPreview
context.root.live=infoglueDeliverLive

operatingMode.cms=0
operatingMode.working=0
operatingMode.preview=2
operatingMode.live=3

database.driver.class=com.mysql.jdbc.Driver
database.driver.engine=mysql
database.url=jdbc:mysql://localhost:3306/infoglue?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
database.user=root
database.password=mysqlpassword
database.use.unicode=true
database.encoding=UTF-8
database.maxConnections=300
database.mapping=mapping.xml

hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.show_sql=false

administratorUserName=root
administratorPassword=mypassword
administratorEmail=joe@somecompany.com

loginUrl=Login.action
invalidLoginUrl=Login!invalidLogin.action
authenticatorClass=org.infoglue.cms.security.InfoGlueBasicAuthenticationModule
authorizerClass=org.infoglue.cms.security.InfoGlueBasicAuthorizationModule

configured=true

Now run this target to get the right infoglue version

#If you want to download the latest version
ant fetchInfoGlue
#If you want to download a specific version instead use
ant fetchInfoGlueOnTag -DtagName=infoglue3000RC1
cd ..

Create an script file called redeploy.sh in the BuildProject-directory:

#!/bin/bash
cd infoglue
ant server-clean-medium
ant deploy

Chmod the file and run the install script

chmod 755 redeploy.sh
./redeploy.sh

This will deploy the stated apps to tomcat with appropriate settings.

On some systems you have to make sure the tomcat user has full access to the deployed webapp. Easiest way is by doing:

chown root:tomcat /var/lib/tomcat6/webapps/infoglue* -R
chmod 775
/var/lib/tomcat6/webapps/infoglue* -R

Next you start apache tomcat and if you have not allready set up a database you follow the wizard in Infoglue upon first request.