LAMS installation and configuration: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
Line 2: Line 2:
== Definition ==
== Definition ==


This page contains installation tips for [[LAMS]]
This page contains installation tips for [[LAMS]]. Mostly LAMS 2.1RC1 for Solaris 10.


LAMS is a JAVA/JBoss-based application and needs some installation skills on Windows and good installation skills for Unix.
LAMS is a JAVA/JBOSS-based application and needs some installation skills on Windows and good installation skills for Unix.


== LAMS 2RC2 Windows XP PC ==
== LAMS 2RC2 Windows XP PC ==
Note: This chapter is outdated (written in Dec 2006). I don't see really the point in running a LAMS server on a personal PC and our servers are Unix.


Do not try to install LAMS if you lack basic installation experience and technical '''reading skills'''. Here are just a few remarks in addition to the [http://wiki.lamsfoundation.org/display/lamsdocs/Windows+Installer+Help LAMS installation instructions]. I also strongly suggest to look at the [http://lamscommunity.org/dotlrn/clubs/technicalcommunity/forums/forum-view?forum_id=4929 Problems Installing LAMS] Forum.
Do not try to install LAMS if you lack basic installation experience and technical '''reading skills'''. Here are just a few remarks in addition to the [http://wiki.lamsfoundation.org/display/lamsdocs/Windows+Installer+Help LAMS installation instructions]. I also strongly suggest to look at the [http://lamscommunity.org/dotlrn/clubs/technicalcommunity/forums/forum-view?forum_id=4929 Problems Installing LAMS] Forum.
Line 33: Line 35:
== Lams 2.x on On Solaris ==
== Lams 2.x on On Solaris ==


Lams 2.0 was released on December 6 2006. Since then there very several minor upgrades.
Lams 2.0 was released on December 6 2006. Since then, there were very several minor upgrades.
On March 2008, the current releases are 2.0.4 (stable) and 2.1 (RC1). This refers mostly
On March 2008, the current releases are 2.0.4 (stable) and 2.1 (RC1). These installation notes refers mostly
to the RC1 install, but should help with 2.0.4 too.
to the 2.1RC1 install, but it should help with 2.0.4 too.


First, read the instructions in:
First, read the instructions in:
Line 42: Line 44:
* [http://wiki.lamsfoundation.org/display/lams/Development+Environment Development Environment]
* [http://wiki.lamsfoundation.org/display/lams/Development+Environment Development Environment]


=== Java software ===
Disclaimer: I am not a good sysadmin nor is it my idea of fun. This is not a manual, but '''just''' my private installation notes I am willing to share. - [[User:Daniel K. Schneider|Daniel K. Schneider]] 14:38, 20 March 2008 (MET)
 
So, open a terminal under root ....
 
=== Prerequisite 0: Infrastructure ===
 
* Make sure your organization doesn't stiffle your creativity with Firewalls. If they do, expect '''a lot''' of
extrawork.
* Hardware: Any Windows, Linux, MacOS X, Solaris etc. machine will do since LAMS is programmed in JAVA. You just need some diskspace and memory. Also, you may have to adapt some scripts to your special unix brand.
 
=== Prerequisite 1: Java software ===


; Java + ant
; Java + ant


* Solaris 10 ought to have the right Java + ant installed.  
* Solaris 10 ought to have the right Java + Ant installed. Ant is an installation program like make.


Check if Java can be found, i.e. type:
Check if Java can be found, i.e. type:
Line 52: Line 64:
... you should have java 1.5.x or better. If you don't, check the system for another java or install a new one. If you do so, make sure to specify the right path according to instructions from the LAMS install page.
... you should have java 1.5.x or better. If you don't, check the system for another java or install a new one. If you do so, make sure to specify the right path according to instructions from the LAMS install page.


=== Wildfire ===
=== Prequisite 2: Wildfire ===


This is a [http://en.wikipedia.org/wiki/Xmpp XMPP] (Jabber) chat server, that actually is called Openfire now.  See:
This is a [http://en.wikipedia.org/wiki/Xmpp XMPP] (Jabber) chat server, that actually is called Openfire now.  See:
Line 58: Line 70:
* Also read [http://www.igniterealtime.org/builds/wildfire/docs/latest/documentation/install-guide.html Installation guide] (at Igniterealtime).
* Also read [http://www.igniterealtime.org/builds/wildfire/docs/latest/documentation/install-guide.html Installation guide] (at Igniterealtime).


You don't really need open/wildfire (but then either your students can't chat). You also may use an existing server that works with LAMS.
You don't really need open/wildfire (but then either your students can't chat). You also may try to use an existing server that works with LAMS. I guess that there ought to be free servers you can use.
* If you install a Wildfire server, make sure to get an '''old''' 2.6.2. version. Links are available from the LAMS page, you won't find it at [http://www.igniterealtime.org/ Ignite realtime]. Note: I have to see whether this is still true.
* LAMS folks say to install an '''old''' 2.6.2. version. Links are available from the LAMS page, you won't find it at [http://www.igniterealtime.org/ Ignite realtime]. Note: I have to see whether this is still true, but for the moment I just complied.
* Since this server is written in Java you can take the [http://www.igniterealtime.org/builds/wildfire/wildfire_2_6_2.tar.gz Mac OSX and others] version (i.e. a tar ball).
* Since this server is written in Java you can take the [http://www.igniterealtime.org/builds/wildfire/wildfire_2_6_2.tar.gz Mac OSX and others] version (i.e. a tar ball).


Steps:
Installation steps:


1) Uncompress in /usr/local/wildfire
1) Uncompress in /usr/local/wildfire or some other place


2) Start it with ./bin/wildfire start
2) Start the server with ./bin/wildfire start
* This is a typical startup script. You later can copy this script to /etc/init.d/ etc.  
* This is a typical startup script. You later can copy this script to /etc/init.d/ etc.  


3) Configure through the web interface (if you are lucky you will have a web browser on your server and an X11 connection).
3) Configure this server through the web interface. If you are lucky you will have a web browser on your server and an X11 connection.  
  http://localhost:9090/  
  http://localhost:9090/  
Else use an URL like:  http://yourhost.org:9090/ ... it should work I think. But do it as fast as possible since you have to set passwords and stuff.


* Use "embedded database" if you want to make it shorter, else you have to set up mysql  
* Use "embedded database" if you want to make the install shorter, else you can set it up with mysql


Fill in a few forms, just make sure that you use the right server names. You then can log as administrator and you will have access to an administration console.
The configuration process will ask you to fill in a few forms. Just make sure that you use the right server names. You then can log as administrator and you will have access to an administration console.


* Tick "Don't Show History" (Group Chat -> History Settings)  
* Tick "Don't Show History" (Group Chat -> History Settings), but you can do this later


4) Test it. You may want to install a [http://en.wikipedia.org/wiki/List_of_Jabber_client_software jabber client], e.g. gajim (for Ubuntu, read [https://wiki.ubuntu.com/Jabber Jabber]
4) Test it. You may want to install a [http://en.wikipedia.org/wiki/List_of_Jabber_client_software jabber client], e.g. gajim (Ubuntu users can read [https://wiki.ubuntu.com/Jabber Jabber]


Installing wildfire should be easy, it was for me. It's a fairly popular product...
Installing wildfire should be easy, it was for me. It's a fairly popular product...


=== Configure MySQL ===
=== Prequisite 3: Configure MySQL for LAMS ===
 
Here are the steps:


1) Make sure to have a MySQL '''5.x''' server.
1) Make sure to have a MySQL '''5.x''' server. Else install it (and come back)


2) Configure it according to the [http://wiki.lamsfoundation.org/display/lamsdocs/Installing+MySQL+on+Windows+for+LAMS instructions]
2) Configure it according to the [http://wiki.lamsfoundation.org/display/lamsdocs/Installing+MySQL+on+Windows+for+LAMS instructions]


Edit file my.cnf according to the instructions
Edit file my.cnf according to the instructions
* This cnf file may be in different locations
* This cnf file may not exist (it wasn't in our binary distribution). Also, it can be in different locations
* Type ''mysql --help'' for a list of the places MySQL will look for this config file
* Type ''mysql --help'' to get a list of the places the MySQL server will look for this config file
* The file may not exist, in this case create it. Start by copying a *.cfn model from /usr/local/mysql/share/mysql or some other place. I took my-medium.cnf.
* Create my.cnf if you don't have one. Start by copying a *.cfn model from /usr/local/mysql/share/mysql or some other place. I took my-medium.cnf.


In particular, my.cnf should include this (no idea what it means and why):
In particular, my.cnf should include these lines (no idea what it means and why):


  [mysqld]
  [mysqld]
Line 102: Line 117:
Then restart mysql !
Then restart mysql !


3) Create a lams database.
3) Create a LAMS database.


If you upgrade, you may want to make a dump for safeguarding or alternatively kill all tables if you want a fresh start. I personally enjoy destroying whole databases.
If you upgrade, you may want to make a dump for safeguarding or alternatively kill all tables if you want a fresh start. I personally enjoy destroying whole databases.
Line 123: Line 138:
  quit
  quit


=== JBOSS ===
=== Prerequisite 4: JBOSS ===


JBOSS is a Java application server. LAMS is programmed with this application framework.
JBOSS is a Java application server. LAMS is programmed with this application framework.
Line 150: Line 165:
(tested with LAMS 2.1 RC1)
(tested with LAMS 2.1 RC1)


0) Read the readme file you will find and again [http://wiki.lamsfoundation.org/display/lamsdocs/Unix+Installer+Help Unix Installation and Updating Help]. It's authorized gospel, this is not.
0) Read the "readme" file you will find and/or again [http://wiki.lamsfoundation.org/display/lamsdocs/Unix+Installer+Help Unix Installation and Updating Help]. It's authorized gospel, this is not.


1) Decide where the files should go. Either use a typical unix installation with files
1) Decide where the files should go. Either use a typical unix installation with files
all over the place or put all LAMS related in some directory, e.g. /usr/local/lams.
all over the place or put all LAMS related stuff in some directory, e.g. /usr/local/lams.
I prefer the second solution, since this way you can get rid of unwanted software easily...
I prefer the second solution, since this way I can get rid of unwanted software easily...


2) Dezip the installer in some place, e.g. /src/lams
2) Dezip the installer in some place, e.g. /src/lams
Line 179: Line 194:
3) Installation settings again, I had to change nearly each line ! Make sure to have each line right.
3) Installation settings again, I had to change nearly each line ! Make sure to have each line right.


Port number. If you change this, you also have to reconfigure JBOSS !
Port number. If you change this, you also have to reconfigure JBOSS (I don't know where)!
  LAMS_PORT=8080
  LAMS_PORT=8080


Line 186: Line 201:


=== Using the installer ===
=== Using the installer ===
(tested with LAMS 2.1 RC1)


* Reminder: Read [http://wiki.lamsfoundation.org/display/lamsdocs/Unix+Installer+Help Unix Installation and Updating Help]
* Reminder: Read [http://wiki.lamsfoundation.org/display/lamsdocs/Unix+Installer+Help Unix Installation and Updating Help]


If you did the above (editing lams.properties) allright, then make sure again that java can be found. In principle, on solaris system this is the case and you can ignore instructions about setting the JAVA_HOME. To check, just type:
If you did the above (editing lams.properties) alright, then make sure again that Java can be found. In principle, on Solaris systems this is the case and you can ignore instructions about setting the JAVA_HOME. To check, just type:


  echo $JAVA_HOME
  echo $JAVA_HOME


Depending on which shell you use, you may use something like:
In a csh shell you may fix the path like this (if needed):
  setenv PATH /usr/java/bin/:$PATH
  setenv PATH /usr/java/bin/:$PATH


Then install, type:
In a Bash shell:
export PATH=/usr/java/bin/:$PATH
 
Then install, i.e. type:
  ./install-lams.sh
  ./install-lams.sh
... most likely it won't work, read on.


; RC2 install script does not work on Solaris
; RC2 install script does not work on Solaris


If it fails (which the one script I got did), use debugging modes, e.g.:
If it fails (with the one script I got it did), use debugging modes first, e.g.:
  sh -x ./install-lams.sh
  sh -x ./install-lams.sh
  sh -v ./install-lams.sh
  sh -v ./install-lams.sh
  sh -vx ./install-lams.sh
  sh -vx ./install-lams.sh


To fix it, you either have to make the script a bash shell (best choice):
Now to fix the RC1 problems:
 
1) First repair a bourne shell error, i.e. you either have to make the script a bash shell (best choice):
  #!/usr/bin/bash
  #!/usr/bin/bash
or alternatively make the following change (next best):
or alternatively make the following change (next best):
Line 218: Line 241:
  # export JAVA_HOME=$ORIG_JAVA_HOME
  # export JAVA_HOME=$ORIG_JAVA_HOME


Then there was Linux specific line to be fixed:
2) Then there was Linux specific line to be fixed:
  # cp -rv assembly/lams.ear ${DEFAULT_DIR}/deploy
  # cp -rv assembly/lams.ear ${DEFAULT_DIR}/deploy
cp -r assembly/lams.ear ${DEFAULT_DIR}/deploy
cp -r assembly/lams.ear ${DEFAULT_DIR}/deploy


Then I got:
; Success
You are successful when you see this:
  LAMS 2.1-RC1 Configuration completed!
  LAMS 2.1-RC1 Configuration completed!
  Please view the README for instructions on how to run LAMS.
  Please view the README for instructions on how to run LAMS.
Line 228: Line 252:
=== Deploying and running LAMS ===
=== Deploying and running LAMS ===


There is a startup script you will find in the JBOSS/bin directory. It just configures JAVA for more memory and then launches JBOSS.
First time you will start up JBOSS it will take some time deploying LAMS as a web application.
 
There is a startup script you will find in the JBOSS/bin directory. It just configures JAVA for more memory and then launches the original run.sh script from JBOSS.
  ./usr/local/jboss-4.0.2/bin/run-lams.sh
  ./usr/local/jboss-4.0.2/bin/run-lams.sh


During first time use, this will take time. E.g. at least 10 minutes on a little Sun Firewire
This also will fail with RC1. Read on ...


==== Fixing the script ====
==== Fixing the script ====


In 2.1RC2 I had to fix the script
In 2.1RC2 I had to fix the script, or actually just use something different.


1) Missing shell identification. Add the following as first line.
1) Missing shell identification. Add the following as first line:
  #!/usr/bin/bash
  #!/usr/bin/bash


Line 258: Line 284:
  # export JAVA_OPTS="-server -Xms256m -Xmx512m -XX:MaxPermSize=256m"
  # export JAVA_OPTS="-server -Xms256m -Xmx512m -XX:MaxPermSize=256m"
  export JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:MaxPermSize=256m"
  export JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:MaxPermSize=256m"
Or maybe JAVA_OPTS will have contradictory info like
Or maybe JAVA_OPTS will have contradictory info like (a good sysadmin would try to dig and understand ...)
  -server -Xms128m -Xms512m ...
  -server -Xms128m -Xms512m ...


Anyhow, I then just decided to modify the JBOSS start-up script and use it directly.
Anyhow, I then just decided to modify the JBOSS start-up script and use it directly.
Around line 141 I inserted more initial and max heap (I also took $JAVA_OPTS out):
Around line 141 of file '''run.sh''' I inserted more initial and max heap and I also took $JAVA_OPTS out since for some strange reason it already was set with unwanted -XMs .Xmx.
  JAVA_OPTS="-Xms512m -Xmx512m -Dprogram.name=$PROGNAME"
  JAVA_OPTS="-Xms512m -Xmx512m -Dprogram.name=$PROGNAME"
  #JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME"
  #JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME"


==== Start and stop ====
==== Start and stop LAMS ====


To start LAMS, go to the JBOSS bin directory and type:
To start LAMS, go to the JBOSS bin directory:
  cd /usr/local/jboss-4.0.2/bin/
  cd /usr/local/jboss-4.0.2/bin/
Try first:
Try first:
  ./run-lams.sh
  ./run-lams.sh
If it don't work, fix heap space in this file and then run this instead:
If it doesn't work, fix heap space in the run.sh file directly (as explained above) and run it:
  ./run.sh &
  ./run.sh &
To avoid getting all the traces in the terminal
To avoid getting all the traces in the terminal
  ./run.sh > /dev/null &
  ./run.sh > /dev/null &


Then you should get this (e.g. in the log file):
Then you should get this (e.g. last line in the log file). If not, search for errors.
  2008-03-20 12:03:21,967 INFO  [org.jboss.system.server.Server] JBoss (MX MicroKernel)
  2008-03-20 12:03:21,967 INFO  [org.jboss.system.server.Server] JBOSS (MX MicroKernel)
  [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 1m:52s:938ms
  [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 1m:52s:938ms


To stop LAMS, just stop the JBOSS server
To stop LAMS, just stop the JBOSS server. If it won't work, just kill the big hanging Java process.
  ./shutdown.sh -S
  ./shutdown.sh -S


Line 297: Line 323:
=== Configuration ===
=== Configuration ===


(to be continued ...)
To be continued. Basically, I managed to get the MOODLE interface working (see below).


 
== Legacy notes for a lams 2.0 Solaris install ==
== Legacy notes for a lams 2.0 solaris install ==


When I installed LAMS for the first time, the install had to be done manually. At some point I'll try again a manual install. For now, understand please that some things may
When I installed LAMS for the first time, the install had to be done manually. At some point I'll try again a manual install. For now, understand please that some things may
Line 409: Line 434:
# Empty the JBoss server/default/deploy/lams.ear/ directory ?
# Empty the JBoss server/default/deploy/lams.ear/ directory ?
   
   
=== To Do list ===
(I will report on this later, for the moment I got other things to do - [[User:DSchneider|DSchneider]] 20:10, 6 December 2006 (MET))
* Install the chat server
* Test and tweak
* Integrate with Moodle
== Moodle - LAMS integration ==
== Moodle - LAMS integration ==


Line 430: Line 447:
First of all '''make sure''' that you do no skip step 4 below (you need the LAMS v2 module and ''not'' LAMS !)
First of all '''make sure''' that you do no skip step 4 below (you need the LAMS v2 module and ''not'' LAMS !)


1. Unzip the file
# Unzip the file
2. Move the lamstwo directory to moodle/mod/
# Move the lamstwo directory to moodle/mod/
3. Move the lamstwo.php file to moodle/lang/en_utf8/
# Move the lamstwo.php file to moodle/lang/en_utf8/
4. Login as admin and go to http://yourmoodle/admin, LAMS tables will be created automatically.
# Login as admin and go to http://yourmoodle/admin, LAMS tables will be created automatically.
5. Go to modules and click settings for LAMS2 module and put the proper values in, I used:
# Go to modules and click settings for LAMS2 module and put the proper values in, I used:
  server_url:    http://tecfasun1.unige.ch:8080/lams
  server_url:    http://tecfasun1.unige.ch:8080/lams
  server_id:      moodle
  server_id:      moodle
Line 441: Line 458:


; On the LAMS side:
; On the LAMS side:
# Made a "moodle" Group and added a test lesson
# The integrated server setup is:
# The integrated server setup is:
  Id:          moodle
  Id:          moodle

Revision as of 15:38, 20 March 2008

This article or section is currently under construction

In principle, someone is working on it and there should be a better version in a not so distant future.
If you want to modify this page, please discuss it with the person working on it (see the "history")

Definition

This page contains installation tips for LAMS. Mostly LAMS 2.1RC1 for Solaris 10.

LAMS is a JAVA/JBOSS-based application and needs some installation skills on Windows and good installation skills for Unix.

LAMS 2RC2 Windows XP PC

Note: This chapter is outdated (written in Dec 2006). I don't see really the point in running a LAMS server on a personal PC and our servers are Unix.

Do not try to install LAMS if you lack basic installation experience and technical reading skills. Here are just a few remarks in addition to the LAMS installation instructions. I also strongly suggest to look at the Problems Installing LAMS Forum.

Other Software

To run it on windows you need to install other software.

  • Java JSE 5.0 (update 9), not just the JRE. Get it from Sun.
  • MySQL: Get it directly from MySQL and take the Installer version (not the zip installation).
    • Install it and remember the password
    • I suggest not installing/using a WAMP environment for LAMS 2RC 2. The LAMS installer 2Rc2 could not find MySQL in my WampServer environment even if it was told where to look for in the LAMS installer.
    • Hack would be to manually edit the registry with this information from MySQL AB and this posting and picture by Ernie Ghiglione. Basically one needs to reproduce the MySQL entry from the official MySQL AB installer:
HKEY_LOCAL_MACHINE
  SOFTWARE
    MySQL AB
      MySQL Server 5.0  
                         Location c:\wamp\mysql
                         Version  5.0.27

... but this still didn't work for me. Something I did not try was to add mysqladmin.exe to the bin directory which is missing (see: Jun-Dir Liew's question and try it ... I don't have the time to do it right now. E.g. this file may be part of the simple zip / no registry version from the MySQL site).

MySQL

  • If you use a WAMP package you must know where MySQL sits. E.g. c:\wamp\mysql if you work with "WampServer" (but see above that I failed, rather work with an "official MySQL installer from MySQL AB). If you use the official MySQL installer, there will be no problem.

LAMS

  • Has an installer and if you got the above right it will install without problems. You may have a firewall. In this case make sure to open the necessary ports. Also pay attention to popup blockers in your navigator. LAMS worked fine with both IE 6 and Firefox 1.5x.

Lams 2.x on On Solaris

Lams 2.0 was released on December 6 2006. Since then, there were very several minor upgrades. On March 2008, the current releases are 2.0.4 (stable) and 2.1 (RC1). These installation notes refers mostly to the 2.1RC1 install, but it should help with 2.0.4 too.

First, read the instructions in:

Disclaimer: I am not a good sysadmin nor is it my idea of fun. This is not a manual, but just my private installation notes I am willing to share. - Daniel K. Schneider 14:38, 20 March 2008 (MET)

So, open a terminal under root ....

Prerequisite 0: Infrastructure

  • Make sure your organization doesn't stiffle your creativity with Firewalls. If they do, expect a lot of

extrawork.

  • Hardware: Any Windows, Linux, MacOS X, Solaris etc. machine will do since LAMS is programmed in JAVA. You just need some diskspace and memory. Also, you may have to adapt some scripts to your special unix brand.

Prerequisite 1: Java software

Java + ant
  • Solaris 10 ought to have the right Java + Ant installed. Ant is an installation program like make.

Check if Java can be found, i.e. type:

java -version

... you should have java 1.5.x or better. If you don't, check the system for another java or install a new one. If you do so, make sure to specify the right path according to instructions from the LAMS install page.

Prequisite 2: Wildfire

This is a XMPP (Jabber) chat server, that actually is called Openfire now. See:

You don't really need open/wildfire (but then either your students can't chat). You also may try to use an existing server that works with LAMS. I guess that there ought to be free servers you can use.

  • LAMS folks say to install an old 2.6.2. version. Links are available from the LAMS page, you won't find it at Ignite realtime. Note: I have to see whether this is still true, but for the moment I just complied.
  • Since this server is written in Java you can take the Mac OSX and others version (i.e. a tar ball).

Installation steps:

1) Uncompress in /usr/local/wildfire or some other place

2) Start the server with ./bin/wildfire start

  • This is a typical startup script. You later can copy this script to /etc/init.d/ etc.

3) Configure this server through the web interface. If you are lucky you will have a web browser on your server and an X11 connection.

http://localhost:9090/ 

Else use an URL like: http://yourhost.org:9090/ ... it should work I think. But do it as fast as possible since you have to set passwords and stuff.

  • Use "embedded database" if you want to make the install shorter, else you can set it up with mysql

The configuration process will ask you to fill in a few forms. Just make sure that you use the right server names. You then can log as administrator and you will have access to an administration console.

  • Tick "Don't Show History" (Group Chat -> History Settings), but you can do this later

4) Test it. You may want to install a jabber client, e.g. gajim (Ubuntu users can read Jabber

Installing wildfire should be easy, it was for me. It's a fairly popular product...

Prequisite 3: Configure MySQL for LAMS

Here are the steps:

1) Make sure to have a MySQL 5.x server. Else install it (and come back)

2) Configure it according to the instructions

Edit file my.cnf according to the instructions

  • This cnf file may not exist (it wasn't in our binary distribution). Also, it can be in different locations
  • Type mysql --help to get a list of the places the MySQL server will look for this config file
  • Create my.cnf if you don't have one. Start by copying a *.cfn model from /usr/local/mysql/share/mysql or some other place. I took my-medium.cnf.

In particular, my.cnf should include these lines (no idea what it means and why):

[mysqld]
....
transaction-isolation=READ-COMMITTED 
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 

Then restart mysql !

3) Create a LAMS database.

If you upgrade, you may want to make a dump for safeguarding or alternatively kill all tables if you want a fresh start. I personally enjoy destroying whole databases.

Then create:

  • a database named "lams"
  • a user "lams"
  • Make to sure to have it run in UTF-8 mode !

Best way to to this is to use a terminal client and type something this:

mysql -u root -p

Then enter the following lines (alternatively read them from a file)

SET FOREIGN_KEY_CHECKS=0; 
DROP DATABASE IF EXISTS lams; 
CREATE DATABASE lams DEFAULT CHARACTER SET utf8; 
SET FOREIGN_KEY_CHECKS=1; 
GRANT ALL PRIVILEGES ON *.* TO lams@localhost IDENTIFIED BY 'secretpassword'; 
REVOKE PROCESS,SUPER ON *.* from lams@localhost;
quit

Prerequisite 4: JBOSS

JBOSS is a Java application server. LAMS is programmed with this application framework.

  • Unpackage into /usr/local
gtar xzf jboss-4.0.2.tar.gz -C /usr/local 
  • Copy some jar files
cp /usr/local/jboss-4.0.2/server/all/lib/jboss-cache.jar /usr/local/jboss-4.0.2/server/default/lib/
cp /usr/local/jboss-4.0.2/server/all/lib/jgroups.jar /usr/local/jboss-4.0.2/server/default/lib/

LAMS source file download

Get the archive from the downloads page.

Direct links: this may change !

Note: If you want to play with a release candidate, it's an option to get a more recent version from the CVS software archive. Some bug already may have been fixed. On the other hand, you may encounter a new one. You can browse the lams cvs repository. To get the code from CVS, consult building lams) and then build from source.

Pre-install configuration

(tested with LAMS 2.1 RC1)

0) Read the "readme" file you will find and/or again Unix Installation and Updating Help. It's authorized gospel, this is not.

1) Decide where the files should go. Either use a typical unix installation with files all over the place or put all LAMS related stuff in some directory, e.g. /usr/local/lams. I prefer the second solution, since this way I can get rid of unwanted software easily...

2) Dezip the installer in some place, e.g. /src/lams

gtar -xvf lams-unix-installer-2.1-RC1.tar.gz

3) Then edit the lams.properties file according to unix installer help. This file sits in the install directory.

Make a backup first

cp lams.properties lams.properties.ORI

Then I did this (as I said I prefer all files in one place for experimental systems). Make sure that you correctly enter db and user names, locations and so forth ! Basically there are three sections:

1) Related to installation

LAMS_DIR=/usr/local/lams/lams
DB_NAME=lams
DB_USER=lams
DB_PASS=secret

2) If you have wildfire, make sure to specify the name of host machine, etc.

3) Installation settings again, I had to change nearly each line ! Make sure to have each line right.

Port number. If you change this, you also have to reconfigure JBOSS (I don't know where)!

LAMS_PORT=8080

Server URL (certainly not localhost). E.g. you want something like:

SERVER_URL=http://tecfasun1.unige.ch:8080/lams/

Using the installer

(tested with LAMS 2.1 RC1)

If you did the above (editing lams.properties) alright, then make sure again that Java can be found. In principle, on Solaris systems this is the case and you can ignore instructions about setting the JAVA_HOME. To check, just type:

echo $JAVA_HOME

In a csh shell you may fix the path like this (if needed):

setenv PATH /usr/java/bin/:$PATH

In a Bash shell:

export PATH=/usr/java/bin/:$PATH

Then install, i.e. type:

./install-lams.sh

... most likely it won't work, read on.

RC2 install script does not work on Solaris

If it fails (with the one script I got it did), use debugging modes first, e.g.:

sh -x ./install-lams.sh
sh -v ./install-lams.sh
sh -vx ./install-lams.sh

Now to fix the RC1 problems:

1) First repair a bourne shell error, i.e. you either have to make the script a bash shell (best choice):

#!/usr/bin/bash

or alternatively make the following change (next best):

 # export JAVA_HOME=$ORIG_JAVA_HOME
must become
JAVA_HOME=$ORIG_JAVA_HOME
export JAVA_HOME

or just comment out the following lines (On Solaris 10 Java will be found):

# checkJava
....
# export JAVA_HOME=$ORIG_JAVA_HOME

2) Then there was Linux specific line to be fixed:

# cp -rv assembly/lams.ear ${DEFAULT_DIR}/deploy

cp -r assembly/lams.ear ${DEFAULT_DIR}/deploy

Success

You are successful when you see this:

LAMS 2.1-RC1 Configuration completed!
Please view the README for instructions on how to run LAMS.

Deploying and running LAMS

First time you will start up JBOSS it will take some time deploying LAMS as a web application.

There is a startup script you will find in the JBOSS/bin directory. It just configures JAVA for more memory and then launches the original run.sh script from JBOSS.

./usr/local/jboss-4.0.2/bin/run-lams.sh

This also will fail with RC1. Read on ...

Fixing the script

In 2.1RC2 I had to fix the script, or actually just use something different.

1) Missing shell identification. Add the following as first line:

#!/usr/bin/bash

Note: You have to use Bash not sh (/usr/bin/sh), since the LAMS folks use bash syntax. This line:

export JAVA_HOME="/usr/java"

is wrong in traditional Bourne shell. Should read:

JAVA_HOME="/usr/java"
export JAVA_HOME

2) There wasn't enough heap space E.g. from the log file (/usr/local/jboss-4.0.2/server/default/log/)

2008-03-20 11:26:15,574 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with
name 'coreSessionFactory' defined in class path resource
[org/lamsfoundation/lams/commonContext.xml]: Initialization of bean failed; nested
exception is java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space

I first doubled initial and max heap with no effect, something does not pass from this script to the next one.

# export JAVA_OPTS="-server -Xms256m -Xmx512m -XX:MaxPermSize=256m"
export JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:MaxPermSize=256m"

Or maybe JAVA_OPTS will have contradictory info like (a good sysadmin would try to dig and understand ...)

-server -Xms128m -Xms512m ...

Anyhow, I then just decided to modify the JBOSS start-up script and use it directly. Around line 141 of file run.sh I inserted more initial and max heap and I also took $JAVA_OPTS out since for some strange reason it already was set with unwanted -XMs .Xmx.

JAVA_OPTS="-Xms512m -Xmx512m -Dprogram.name=$PROGNAME"
#JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME"

Start and stop LAMS

To start LAMS, go to the JBOSS bin directory:

cd /usr/local/jboss-4.0.2/bin/

Try first:

./run-lams.sh

If it doesn't work, fix heap space in the run.sh file directly (as explained above) and run it:

./run.sh &

To avoid getting all the traces in the terminal

./run.sh > /dev/null &

Then you should get this (e.g. last line in the log file). If not, search for errors.

2008-03-20 12:03:21,967 INFO  [org.jboss.system.server.Server] JBOSS (MX MicroKernel)
[4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 1m:52s:938ms

To stop LAMS, just stop the JBOSS server. If it won't work, just kill the big hanging Java process.

./shutdown.sh -S

Always consult the log file when in doubt (the first time you start JBOSS it will take some time to install LAMS).

tail ../server/default/log/server.log

LAMS first test

If you you are here, then LAMS ought to run, e.g. try a URL like:

http://tecfasun1.unige.ch:8080/lams/

If you forgot the login name and password, you can retrieve it from

/src/lams/lams-unix-installer-2.1-RC1/lams.properties

Configuration

To be continued. Basically, I managed to get the MOODLE interface working (see below).

Legacy notes for a lams 2.0 Solaris install

When I installed LAMS for the first time, the install had to be done manually. At some point I'll try again a manual install. For now, understand please that some things may have changed.

LAMS pre-build configuration

I configured the following entries in the following files. Most entries are related to file paths.

In lams_build directory:

File: lams/lams_build/shared.properties
  (nothing to change)
 
File: lams/lams_build/common.properties
  osPropertiesName=unix
  db.password=XXXX
File: lams/lams_build/unix.properties
  contentrepository.directory=/usr/local/lams/repository

Change this in three locations !!

File: lams_build/conf/unix/jboss/service/mysql-ds.xml
   <password>XXXX</password>

In lams_common directory:

File: lams/lams_common/db/sql/insert_unix_config_data.sql
  ('ServerURL','http://tecfasun1.unige.ch:8080/lams/');
  ('TempDir','/usr/local/lams/temp');
  ('DumpDir','/usr/local/lams/dump');
  ('SMTPServer','mail.tecfa.unige.ch');
  ('LamsSupportEmail','webmaster@tecfa.unige.ch');
  ('ContentRepositoryPath','/usr/local/lams/repository');   

... Don't miss the port number for the server URL (e.g. 8080) !

In the same directory you may change the admin login and password (not tested !)

File: lams/lams_common/db/sql/insert_users.sql  

Note: I did not find an LamsHome property in any file (this conflicts with the installation instructions).

What if you have another server running on port 8080 ?

You can run JBOSS on a different port, but need to edit a few files. Read this:

Make directories for lams (they must match the above of course)

mkdir /usr/local/lams
mkdir /usr/local/lams/temp
mkdir /usr/local/lams/dump
mkdir /usr/local/lams/repository

I don't know who runs JBoss, so I just deprotected

chmod -R 777 /usr/local/lams

Build

Type the following commands in this order. (You don't need Ecplise to build LAMS). But stop the JBOSS server when you do this.

cd /src/lams/lams_build
ant rebuild-db
ant assemble-ear
ant deploy-ear
ant deploy-tools
ant copyfiles

Run it

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

The adminstrator login is sysadmin (don't forget this)

The sysadmin login password is in the SQL file below. You may change it before you build, I was quite frustrated not to able to log in ;)

/src/lams/lams_common/db/sql/insert_users.sql

Server configuration

See Configuring your LAMS Server.

  • Java may not have enough heap space (it runs out of memory). Replace the 256 with something bigger. I think that the run.sh has to be fixed. Otherwise it may be the Tomcat config somewhere.
File: /usr/local/jboss-4.0.2/bin/run.sh

Around line 150 insert:

JAVA_OPTS="$JAVA_OPTS -Xms500m -Xmx500m -Dprogram.name=$PROGNAME"
# Display our environment

Things I did wrong

Now for some human touch ....

  • Forget to specify the OS
  • Forgot to add the port number of the server URL
  • Forgot to create the lams directory
  • Only changed password in one location in lams_build/conf/unix/jboss/service/mysql-ds.xml

Debuging

Look at files in:

/usr/local/jboss-4.0.2/server/default/log/

Then stop JBoss,

cd /usr/local/jboss-4.0.2/bin/shutdown -S &

Repair misconfigurations above, rebuild with ant and run it again :) I don't know if global cleaning up is an efficient idea, but I do it anyhow as a last resort when I get stuck, e.g.:

  1. Execute ant clean
  2. Drop the lams database (and don't forget to create it again)
  3. Empty the JBoss server/default/deploy/lams.ear/ directory ?

Moodle - LAMS integration

The LAMS v2.0 Integration Setup Step-by-Step Guide is fairly well done :)

Short installation summary (see the above guide)

I managed this to work with LAMS 2.1RC1 (I failed with an early LAMS 2.0 version).

  • Moodle runs on one machine (tecfax.unige.ch)
  • LAMS runs on a different machine
On the Moodle side

First of all make sure that you do no skip step 4 below (you need the LAMS v2 module and not LAMS !)

  1. Unzip the file
  2. Move the lamstwo directory to moodle/mod/
  3. Move the lamstwo.php file to moodle/lang/en_utf8/
  4. Login as admin and go to http://yourmoodle/admin, LAMS tables will be created automatically.
  5. Go to modules and click settings for LAMS2 module and put the proper values in, I used:
server_url:     http://tecfasun1.unige.ch:8080/lams
server_id:      moodle
server_key:     somethingsecret
request_source: moodle
On the LAMS side
  1. The integrated server setup is:
Id:           moodle
Key:          somethingsecret
Description:  TECFA Moodle
Prefix:       mdl
Organisation: moodle
User Information: URL: http://tecfax.unige.ch/moodle/mod/lamstwo/userinfo.php?ts=%timestamp%&un=%username%&hs=%hash%
Timeout URL:      http://tecfax.unige.ch/lams/timeout.html
Notes

Make sure that you do not mix up case: E.g. if your group is called "moodle" in LAMS use "moodle" and not "Moodle" (I got stuck with this)

Your JBOSS server may need yet more memory space allocated (see above)

If you tried this in the past, your MOODLE may have junk left to need to get rid off. The error (for 2.1RC1) I was getting after validating a LAMS activity I was able to create through Moodle ...

 Could not add an instance of LAMS2 

To fix this:

  • I deleted the LAMS2 module in MOODLE. This will fill in db tables again.
  • Click on notifications in the Admin menu
  • Reinstall LAMS2

Documentation

General
LAMS 1 (you rather should use LAMS 2)
LAMS 2