Tuesday, July 30, 2013

DSpace, LAMS, Mahara and OpenSim install on Linux

There are five blogs in this series.

Please select the link below as required:-

DSpace Install Blog

LAMS Install Blog

Mahara Install Blog

OpenSim Install Blog

Server Syncronisation Blog

Upgrading from LAMS 2.3.5 to 2.4

Upgrading from 2.3.5 to 2.4

This is a fairly major upgrade as it also involves the deployment of JBOS 5.x to replace JBOSS 4.x

The upgrade instructions below are based on those from the site http://wiki.lamsfoundation.org/display/lamsdocs/Upgrading+LAMS+2.3.5+to+2.4+Linux

I have documented the steps I followed below with our installation

Login as root

Stop the existing LAMS service

service lams2 stop

Download LAMS 2.3.5 to 2.4 upgrade pack

lynx http://wiki.lamsfoundation.org/display/lams/Downloads

To help you the relevant area of the site is shown below

LAMS 2.4 for Unix and Linux

These new 2.4 packages aren't really installers but a bundle of all the resources you need to upgrade or install LAMS 2.4 from scratch.
   File                            md5sum check                             Size  instructions
   LAMS 2.4 installation pack   md5sum: 1f12668869230d89f7e69a999ad5eae1 93MBs Installing instructions
   LAMS 2.3.5 to 2.4 upgrade pack md5sum: 95d720e597251c5fb64f7445e3237ac6 93MBs Upgrade instructions

Unpack the files

tar -xzf lams-unix-upgrade-2.4.0.tar.gz
cd lams-unix-upgrade-2.4.0

Copy JBoss 5.1 and copy over the files from the previous installation (choosing to overwrite any existing files)

cp -pr jboss-5.1 /usr/local

unalias cp

cp -rf /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/lams-www.war/secure /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-www.war/

cp -rf /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/lams-www.war/news.html /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-www.war/news.html

cp -rf /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/lams-www.war/images/pixlr /usr/local/jboss-5.1/server/default/deploy/lams.ear/lams-www.war/images/

Create a lams user and give it access to the appropriate directories

useradd -d /usr/local/jboss-5.1/bin -M lams

chown -R lams:lams /usr/local/jboss-5.1

chown -R lams:lams /var/opt/lams

I did not find it was not necessary to edit the MySQL connector in this instance

Run the LAMS upgrade scripts

cd new-tools/bbb-deploy/
./deploy.sh

cd ../imscc-deploy/
/deploy.sh

cd ../wookie-deploy/
./deploy.sh

Upgrade the database

mysql -u lamsuser -plamsdemo lams2

update lams_configuration set config_value = '/usr/local/jboss-5.1/server/default/deploy/lams.ear' where config_key = 'EARDir';

quit

Before LAMS would start it was necessary to get the environment variables in /etc/profile right

nano /etc/profile

a) It was necessary to replace

JAVA_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"

with

JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dfile.encoding=UTF-8"

b) It was also necessary to comment out the JBOSS environment variable lines i.e.

# JBOSS_HOME=/usr/local/jboss-4.0.2
# export JBOSS_HOME

It is not necessary to set this environment variable and allows JBOSS to take care of its own directories

Logout and log back in again as root

LAMS can now be started using the following command

su - lams -c "/usr/local/jboss-5.1/bin/run.sh"

Eventually something like the following message should appear

10:29:08,390 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 14s:598ms

Unfortunately this is now running in the foreground

In order to get LAMS running as a service it was necessary to download and install the Java Service Wrapper

Read and follow the instructions on the following site VERY carefully

http://wiki.lamsfoundation.org/display/lamsdocs/Setup+Java+Service+Wrapper+for+LAMS

Download and unpack the wrapper

Make you download the correct version of the wrapper. You want the Linux x86 Community Edition of the Java Service Wrapper

Note that there may be a later version of this wrapper available

cd
lynx http://wrapper.tanukisoftware.com/doc/english/download.jsp#stable
tar xzvf wrapper-linux-x86-32-3.5.20.tar.gz
cd wrapper-linux-x86-32-3.5.20/bin

cp wrapper /usr/local/jboss-5.1/bin

cd ../src/bin
cp sh.script.in /usr/local/jboss-5.1/bin/lams2

cd ../../lib
cp libwrapper.so /usr/local/jboss-5.1/lib
cp wrapper.jar /usr/local/jboss-5.1/lib

mkdir /usr/local/jboss-5.1/conf
cp /root/wrapper-linux-x86-32-3.5.20/src/conf/wrapper.conf.in  /usr/local/jboss-5.1/conf/wrapper.conf

mkdir /usr/local/jboss-5.1/logs


Edit the lams 2 configuration file as shown below

cd /usr/local/jboss-5.1/bin
nano lams2

Change the following lines

# Application
APP_NAME="@app.name@"
APP_LONG_NAME="@app.long.name@"

To read

# Application
APP_NAME="lams2"
APP_LONG_NAME="LAMS"


Edit the run.sh file as shown below:

nano run.sh

VERY carefully change the following lines

while true; do
   if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then
      # Execute the JVM in the foreground
      "$JAVA" $JAVA_OPTS \
         -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
         -classpath "$JBOSS_CLASSPATH" \
         org.jboss.Main "$@"
      JBOSS_STATUS=$?

To read

while true; do
   if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then
      # Execute the JVM in the foreground
      echo "$JAVA $JAVA_OPTS \
         -Djava.endorsed.dirs=$JBOSS_ENDORSED_DIRS \
         -classpath $JBOSS_CLASSPATH \
         org.jboss.Main $@"
      JBOSS_STATUS=$?


Edit the wrapper.conf configuration file as shown below

nano /usr/local/jboss-5.1/conf/wrapper.conf

VERY carefully change the following lines

#********************************************************************
# Wrapper Java Properties
#********************************************************************
# Java Application
#  Locate the java binary on the system PATH:
wrapper.java.command=java
#  Specify a specific java binary:
#set.JAVA_HOME=/java/path
#wrapper.java.command=%JAVA_HOME%/bin/java

# Tell the Wrapper to log the full generated Java command line.
#wrapper.java.command.loglevel=INFO

# Java Main class.  This class must implement the WrapperListener interface
#  or guarantee that the WrapperManager class is initialized.  Helper
#  classes are provided to do this for you.  See the Integration section
#  of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
wrapper.java.classpath.1=../lib/wrapper.jar

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=../lib

# Java Bits.  On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
wrapper.java.additional.auto_bits=TRUE

# Java Additional Parameters
wrapper.java.additional.1=

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64

# Application parameters.  Add parameters as needed starting from 1
wrapper.app.parameter.1=

#********************************************************************

To read

#********************************************************************
# Wrapper Java Properties
#********************************************************************
# Java Application
#  Locate the java binary on the system PATH:
#wrapper.java.command=java
#  Specify a specific java binary:
# set.JAVA_HOME=/java/path
# wrapper.java.command=$JAVA_HOME/bin/java
wrapper.java.command=/usr/java/jdk1.6.0_13/bin/java

# Tell the Wrapper to log the full generated Java command line.
#wrapper.java.command.loglevel=INFO

# Java Main class.  This class must implement the WrapperListener interface
#  or guarantee that the WrapperManager class is initialized.  Helper
#  classes are provided to do this for you.  See the Integration section
#  of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
wrapper.java.classpath.1=../lib/wrapper.jar
wrapper.java.classpath.2=../bin/run.jar
wrapper.java.classpath.3=$JAVA_HOME/lib/tools.jar

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=../lib

# Java Bits.  On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
# wrapper.java.additional.auto_bits=TRUE

# Java Additional Parameters
#wrapper.java.additional.1=
wrapper.java.additional.1=-Dprogram.name=run.sh
wrapper.java.additional.2=-XX:MaxPermSize=256m

# Initial Java Heap Size (in MB)
wrapper.java.initmemory=256m

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=512m

# Application parameters.  Add parameters as needed starting from 1
wrapper.app.parameter.1=org.jboss.Main

#********************************************************************

To save log files getting massive also change the following line

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

To read

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=NONE


Remember to create and symlink and make the lams2 file executable

cd /etc/init.d
ln -siv /usr/local/jboss-5.1/bin/lams2

chmod 755 /usr/local/jboss-5.1/bin/lams2

To start LAMS

service lams2 start

Sunday, February 20, 2011

Upgrading from LAMS 2.3.4 to 2.3.5

Upgrading from 2.3.4 to 2.3.5

The process I followed is explained below:

As the root user download lams-unix-updater-2.3.5.tar.gz into /root:

lynx http://wiki.lamsfoundation.org/display/lams/Downloads#Downloads-unix

Stop LAMS:

service lams2 stop

Unpack the updater:

tar -xzvf lams-unix-updater-2.3.5.tar.gz
cd lams-unix-updater-2.3.5

Now simply run the updater and answer the questions it asks:

./update-lams.sh

Start LAMS and restart Apache and your upgrade is complete:

service lams2 start
service httpd restart

Note that there is about a one minute wait between restarting LAMS and it becoming available from the browser.

Friday, December 24, 2010

Upgrading from LAMS 2.3.2 to 2.3.4

Upgrading from LAMS 2.3.2 to 2.3.4

This is a two step process as it is first necessary to upgrade from 2.3.2 to 2.3.3 and then subsequently from 2.3.3 to 2.3.4

Upgrading from 2.3.2 to 2.3.3

The process I followed is explained below:

As the root user download lams-unix-patch-2.3.3.tar.gz into /root:

lynx http://wiki.lamsfoundation.org/display/lams/Downloads#Downloads-unix

Stop LAMS:

service lams2 stop

Unpack the patch and copy the files over:

tar -xzvf lams-unix-patch-2.3.3.tar.gz
cd lams-unix-patch-2.3.3
"cp" -r lams.ear/* /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/

To avoid problems with server cacheing delete the following directories:

rm -rf /usr/local/jboss-4.0.2/server/default/work/
rm -rf /usr/local/jboss-4.0.2/server/default/tmp/

Start LAMS and restart Apache and your upgrade is complete:

service lams2 start
service httpd restart

Note that there is about a one minute wait between restarting LAMS and it becoming available from the browser.

Upgrading from 2.3.3 to 2.3.4

The process I followed is explained below:

As the root user download lams-unix-patch-2.3.4.tar.gz into /root:

lynx http://wiki.lamsfoundation.org/display/lams/Downloads#Downloads-unix

Stop LAMS:

service lams2 stop

Unpack the patch and copy the files over:

tar -xzvf lams-unix-patch-2.3.4.tar.gz
cd lams-unix-patch-2.3.4
"cp" -r lams.ear/* /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/
cp index.jsp /usr/local/jboss-4.0.2/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war

To avoid problems with server cacheing delete the following directories:

rm -rf /usr/local/jboss-4.0.2/server/default/work/
rm -rf /usr/local/jboss-4.0.2/server/default/tmp/

Start LAMS and restart Apache and your upgrade is complete:

service lams2 start
service httpd restart

Note that there is about a one minute wait between restarting LAMS and it becoming available from the browser.

Tuesday, September 01, 2009

Upgrading from LAMS 2.3.1 to 2.3.2

The process I followed to upgrade from LAMS 2.3.1 to 2.3.2 is explained below:

As the root user download lams-unix-patch-2.3.2.tar.gz into /root:

lynx http://wiki.lamsfoundation.org/display/lams/Downloads#Downloads-unix

Unpack the patch and copy the files over:

tar -xzvf lams-unix-patch-2.3.2.tar.gz
cd lams-unix-patch-2.3.2
"cp" -r * /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/

(Note the cp command is in quotes to override the interactive alias mode and save having to say y to every file copied over!)

Now stop and restart LAMS and your upgrade is complete:

service lams2 stop
service lams2 start
service httpd restart

Tuesday, June 23, 2009

Upgrading from LAMS 2.2 to 2.3.1

The upgrade needs to be completed in two stages, from 2.2 to 2.3 and then from 2.3 to 2.3.1

1) Upgrading from 2.2 to 2.3

As the root user download lams-unix-updater-2.3.tar.gz into /root:

lynx http://wiki.lamsfoundation.org/display/lams/Downloads#Downloads-unix

Unpack the updater and run the update script:

tar -xzvf lams-unix-updater-2.3.tar.gz
cd lams-unix-updater-2.3
./update-lams.sh

Answer the questions below:

The LAMS updater has detected a lams.properties file in /etc/lams2.
Do you wish to use this file? (y)es (n)o (q)uit

y

Do you want to run the LAMS shutdown script before continuing? (Recommended)
(y)es I want to run the JBOSS shutdown script.
(n)o I have already shutdown LAMS. Continue with the upgrade.
(q)uit.

y

Do you wish to automatically backup lams before updating?
(Recommended. NOTE: Requires MySql to be installed at localhost)
Please check the below directories are correct before running this
backup. If they are not, quit the installer and backup LAMS manually.
The space required to backup your LAMS installation:
17M /var/opt/lams
407M /usr/local/jboss-4.0.2
423M total
(y)es I wish to backup LAMS.
(n)o I have already backed up LAMS, I am ready to update.
(q)uit.

y
Please enter the full path of where you wish to backup lams
> /root/lams2.3
Note that this directory will be created for you by the installer

Now start LAMS and your upgrade is complete:

service lams2 start


2) Upgrading from 2.3 to 2.3.1

As the root user download lams-unix-patch-2.3.1.tar.gz into /root:

lynx http://wiki.lamsfoundation.org/display/lams/Downloads#Downloads-unix

Unpack the patch and run the script:

tar -xzvf lams-unix-patch-2.3.1.tar.gz
cd lams-unix-patch-2.3.1
./install-lams-patch.sh

You will be asked all the same questions as above. Note that any existing backup directory will be overwritten if you use the same path as given above.

Now start LAMS and your upgrade is complete:

service lams2 start

Sunday, April 05, 2009

LAMS 2.2 install on CentOS 5.2

As part of an ongoing investigation into elearning methods we are setting up a new CentOS 5.2 server running Moodle, DSpace and LAMS.

Currently the CentOS 5.2 server has installed:

httpd-2.2.3-11.el5_2.centos.4
mysql-server-5.0.45-7.el5
mysql-5.0.45-7.el5

1) Moodle 1.9 install

Moodle 1.9 is now sucessfully up and running on the new server.

Installation was relatively straightforward. The main problem I encountered with the Moodle install was that when I visited the admin page (index.php) at the end of the installation process it just produced a blank screen. It turned out that PHP5 installed with CentOS 5 did not include MySQL support!

This was solved as follows:

yum install php-mysql
service httpd restart

The index.php script ran happily after this

Also Moodle Admin > Environment came up with a couple of recommendations so I installed php-xmlrpc and php-mbstring as follows:

yum install php-xmlrpc
yum install php-mbstring
service httpd restart


2) LAMS 2.2 install

The process followed so far has been:

Edit the file /etc/my.cnf and add the READ-COMMITTED parameter as shown:

[mysqld]
transaction-isolation = READ-COMMITTED
etc...

Restart mysql using the folowing command:

service mysqld restart


Install phpMyAdmin 2.11.9.4 using cookie authentication.


As root, and in the root users home directory, download the JDK from Sun and install it using the following commands:

chmod 755 jdk-6u13-linux-i586-rpm.bin\&File\=jdk-6u13-linux-i586-rpm.bin
./jdk-6u13-linux-i586-rpm.bin\&File\=jdk-6u13-linux-i586-rpm.bin

Edit /etc/profile and set the JAVA_HOME variable as follows:

JAVA_HOME=/usr/java/jdk1.6.0_13
export JAVA_HOME
PATH=${PATH}:${JAVA_HOME}/bin
export PATH

Change the symlink for Java to point to the new location:

rm /usr/bin/java
ln -siv /usr/java/jdk1.6.0_13/bin/java /usr/bin/java

The java -version command will now produce the following output:

java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)



Download and install Wildfire 2.6.2 into the root users home directory:

Wildfire can be downloaded from http://www.igniterealtime.org/builds/wildfire/wildfire_2_6_2.rpm

rpm -ivh wildfire_2_6_2.rpm
rpm -q wildfire
wildfire-2.6.2-1

The configuration of the Wildfire server is covered later in this blog posting.


As root, and in the root users home directory, download jboss using lynx and unpack jboss:

lynx http://www.jboss.org/jbossas/downloads/
cp jboss-4.0.2.tar.gz /usr/local
cd /usr/local
tar -xzvf jboss-4.0.2.tar.gz


Edit /etc/profile and set the JBOSS_HOME variable as follows:

JBOSS_HOME=/usr/local/jboss-4.0.2
export JBOSS_HOME


Now test jboss is working:

cd jboss-4.0.2
cd bin
./run.sh &

Many screens of information appear as jboss starts and eventually the following line is displayed:

10:03:41,943 INFO [Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 16s:278ms

Use the following commands to confirm jboss is running:

nmap 127.0.0.1

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2009-04-05 10:05 BST
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1672 closed ports
PORT STATE SERVICE
25/tcp open smtp
80/tcp open http
443/tcp open https
631/tcp open ipp
3306/tcp open mysql
4444/tcp open krb524
8009/tcp open ajp13
8080/tcp open http-proxy


ps aux | grep jdk
root 15109 98.3 1.3 317272 106448 pts/1 Sl 10:09 0:20 /usr/java/jdk1.6.0_13/bin/java -server -Xms128m -Xmx128m -Dprogram.name=run.sh -Djava.endorsed.dirs=/usr/local/jboss-4.0.2/lib/endorsed -classpath /usr/local/jboss-4.0.2/bin/run.jar:/usr/java/jdk1.6.0_13/lib/tools.jar org.jboss.Main

Stop jboss:

./shutdown.sh -S


As root, and in the root users home directory, download LAMS using lynx and unpack the installer:

lynx http://lamscommunity.org/2.2/stable/unix/lams-unix-installer-2.2.tar.gz
tar -xxvf lams-unix-installer-2.2.tar.gz
cd lams-unix-installer-2.2

Note: The lams.properties file contains the installation settings for LAMS. It is important you get the settings in this file right. If you subsequently change lams.properties and re-run the installer you will overwrite your existing LAMS installation. Once LAMS has been installed all subsequent configuration changes must be made from and Admin login and not by editing lams.properties

Edit the lams.properties file and change the following settings (in bold):

# Installation Options

# The lamshome directory, will contain repository, temp and dump files
# Make sure this location has sufficient disk space as several files will be stored
# here during run time
LAMS_DIR=/var/opt/lams

# Username and password for the system admin for LAMS
LAMS_USER=yyyy
LAMS_PASS=xxxx

# Default language locale and text direction for LAMS, see section 3 of the readme
# Note that for English the ONLY choice supported by LAMS is en_AU
LOCALE=en_AU
LOCALE_DIRECTION=LTR


# Database name, username and password for your LAMS database
DB_NAME=lams2
DB_USER=lamsuser
DB_PASS=xxxx


# Wildfire configuration, used for chat tools. see the documentation under
# "Configuring the Chat Server" at:
# http://wiki.lamsfoundation.org/display/lams/Building+LAMS
# Make up a wildfire admin password
# Make a note of these settings as you will need them when configuring Wildfire later

WILDFIRE_DOMAIN=localhost
WILDFIRE_CONFERENCE=conference.localhost
WILDFIRE_USER=admin
WILDFIRE_PASS=zzzz


# Essential settings

# The port through which you want jboss to run
LAMS_PORT=8080

# The url you intend to use to run LAMS
# NOTE: Make sure the URL ends with a "/" or you will have problems running LAMS
SERVER_URL=http://vleinternal.bromley.ac.uk/lams/

# Where your home directory of JBoss is
# This will contain your LAMS installation
JBOSS_DIR=/usr/local/jboss-4.0.2

# The directory that contains your JDK. (Must be 1.5 or higher)
JDK_DIR=/usr/java/jdk1.6.0_13

# The location of your mysql executable (Must be 5.0 or higher)
SQL_DIR=/usr/bin

# The location of your MySql server, leave as localhost unless you are useing MySql on
# a separate server
SQL_HOST=localhost

# The port that your MySql server is running through
SQL_PORT=3306

# The URL that your jdbc driver will be running through
SQL_URL=jdbc:mysql://${SQL_HOST}:${SQL_PORT}/${DB_NAME}?characterEncoding=utf8&autoReconnect=true

# The root password to access the database
DB_ROOT_PASSWORD=xxxx


Run the lams unix installer script as follows:

./install-lams.sh

JDK_DIR is valid
MySql host is compatible with LAMS.
JBoss Directory Found

--------------------------------------------------------------------------------

WELCOME to the LAMS 2.2 unix Installer!

Please ensure you have read and accepted the license agreement before continuing

Make sure you have correctly configured the lams.properties file to your
preferred settings.

You should read the installation guide before continuing.

JAVA_HOME = /usr/java/jdk1.6.0_13

--------------------------------------------------------------------------------

LAMS requires about 117MB of space, continue with installation? (y)es, (n)o: y

--------------------------------------------------------------------------------

Do you wish to install LAMS as a Java Service Wrapper? (y)es, (n)o, (q)uit: y

The installer could not detect a suitable wrapper, please select one from below.
(1) wrapper-linux-x86-32-3.2.3
(2) wrapper-linux-x86-64-3.2.3
(3) wrapper-linux-ppc-64-3.2.3
(n) No wrapper, continue with install
(q) quit
> 1

Using LAMS database with the following parameters...
Database name: lams2
Database user: lamsuser
Database password: xxxx

Creating LAMS database.
Buildfile: ant-scripts/configure-database.xml
Database Created.

Filling database with LAMS tables

Buildfile: ant-scripts/filter-config.xml
Buildfile: ant-scripts/configure-database.xml

Done.

Database Created.

Copying lams.ear directory to /usr/local/jboss-4.0.2/server/default/deploy.

Done.

Configuring JBoss with your settings.
Buildfile: ant-scripts/configure-deploy.xml

Configuring the java Wrapper

Installing and configuring Java Service Wrapper: wrapper-linux-x86-32-3.2.3
Buildfile: ant-scripts/configure-deploy.xml
Done.

Copying lams.properties to /etc.

LAMS 2.2 Configuration completed!
Please view the README for instructions on how to run LAMS.



Getting Apache to talk to JBoss

I decided to use mod_jk instead of the deprecated mod_jk2 to link Apache and JBoss together.

As root, and in the root users home directory, download the source for mod_jk using lynx, compile and install the module:

lynx http://archive.apache.org/dist/jakarta/tomcat-connectors/jk/source/jk-1.2.15/
tar -xzvf jakarta-tomcat-connectors-1.2.15-src.tar.gz
cd jakarta-tomcat-connectors-1.2.15-src
cd jk/native
./buildconf.sh
yum install httpd-devel
./configure --with-apxs=/usr/sbin/apxs
make
cp /root/jakarta-tomcat-connectors-1.2.15-src/jk/native/apache-2.0/mod_jk.so /usr/lib/httpd/modules

Now create the following files:
cd /etc/httpd/conf
Create the file workers.properties containing the following:

ps=/
worker.list=worker1
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1

cd /etc/httpd/conf.d
Create the file jk.conf containing the following:

#
# Mod_jk2 allows the Apache Web server to connect to application
# servers using the AJP protocol. This allows web applications to
# be integrated seamlessly into your Apache server's URI space and
# utilize Apache features such as SSL processing.
#

LoadModule jk_module modules/mod_jk.so

#
# mod_jk is configured in /etc/httpd/conf/workers.properties
#

# Where to find workers.properties
JkWorkersFile /etc/httpd/conf/workers.properties
# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Send servlet for context /lams to worker named worker1
JkMount /lams worker1
# Send JSPs for context /lams/* to worker named worker1
JkMount /lams/* worker1
#
JkMount /upload/* worker1
#
JkMount /jmx-console/* worker1

Now to start LAMS:

service lams2 start
Starting LAMS...

ps aux | grep jdk
root 20297 87.2 6.2 961780 515220 ? Sl 07:09 2:28 /usr/java/jdk1.6.0_13/bin/java -Dprogram.name=run.sh -XX:MaxPermSize=256m -Xms246m -Xmx512m -Djava.library.path=../lib -classpath ../lib/wrapper.jar:../bin/run.jar:/usr/java/jdk1.6.0_13/lib/tools.jar -Dwrapper.key=9PVMzuBXkSSobgBc -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=20295 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.jboss.Main

nmap 127.0.0.1

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2009-04-06 07:13 BST
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1672 closed ports
PORT STATE SERVICE
25/tcp open smtp
80/tcp open http
443/tcp open https
631/tcp open ipp
3306/tcp open mysql
4444/tcp open krb524
8009/tcp open ajp13
8080/tcp open http-proxy


Hurray LAMS is now running. :)))

It is also accessible on port 80 of the server.

According to Luke Foxton (Macquarie University) when you choose to install with the wrapper, the installer alters the run-lams.sh script so it will work with the wrapper, with the idea being that once installed, the wrapper will automatically restart lams when the system reboots. However, this means that you can no longer use the run-lams.sh script to start lams directly.

The Wildfire chat server can be configured from a Web interface once it is running.

cd /opt/wildfire/bin
wildfire start
nano /etc/rc.d/rc.local
and append the following line

/opt/wildfire/bin/wildfire start

If you intend to use an external database for Wildfire you will at this point need to set up a wildfire database in MySQL, with a user who has appropriate privileges.

Then visit 127.0.0.1:9090 from your browser to complete the configuration. Note that you will need to use the Wildfire settings from lams.properties here.



3) Moodle - LAMS integration

Please note that it is necessary to retain the LAMS v1 module that came with Moodle and just keep it hidden. I deleted this module, not thinking I would need it and then found that with a LAMS v2 activity the buttons, Open Authoring and Add a New Lesson, were missing for Course Creators and Teachers. On re-installing the LAMS v1 module and keeping it hidden these buttons reappeared!

Download and install the lamstwo module:

cd /home/ictuser/moodle/mod
lynx http://wiki.lamsfoundation.org/display/lams/Integrations
unzip lamstwo.zip
mv lamstwo.php /home/ictuser/moodle/lang/en_utf8/
rm lamstwo.zip

Then login to LAMS as administrator and go to Sys Admin > Maintain Integrated Servers
> Add a New Server

Fill in the fields in the form paying particular attention to the ID, Key and User Information URL fields. My user information field contained the following string:

http://vleinternal.bromley.ac.uk/ict/mod/lamstwo/userinfo.php?ts=%timestamp%&un=%username%&hs=%hash%

Save your changes and then visit the Moodle admin page at which point the new tables for the lamstwo module will be added to the database. Visit the Modules > Activities > LAMSv2 page and fill in the settings.

Click on the validate button and if all is well you will get the following message "These settings are valid". This means that Moodle can talk to LAMS and LAMS can talk to Moodle.

In my case validation failed and it was only with the help of Jun-Dir and some painstaking research on my part that I found out that the cause of the failure was an extra blank line at the end of Moodle's config.php script outside the closing PHP tag!

Sunday, February 12, 2006

LAMS 1.0.x installation procedure on CentOS 4


Written by Clive Gould. (To contact Clive please use this messages form. Our Linux training website can be reached by clicking here)

Please contact me using the above form if you find anything in this blog which is unclear or inaccurate and I'll be happy to put it right.

Menu

1) LAMS 1.0.1 installation procedure
2) LAMS 1.0.2 installation procedure
3) Installing LAMS 1.0.2 alongside DSpace
4) Sorting out 400, 403 and 404 errors
5) Moodle Lams Integration Error with config.php


1) LAMS 1.0.1 installation procedure (July 2005)

i) Introduction

I spent some time getting LAMS 1.0.1 (Learning Activity Management System) to work on a CentOS 4 Linux platform.

The actual procedure turned out to be quite straightforward, but was complicated along the way by confusing documentation and mistakes I made. The reason I chose CentOS 4 at the time was mainly because it had mysql 4 pre-installed, which Fedora Core 3 did not.

I did not realise that the LAMS installer Redhat script would take care of everything for me so went about things the "hard way" by following the custom installation procedure in the LAMS documentation. This blog is a historical document and explains the process I went through. If you are using this as an install guide, you can save yourself a lot of time and heartache by reading the entire blog BEFORE beginning your installation!


ii) Historical Installation Procedure

All the following operations were carried out as root.

Firstly I installed the sdk. I downloaded the executable rpm.bin from Sun. I had first to download the rpm.bin then chmod it and run it to extract the rpm. I then installed the sdk in /usr/java by using the command:

rpm -ivh j2sdk1.4.2_08.rpm


I then appended paths to /etc/profile as follows:.

JAVA_HOME=/usr/java/j2sdk1.4.2_08
export JAVA_HOME
PATH=${PATH}:${JAVA_HOME}/bin
export PATH


I started started mysql and checked the version number as shown below:

[root@cc ~]# service mysqld start
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]


[root@cc ~]# mysqladmin version
mysqladmin Ver 8.41 Distrib 4.1.10a, for redhat-linux-gnu on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 4.1.10a
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 29 sec

Threads: 1 Questions: 2 Slow queries: 0 Opens: 11 Flush tables: 1
Open tables: 0 Queries per second avg: 0.069



I then set the root password for mysql using the command:

[root@cc ~]# mysqladmin -u root password "xxxx"

I replaced the xxxs's above with my new mysql root password. (I made the mistake of including spaces in my initial password. Do not do this as the LAMS install script will not work properly if you include spaces in this password!)


I then used the chkconfig command to automaticaly start mysql on boot as follows:

root@cc ~]# chkconfig mysqld on

[root@cc ~]# chkconfig --list grep mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off


It was now necessary to tell mysql to use READ-COMMITTED transaction isolation instead of the default setting of this parameter. This was achieved by setting the transaction-isolation as in the default configuration file /etc/my.cnf as shown below:

[root@cc ~]# nano /etc/my.cnf

[mysqld]
transaction-isolation = READ-COMMITTED
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


I then restarted mysql so that the new setting would take effect:

[root@cc ~]# service mysqld stop
Stopping MySQL: [ OK ]
root@cc ~]# service mysqld start
Starting MySQL: [ OK ]


I then, unnecessarily as it turned out, downloaded and installed jboss-3.0.8_tomcat-4.1.24.zip (with integrated Tomcat 4.1.24)


I then downloaded and installed ant using the command shown below:

cd /usr/local
lynx http://ant.apache.org/bindownload.cgi
tar -xzvf apache-ant-1.6.5-bin.tar.gz
rm apache-ant-1.6.5-bin.tar.gz
rm: remove regular file `apache-ant-1.6.5-bin.tar.gz'? y
ln -s apache-ant-1.6.5 ant


I then set up the path for ant by editing /etc/profile as follows:

[root@cc local]# nano /etc/profile
Append to the end of the file:

PATH=$PATH:ANT_HOME/binANT_HOME=/usr/local/ant; export ANT_HOME
PATH=${PATH}:${ANT_HOME}/bin
export PATH

I then logged out and back in again for the path to take effect and checked that ant was accessible:

[root@cc ~]# ant -version
Apache Ant version 1.6.5 compiled on June 2 2005


I then downloaded and installed LAMS (something I should have done at the very beginning!) as follows:

From the root users home directory:

lynx http://www.lamsfoundation.org/downloads/
unzip redhat-lams-server1.0.1.zip
cd redhat*/lams-package/lib


I then downloaded and installed the mysql connector, which would allow JBoss to talk to mysql:

lynx http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-3.0.16-ga.tar.gz/from/pick
tar -xzvf mysql-connector-java-3.0.16-ga.tar.gz
rm mysql-connector-java-3.0.16-ga.tar.gz
remove regular file `mysql-connector-java-3.0.16-ga.tar.gz'? y
cd mysql*
mv mysql-connector-java-3.0.16-ga-bin.jar ../
cd ..
rm -rf mysql-connector-java-3.0.16-ga


I then logged on to mysql and tried to set up appropriate databases and privileges (Later on phpmyadmin turned out to be a MUCH better solution.) The next step was to move to the LAMS ant directory and try to edit build.xml. This turned out to be incredibly hard going and even when I was satisfied Tomcat would not start properly.



iii) An Improved Approach to Installation

This failure led me to look at the contents of the LAMS install directory carefully. I discovered that it actually contained an install script ready made for RedHat Enterprise Linux 3!

On looking at this script (redhat_install.sh) I realised that most of the installation I had undertaken so far could have been achieved by running this script and that all the necessary pacakges (e.g. jboss, ant, sdk) had already been included in LAMS download!!

The other interesting file turned out to be LAMS.SETTINGS - this was a simple text based configuration file that took all the work out of configuring build.xml!


I reinstalled the LAMS download to give me clean copies of the build.xml file etc.
I downloaded and installed phpmyadmin as follows:

lynx http://www.phpmyadmin.net/home_page/downloads.php#2.6.2-pl1
tar -xzvf phpMyAdmin-2.6.2-pl1.tar.gz
mv phpMyAdmin-2.6.2-pl1 phpmyadmin
cd phpmyadmin

I then made the changes shown in bold below to phpmyadmin/config.inc.php

nano config.inc.php

$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'xxxx';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
cfg['Servers'][$i]['password'] = 'xxxx';

I went to the webpage for phpmyadmin and created a database called lams.

I gave to the mysql root user full privileges as shown below:

User: root
Host: %
Type: global
Privileges: ALL
Grant: Yes

I then set up a user called lams, with a password of yyyy and gave this user the following privileges on the lams database:

User: lams
Host: %
Type: database-specific
Privileges: ALL
Grant: Yes


I then edited LAMS.SETTINGS and the result for my system is shown below:

cat LAMS.SETTINGS
# Check lams-package/ant/build.xml for a detailed explanation of these fields
# or to setup advanced options

LAMS_VERSION="1.0.1-yoichi"

LAMS_HOME=/usr/local/lams/server1.0.1
LAMS_UPLOADS=$LAMS_HOME/lamsdata
LAMS_JBOSS_HOME=$LAMS_HOME/jboss

#### LAMS Community Interaction
LAMS_IS_ONLINE=false
ORGNISATION_KEY=

#### LAMS Admin User and Password

LAMS_ADMIN_USER=lamsadmin
LAMS_ADMIN_PASSWORD=zzzz

#### MySQL Database Details

# Currently not being used
#MYSQL_ALREADY_CONFIGURED=true

MYSQL_HOME=/usr/share/mysql
MYSQL_BINARIES_PATH=
MYSQL_SERVICE_NAME=mysql

LAMS_DB_NAME=lams
LAMS_DB_USER=lams

LAMS_DB_ROOT_PASSWORD=xxxx
LAMS_DB_PASSWORD=yyyy
LAMS_MYSQL_HOST=172.31.0.5

#### Configure the application server

LAMS_TOMCAT_PORT=8080
LAMS_CHAT_PORT=9800
LAMS_EMAIL_ADDRESS=root@cc.bromley.ac.uk
LAMS_SMTP_SERVER=172.31.0.5

LAMS_JBOSS_HOST=172.31.0.5

All the IP addresses used above are the internal IP addresses of the cc server inside our NAT firewall. The username and password pair for lams adminstration are used when you log into LAMS from the browser, so need careful consideration.

I then ran the ./redhat-install.sh script and accepted all the default options apart from choosing to skip the MySQL setup.

This checked that I had all the necessary packages installed, installed the server into /usr/local/lams/server1.0.1, built and started the server automatically.

After a while a message appeared to the effect that the server had started and I was able to hit CTRL+C to exit the script. I then had to wait quite a while during which time a screen full of cryptic messages appeared until eventually after numerous refreshes of the browser the LAMS login screen appeared. (Hallelujah :-)))


Before rebuilding LAMS after making changes to the LAMS.SETTINGS file I found it necessary to:

1) Use phpmyadmin to drop all tables in the lams database.
2) Completely remove the directory /usr/local/lams/server1.0.1



iv) Getting Apache to talk to JBoss

LAMS was now fully up and running on the cc server on port 8080 but we could only access it externally because our staff and student network proxy servers only allow access via ports 80 and 443 to "external" servers! To get round this I set up Apache to talk to JBoss using mod_jk2 so that a URL in the format:

http://cc.bromley.ac.uk/lams

automatically provided access to:

http://cd.bromley.ac.uk:8080/lams

I tried a number of different ways of getting this to work and found much of the documentation available on the Internet on this subject decidedly confusing. (I managed to miss finding the Solaris instructions in the LAMS documentation zip until after writing this guide, mainly due to the Windows unzip tool I was using truncating the filenames.)

The steps I took that actually produced a working solution are outlined below:

Using ftp I copied mod_jk2.so from Fedora Core 3 /etc/httpd/modules into CentOS 4
/etc/httpd/modules and made sure its permissions were 755.


I then created jk2.conf in /etc/httpd/conf.d as shown below:

cd /etc/httpd/conf.d
nano jk2.conf

#
# Mod_jk2 allows the Apache Web server to connect to application
# servers using the AJP protocol. This allows web applications to
# be integrated seamlessly into your Apache server's URI space and
# utilize Apache features such as SSL processing.
#

LoadModule jk2_module modules/mod_jk2.so

#
# Mod_jk2 is configured in /etc/httpd/conf/workers2.properties
#


I then created workers2.properties in /etc/httpd/conf as shown below:

cd /etc/httpd/conf
nano workers2.properties

[logger.file:0]
level=WARN
file=${serverRoot}/logs/jk2.log

[shm]
info=Defines the shared memory
file=${serverRoot}/logs/jk2.shm
size=1000000
debug=0
disabled=0

[channel.socket:localhost:8009]
info=Defines the local Tomcat server
tomcatId=jvm1
host=localhost
port=8009

[ajp13:localhost:8009]
info=Defines the default ajp13 worker
channel=channel.socket:localhost:8009

[status:status]
info=Defines the status worker

[uri:/jkstatus/*]
group=status:status

[uri:/scheduler/*]
context=/scheduler

[uri:/lams/*]
context=/lams


I then edited the JBoss server.xml file to modify the default engine container to include the jmvRoute attribute. The engine container I used (with opening and closing tags removed in order to display properly in this blog) is shown below:

nano /usr/local/lams/server1.0.1/jboss/tomcat-4.1.x/conf/server.xml

Engine name="Standalone" defaultHost="localhost" debug="0" jmvRoute="jvm1"


I then stopped LAMS and edited the jk2.properties file, which was otherwise just comments:

/etc/init.d/lams stop

nano /usr/local/lams/server1.0.1/jboss/tomcat-4.1.x/conf/jk2.properties

and appended the line shown below to the end of this file:

channelSocket.port=8009


I then restarted Apache and started LAMS:

service httpd restart
/etc/init.d/lams start

I was delighted to find that when I visited http://cc.bromley.ac.uk/lams it worked :-) What's more it also worked from our staff and student network behind the proxy servers :-))

I subsequently installed a copy of Moodle 1.5 on the same server and it is running happily alongside LAMS.

Return to Menu


2) LAMS 1.0.2 installation procedure (February 2006)

Today I undertook a fresh installation of LAMS 1.0.2 from the root account on a CentOS 4 Linux server.

The first step was to download and install the jdk.

lynx http://java.sun.com/j2se/1.4.2/download.html

Note that you need the 1.4 JDK NOT the 1.5 jdk for LAMS 1.0.2.

chmod 755 j2sdk*

./j2sdk-1_4_2_10-linux-i586-rpm.bin

rpm -ivh j2sdk-1_4_2_10-linux-i586.rpm


Once the jdk was installed I added the appropriate paths to /etc/profile:

Append to /etc/profile:

JAVA_HOME=/usr/java/j2sdk1.4.2_10
export JAVA_HOME
PATH=${PATH}:${JAVA_HOME}/bin
export PATH


The next step was to configure MySQL. To be on the safe side I completely removed the existing MySQL installation and re-installed a clean copy using yum. (Don't re-install MySQL if you already have a copy of Moodle running on the same server!)

I set MySQL to start automatically at boot as follows:

chkconfig mysqld on
chkconfig --list grep mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off


I also set the READ COMMITTED option in the MySQL configuration file:

pico /etc/my.cnf

[mysqld]
transaction-isolation = READ-COMMITTED
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

I then started MySQL:

service mysqld start

I logged on to mysql as root using the following command:

mysql -u root -p

The root password was set as follows:

mysql> set password = password("XXXX");

quit

Where XXXX represents the new password

I initially downloaded and installed phpMyAdmin 2.7.0 but could not get it to work
properly with MYSQL 4.1 so downloaded and installed phpMyAdmin-2.6.4-pl4 instead.

I downloaded and installed phpmyadmin as follows:

cd /var/www/html
lynx http://www.phpmyadmin.net/home_page/downloads.php#2.6.2-pl4
tar -xzvf phpMyAdmin-2.6.2-pl4.tar.gz
mv phpMyAdmin-2.6.2-pl4 phpmyadmin
cd phpmyadmin

I then made the changes shown in bold below to phpmyadmin/config.inc.php

nano config.inc.php

$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'XXXX';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
cfg['Servers'][$i]['password'] = 'XXXX';

Where XXXX represents the root password for MySQL.

I used the browser to go to the web page for phpmyadmin (http://cc.bromley.ac.uk/phpmyamdin) and gave to the mysql root user full privileges as shown below:

User: root
Host: %
Type: global
Privileges: ALL
Grant: Yes

(Note that with LAMS 1.0.2 it was not necessary to create the LAMS database using phpMyAdmin as the LAMS installer now takes care of this. It is a good idea to password protect access to phpMyAdmin using a .htaccess file.)

I then went on to download and install LAMS as follows:

cd /home

lynx http://lamscommunity.org/lams-server1.0.2.zip

unzip lams*

cd lams-server1.0.2/config

I edited the lams.conf file to include the correct path for JAVA_HOME as follows:

pico lams.conf

## LAMS Server 1.0.2 - Used by the init script
export LAMS_HOME=/usr/local/lams/
export LAMS_VERSION=1.0
export JBOSS_HOME=/usr/local/lams/jboss
export JAVA_HOME="/usr/java/j2sdk1.4.2_10/"
export PATH="$JAVA_HOME/bin:$PATH"

I created the lams directory and copied over the JBOSS files:

mkdir /usr/local/lams

cp -r /home/lams-server1.0.2/jboss /usr/local/lams

Now I created the jboss user and made that user the owner and group owner of the jboss directory:

useradd jboss

chown jboss:jboss /usr/local/lams/jboss

chmod 755 /usr/local/lams/jboss/bin/*

I then edited the file build.properties as shown below:

cd /home/lams-server1.0.2/lams-package/ant

pico build.properties

# Properties file for ant install for LAMS
#
# NOTE: Installation platform is auto-detected
#
# ===============================================
# JBoss location for UNIX
LAMS_JBOSS_HOME_UNIX=/usr/local/lams/jboss

# ===============================================
# LAMS temp data directory for UNIX
LAMS_HOME_UNIX=/usr/local/lams

# ===============================================
# JBoss location for Windows
LAMS_JBOSS_HOME_WINDOWS=D:/jboss-3.0.8_tomcat-4.1.24

# ===============================================
# LAMS temp data directory for Windows
LAMS_HOME_WINDOWS=D:/home/lams

# ===============================================
# Tell Ant the MySQL db root password. That is what
# you have set when you installed MySQL.
# This is required only if you run "ant db-prep-only
LAMS_DB_ROOT_PASSWORD=XXXX

# ===============================================
# Tell Ant the hostname of the MySQL server that
# should be put in the MySQL grant able.
# MySQL seems unhappy with just 'localhost' or '%'
# in the grant table, in order to be able to connect
# from a client on the server itself.
# You can use either the hostname or the IP address,
# that is in the server's /etc/host file.
LAMS_MYSQL_HOST=172.31.0.5

# ===============================================
# Tell Ant the hostname of the LAMS server that
# should be put in the MySQL grant table.
#
# If the same server is used for both LAMS and MySQL,
# set this to "localhost".
#
# If LAMS server connects from another server and
# if it can only connect behind a firewall and with
# DNS settings as below:
#
# External IP-Address: 137.111.132.34
# Internal Hostname: b1600-s0.lib.mq.edu.au
# internal IP-Address: 192.168.1.30
#
# then this value must be set with the internal address.
# You can use either 192.168.1.30, b1600-s0 or
# b1600-s0.lib.mq.edu.au.
LAMS_JBOSS_HOST=localhost

# ===============================================
# The name of the LAMS database name
# The default is "lams". Ant will create the database
# if it did not exist. If it existed, it will be emptied.
# You may change this if you have more than one instance
# of LAMS running on the same instance of MySQL.
LAMS_DB_NAME=lams

# ===============================================
# The userid for the LAMS database.
# The default is "lams".
# "ant prepare-db" will set the userid to this value.
# You may change this value
LAMS_DB_USER=lams

# ===============================================
# The password for the userid for the LAMS database.
# "ant prepare-db" will set the password to this value.
# You must change this value for security reasons
LAMS_DB_PASSWORD=XXXX

# ===============================================
# The MySQL connector jar file name.
# This is to establish the connection for
# Ant tasks to run some SQL scripts
# This file must be placed inside the /lib
MYSQL_CONNECTOR_JAR_FILE=mysql-connector-java-3.1.11-bin.jar

# ===============================================
# JBoss Web server port number.
# JBoss normally uses 8080
# You may change this value
LAMS_TOMCAT_PORT=8080

# ===============================================
# JBoss Web server (Tomcat) request processor parameters.
# You may change these values. (Refer to Tomcat manual)
# These values affect LAMS performance greatly
MIN_PROCESSOR=5
MIN_PROCESSOR=75
ACCESS_COUNT=100
ENABLE_LOOKUP=false

# ===============================================
# JBoss mod_jk connector (Tomcat) request processor parameters.
# You may change these values. (Refer to Tomcat manual)
JK_MIN_PROCESSOR=5
JK_MIN_PROCESSOR=75
JK_ACCESS_COUNT=100
JK_ENABLE_LOOKUP=false

# ===============================================
# Certain Tools in LAMS send emails.
# You must set these parameters for your site,
# although LAMS still functions even if this is not set.
LAMS_ADMIN_EMAIL_ADDRESS=root@cc.bromley.ac.uk
LAMS_SMTP_SERVER=172.31.0.5

# ===============================================
# The port number where the lams chat server
# would be listening. In case you are behind a firewall you have to
# open this port for commucnication
LAMS_CHAT_PORT=9800

# ===============================================
# LAMS superuser userid. "admin" is reserved and cannot be used
LAMS_ADMIN_USER=root

# ===============================================
# Password for the LAMS superuser "root".
# "ant install" or "ant conf-only" will register it
# with LAMS database.
LAMS_ADMIN_PASSWORD=xxxxxxxxxxxxx

# ===============================================
# MySQL connection pool size.
# You may change these values if you need more connections.
# NOTE: You have to also increase MySQL max_connections if
# MYSQL_MAX_POOL_SIZE exceeds the config paramter.
# @see http://dev.mysql.com/doc/mysql/en/cj-general-j2ee-concepts.html
MYSQL_MIN_POOL_SIZE=10
MYSQL_MAX_POOL_SIZE=100

# ===============================================
# JBoss JVM memory sizes in MB.
# Eg. if you can give LAMS 1GB, set max to 512MB.
# because the actual memory size can grow twice as much.
# Setting min=max will reduce overhead in heap management.
JVM_MIN_HEAP=256
JVM_MAX_HEAP=256

# ===============================================
# LAMS log level
# Values are: ERROR,DEBUG,INFO,WARN
# You may change this value.
LOG_LEVEL=ERROR


I then edited /etc/profile to add the path for ANT:

pico /etc/profile

and appended the following text:

ANT_HOME=/home/lams-server1.0.2/apache-ant
export PATH=$PATH:$ANT_HOME/bin

It was now time to get ANT to prepare the database:

chmod 755 /home/lams-server1.0.2/apache-ant/bin/ant

cd /home/lams-server1.0.2/lams-package/ant

ant prepare-db
Buildfile: build.xml
[echo] it is unix
[echo] jboss home is: /usr/local/lams/jboss
[echo] LAMS home is: /usr/local/lams

prepare-db:
[echo] it is unix
[echo] jboss home is: /usr/local/lams/jboss
[echo] LAMS home is: /usr/local/lams

_prep_db:
[echo] This creates the database and sets username/password
[echo] mysql.classpath=/home/lams-server1.0.2/lams-package/lib/mysql-connector-java-3.1.11-bin.jar
[echo] url=jdbc:mysql://172.31.0.5/mysql
[echo] userid=root
[echo] password=XXXX
[sql] Executing commands
[sql] 18 of 18 SQL statements executed successfully

BUILD SUCCESSFUL
Total time: 2 seconds


ant install

ant install also ran successfully:
BUILD SUCCESSFUL
Total time: 13 seconds


I then set up LAMS so that it started automatically on boot:

cd /home/lams*/config

chmod 755 lams

cp lams /etc/init.d

cp lams.conf /etc

chkconfig lams on

service lams start

LAMS took a little while to start up

On visting http://cc.bromley.ac.uk:8080/lams/ the login page was available.

LAMS was now fully up and running on the cc server on port 8080 but we could only access it externally because our staff and student network proxy servers only allow access via ports 80 and 443 to "external" servers! To get round this I set up Apache to talk to JBoss using mod_jk2 so that a URL in the format:

http://cc.bromley.ac.uk/lams

automatically provided access to:

http://cd.bromley.ac.uk:8080/lams

The steps I took are outlined below:

Using ftp I copied mod_jk2.so from Fedora Core 3 /etc/httpd/modules into CentOS 4
/etc/httpd/modules and made sure its permissions were 755.


I then created jk2.conf in /etc/httpd/conf.d as shown below:

cd /etc/httpd/conf.d
nano jk2.conf

#
# Mod_jk2 allows the Apache Web server to connect to application
# servers using the AJP protocol. This allows web applications to
# be integrated seamlessly into your Apache server's URI space and
# utilize Apache features such as SSL processing.
#

LoadModule jk2_module modules/mod_jk2.so

#
# Mod_jk2 is configured in /etc/httpd/conf/workers2.properties
#


I then created workers2.properties in /etc/httpd/conf as shown below:

cd /etc/httpd/conf
nano workers2.properties

[logger.file:0]
level=WARN
file=${serverRoot}/logs/jk2.log

[shm]
info=Defines the shared memory
file=${serverRoot}/logs/jk2.shm
size=1000000
debug=0
disabled=0

[channel.socket:localhost:8009]
info=Defines the local Tomcat server
tomcatId=jvm1
host=localhost
port=8009

[ajp13:localhost:8009]
info=Defines the default ajp13 worker
channel=channel.socket:localhost:8009

[status:status]
info=Defines the status worker

[uri:/jkstatus/*]
group=status:status

[uri:/scheduler/*]
context=/scheduler

[uri:/lams/*]
context=/lams


I then edited the JBoss server.xml file to modify the default engine container to include the jmvRoute attribute. The engine container I used (with opening and closing tags removed in order to display properly in this blog) is shown below:

nano /usr/local/lams/jboss/tomcat-4.1.x/conf/server.xml

Engine name="Standalone" defaultHost="localhost" debug="0" jmvRoute="jvm1"


I then stopped LAMS and edited the jk2.properties file, which was otherwise just comments:

service lams stop

nano /usr/local/lams/jboss/tomcat-4.1.x/conf/jk2.properties

and appended the line shown below to the end of this file:

channelSocket.port=8009


I then restarted Apache and started LAMS:

service httpd restart
service lams start

I was delighted to find that when I visited http://cc.bromley.ac.uk/lams it worked :-) What's more it also worked from our staff and student network behind the proxy servers :-))

The next step was to configure Moodle on vle.bromley.ac.uk to include LAMS as an activity.

The following website proved invaluable in this and the instructions were clear, easy to follow and worked first time :-)))

http://lamsfoundation.org/integration/moodle/

Return to Menu


3) Using LAMS with DSpace and Apache along with mod_jk2 (February 2006)

I have just done an install of LAMS on our VLE server, which already has a copy of Moodle and DSpace running on it. If you are interested in DSpace installation please select this link. DSpace uses its own copy of Tomcat so I needed to get multiple instances of Tomcat, accessible via a single Apache server.

Below are the instructions for how I got LAMS JBOSS Tomcat running on the same server (CentOS 4) as DSpace Tomcat . Both Tomcat servers are now accessible on port 80 via Apache and mod_jk2.

Note that you need the 1.4 JDK NOT the 1.5 jdk for LAMS 1.0.2. I ran into trouble of installing LAMS on our VLE server, which already had the the 1.5 JDK pre-installed and I found I could not build the LAMS application. I had to download and install the 1.4.2 JDK as well and subsequently had to add appropriate pathing information for the 1.4 JDK to run.sh, ant and lams.conf. To help anyone else who makes the same mistake the error messages that appeared were:

[1] Done ./run.sh
[root@vle bin]#
================================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /usr/local/lams/jboss

JAVA: /usr/java/jdk/bin/java

JAVA_OPTS: -server -Xms256m -Xmx256m -Dprogram.name=run.sh

CLASSPATH: /usr/local/lams/jboss/bin/run.jar:/usr/java/jdk/lib/tools.jar

================================================================================

06:30:53,332 INFO [Server] JBoss Release: JBoss-3.0.8 CVSTag=JBoss_3_0_8
06:30:53,339 INFO [Server] Home Dir: /usr/local/lams/jboss
06:30:53,339 INFO [Server] Home URL: file:/usr/local/lams/jboss/
06:30:53,339 INFO [Server] Library URL: file:/usr/local/lams/jboss/lib/
06:30:53,340 INFO [Server] Patch URL: null
06:30:53,340 INFO [Server] Server Name: default
06:30:53,340 INFO [Server] Server Home Dir:
/usr/local/lams/jboss/server/default
06:30:53,341 INFO [Server] Server Home URL:
file:/usr/local/lams/jboss/server/default/
06:30:53,341 INFO [Server] Server Data Dir:
/usr/local/lams/jboss/server/default/db
06:30:53,341 INFO [Server] Server Temp Dir:
/usr/local/lams/jboss/server/default/tmp
06:30:53,341 INFO [Server] Server Config URL:
file:/usr/local/lams/jboss/server/default/conf/
06:30:53,342 INFO [Server] Server Library URL:
file:/usr/local/lams/jboss/server/default/lib/
06:30:53,342 INFO [Server] Root Deployemnt Filename: jboss-service.xml
06:30:53,344 INFO [Server] Starting General Purpose Architecture (GPA)...
06:30:53,363 ERROR [Server] start failed
javax.management.InstanceNotFoundException:
JMImplementation:service=LoaderRepository,name=Default
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:804)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at
org.jboss.system.server.ServerImpl.initBootLibraries(ServerImpl.java:440)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:261)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
at org.jboss.Main.boot(Main.java:148)
at org.jboss.Main$1.run(Main.java:381)
at java.lang.Thread.run(Thread.java:595)
javax.management.InstanceNotFoundException:
JMImplementation:service=LoaderRepository,name=Default
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:804)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at
org.jboss.system.server.ServerImpl.initBootLibraries(ServerImpl.java:440)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:261)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
at org.jboss.Main.boot(Main.java:148)
at org.jboss.Main$1.run(Main.java:381)
at java.lang.Thread.run(Thread.java:595)


The DSpace installation of Tomcat was already running on the VLE server using the default ports.

Before building LAMS I edited the file build.properties as configured in sectiion of this blog to change the Tomcat port from 8080 to 8081.

Shown below are the workers2.properties and the JBOSS Tomcat server.xml file that I successfully used:

cd /etc/httpd/conf

less workers2.properties

[logger.file:0]
level=WARN
file=${serverRoot}/logs/jk2.log

[shm]
info=Defines the shared memory
file=${serverRoot}/logs/jk2.shm
size=1000000
debug=0
disabled=0

[channel.socket:localhost:8009]
info=Defines the DSpace Tomcat server
host=localhost
tomcatId=jvm1
host=localhost
port=8009

[channel.socket:localhost:8010]
info=Defines the LAMS Tomcat server
host=localhost
tomcatId=jvm2
port=8010

[ajp13:localhost:8009]
info=Defines the DSpace ajp13 worker
channel=channel.socket:localhost:8009

[ajp13:localhost:8010]
info=Defines the LAMS ajp13 worker
channel=channel.socket:localhost:8010

[status:status]
info=Defines the status worker

[uri:/jkstatus/*]
group=status:status

[uri:/scheduler/*]
context=/scheduler

[uri:/dspace/*]
group=ajp13:localhost:8009

[uri:/dspace-oai/*]
group=ajp13:localhost:8009

[uri:/lams/*]
group=ajp13:localhost:8010


In the /usr/local/lams/jboss/tomcat-4.1.x/conf/server.xml file I changed the port allocations to make sure that JBOSS Tomcat was not listening on the same ports as LAMS Tomcat.

The lines I changed are shown in bold below. I've missed out the xml tags as they will interfere with your viewing this blog.

Server port="8006" shutdown="SHUTDOWN" debug="0"

Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8081" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true"

Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8010" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="0"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"

Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm2"

On restarting Apache:
Moodle was available on http://vle.bromley.ac.uk/vle
DSpace was available on http://vle.bromley.ac.uk/dspace
LAMS was available on http://vle.bromley.ac.uk/lams
:-)))

Return to Menu


4) Sorting out 400, 403 and 404 errors (February 2006)

We've just been using LAMS from within Moodle and have encountered seemingly arbitary 403 error messages in one or more frames. After a number of refreshes/revists to the site these disappear.

I found a fix for this on the LAMS Community Technical Forum on 22nd February and duplicate the solution that worked for me below:

nano /usr/local/lams/jboss/server/default/conf/jboss-service.xml

Locate the lines lines containing the named attributes DefaultCacheTimeout and DefaultCacheResolution and comment each line out separately using <-- -->

Restart LAMS:

service lams stop
service lams start

Hurray the 403 messages appear to have gone away :-)


I also had the following 400 and 404 errors, which went away once I closed the offending browser window and reselected the LAMS Learner link within Moodle.

Initially when I clicked on the Open LAMS Learner link I got the following message:

HTTP Status 400 - Invalid direct reference to form login page

-----------------------------------------------------------

type Status report

message Invalid direct reference to form login page

description The request sent by the client was syntactically incorrect (Invalid direct reference to form login page).

-----------------------------------------------------------

Apache Tomcat/4.1.24-LE-jdk14



On refreshing the browser window I then got the following message:

HTTP Status 404 - /lams/j_security_check

-----------------------------------------------------------

type Status report

message /lams/j_security_check

description The requested resource (/lams/j_security_check) is not available.


The solution was to download lams-valve.jar from here on the lamscommunity forum.

(Note: I initially used Internet Explorer to download the above jar file and found it had downloaded lams-valve.jar.zip - just a matter of uploading this file to the Linux box and renaming it lams-valve.jar)

I copied the downloaded lams-valve.jar to

/usr/local/lams/jboss/server/default/lib

On restarting LAMS and visting it from Moodle was well and the 400 and 404 error messages no longer appeared.


Return to Menu




5) Moodle Lams Integration Error with config.php (May 2006)

Despite Moodle and LAMS integration appearing to work well, I noticed some error messages appearing in the Apache error_log file relating to LAMS:

[client 10.200.0.1] PHP Warning: main(../../config.php): failed to open stream: No such file or directory in /home/bcvleuser/moodle/mod/lams/lib.php on line 4

The solution was to modify /home/bcvleuser/moodle/mod/lams/lib.php to correctly define the path to Moodle's config.php script as follows:

/// Library of functions and constants for module lams
include_once("/home/bcvleuser/moodle/config.php");


Once I had modified lib.php the error went away :-)

I have also noticed the following error messages in the Apache error_log file relating to mod_jk2 and LAMS:

[error] channelSocket.receive(): Error receiving message body -1 11
[error] workerEnv.processCallbacks() Error reading reply
[error] ajp13.service() ajpGetReply recoverable error 120000


These seem to appear in the error_log whenever LAMS is called from Moodle.
I have yet to find out the significance of these messsages!


Return to Menu