LAMS installation and configuration: Difference between revisions

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


This page contains installation tips for [[LAMS]]. Mostly LAMS 2.1RC1 for Solaris 10.
This page contains installation tips for [[LAMS]]. Mostly LAMS 2.1 + 1.1.1 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.


'''READ THIS''' - [[User:Daniel K. Schneider|Daniel K. Schneider]] 16:31, 18 September 2008 (UTC)
Note: I put the legacy stuff in the [[Talk:LAMS_installation_and_configuration|discussion page]], e.g. LAMS 2.1RC for Solaris
* I soon will install a new version
* I put the legacy stuff in the [[Talk:LAMS_installation_and_configuration|discussion page]], e.g. LAMS 2.1RC for Solaris


== LAMS 2.1.1 on Solaris ==
== LAMS 2.1.1 on Solaris ==

Revision as of 19:19, 20 September 2008

Definition

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

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

Note: I put the legacy stuff in the discussion page, e.g. LAMS 2.1RC for Solaris

LAMS 2.1.1 on Solaris

Lams 2.0 was released on December 6 2006. Since then, there were very several minor upgrades. On Sept 2008, the current release is 2.1.1.

These installation notes refers mostly to the 2.1.1 install, but it should help with 2.0.4 too. Official LAMS instructions are a bit Linux centric and this is main reason why you might have a look at this. My notes also should work with older Solaris versions (just make sure to upgrade Java if needed and in this case to set the Java path).

First, read the instructions in:

Upgrading from previous versions: You can't upgrade from 2.1RCx. So I started from scratch. Since we only have our students create LAMS scenarios as exercises I had them save the zip file in their work portfolio and they could import it again (I hope). Anyhow: export all scenarios from your LAMS server as LAMS zip files (not LD) before you erase the old data-base and the LAMS software from JBOSS.

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. - 16:54, 19 September 2008 (UTC)

I got this machine and OS:

SunOS tecfasun1.unige.ch 5.10 Generic_118833-17 sun4u sparc SUNW,Sun-Fire-V240

So, open a terminal under root ....

Download and checksum

Check the download page at LAMS. Make sure to get the right version ! Also you may have to get a patch that you will have to apply after the main install.

I took the following ones: There was no LAMS 2.1.1 full distribution. Had to install LAMS 2.1 first and then apply the patch

This would be the wrong version if you have Ubuntu. I run Ubuntu as my desktop machine and indeed life is easier on Ubuntu ....

Then you may checksum the downloaded archive. In some very rare cases there exist transmission errors or someone managed to upload a bad archive to the download server. So type:

md5sum lams-unix-installer-2.1.tar.gz 

And then compare the number that will show like this with the one on the download page:

2f29d60147bf1328d3a044a66ea8b083  lams-unix-installer-2.1.tar.gz

Prerequisite 0: Infrastructure

  • Make sure your organization doesn't stifle your creativity with Firewalls. If they do, expect a lot of extra work.
  • Also the 8080 port should be free. Some software like Skype just randomly take up ports. If you run an other server, read Changing Server Ports for LAMS
  • Hardware and OS: Any Windows, Linux, MacOS X, Solaris etc. machine will do since LAMS is programmed in JAVA. You just need some disk space, substantial memory and a not too old JAVA. 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. Note: You need the JDK/JSE or whatever Sun decided to rename it (i.e. the compiler, not just the runtime)

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.

I have Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05), i.e. the default thing installed in this machine. It's easy to have another Java version, but I suggest from past experience to install it somewhere else, e.g. in /usr/local.

So just for the fun of it you can get another from SUN. No links, since Sun not only changes naming of Java edition but also their web sites at regular intervals. You just have to understand that JDK "6" == JDK "1.6" and that "SDK = JDK". Do not install anything that is called "JRE". Then, you can either take the small SE version or larger EE version. Both work with JBoss. It takes some time to find the right thing. Also you won't find installation instructions on the final download screen (you have to backtrack). Branding managers and website designers at Sun should reassigned to other tasks like designing the cafeteria at the head quarters. Do not go to http://java.com but try http://java.sun.com/

In case you download something like the jdk-6u7-solaris-sparc.sh version you have to know that it will just unpack the whole thing as a subdirectory.

cd /usr/local
mv /path_where_you_put_it/jdk-6u7-solaris-sparc.sh .
chmod a+x jdk-6u7-solaris-sparc.sh
./jdk-6u7-solaris-sparc.sh
ln -s jdk1.6.0_07 jdk6
rm jdk-6u7-solaris-sparc.sh

Now you have a Java6 in the symbolic link /usr/local/jdk6. See if it works:

./jdk6/bin/java -version

Should show:

java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)

Let's try install it with this one.

Prerequisite 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 an article on Jabber

5) Security: You may restrict login to given set of IP addresses or even disable account creation. Chat servers may be taken over by not so friendly people.

  • Edit Server Settings->Registration and Login

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

Prerequisite 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 LAMS instructions, i.e. make changes to file my.cnf:

  • 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
  • So, 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.

Changes to make: file 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.

This step is not needed, the installation script will do it

However, there is a mistake in the script. I will grant global privileges to the lams user. Remove them either withs these SQL commands or with some MySQL administration tool.

REVOKE ALL PRIVILEGES ON * . * FROM 'lams'@'localhost';
REVOKE GRANT OPTION ON * . * FROM 'lams'@ 'localhost';

Then add these just for the lams database

GRANT ALL PRIVILEGES ON `lams` . * TO 'lams'@'localhost' WITH GRANT OPTION ;

Prerequisite 4: JBOSS

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

  • Unpack into /usr/local (or wherever else you like it)
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/

Pre-install

1) Unpack the archives some place, e.g. in /src/. Use gtar to unpack !

gtar zxf lams-unix-installer-2.1.tar.gz
gtar zxf lams-unix-patch-2.1.1.tar.gz

So you should have something like:

drwxr-xr-x   4 root     root        1024 Sep 19 12:20 ./
drwxrwxr-x  42 root     root        1024 Sep 19 11:00 ../
drwxr-xr-x  13 1000     1000         512 Jun 20 03:26 lams-unix-installer-2.1/
-rw-r--r--   1 schneide tecfa    60219686 Sep 19 10:19 lams-unix-installer-2.1.tar.gz
drwxr-xr-x   9 1000     1000         512 Sep  5 08:43 lams-unix-patch-2.1.1/
-rw-r--r--   1 schneide tecfa    3902055 Sep 19 10:13 lams-unix-patch-2.1.1.tar.gz

2) If you use a non-standard JAVA make sure that installer script can find it. Remember this for later also ! If you use csh, type:

setenv PATH (path to java bin directory):$PATH
setenv JAVA_HOME (path to java installation directory)

For example:

setenv PATH /usr/local/jdk6/bin:$PATH
setenv JAVA_HOME /usr/local/jdk6

Or in a bash shell:

JAVA_HOME="(path to java installation directory)"
export JAVA_HOME
PATH="(path to java bin directory):$PATH"
export PATH

Then control:

which java
java -version

3) You should kill older lams data and config directories and/or make a backup, e.g.

mv /usr/local/lams/lams /usr/local/lams/lams.old
mv /etc/lams2 /etc/lams2.old

4) If you already got an old LAMS in jboss, also get rid of it (not sure if this is really needed)

rm -r /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/

5) If you use a non-standard Java (see above) you also should change the JAVA configuration in JBOSS. Edit file /usr/local/jboss-4.0.2/bin/run.conf and change:

JAVA_HOME=/usr/local/jdk6
JAVA="/usr/local/jdk6/bin/java

You also can add some extra memory for startup

 JAVA_OPTS="-server -Xms256m -Xmx512m"

The just test it once, execute:

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

You should see something like:

JBoss Bootstrap Environment
 JBOSS_HOME: /usr/local/jboss-4.0.2
 JAVA: /usr/local/jdk6/bin/java
 JAVA_OPTS: -server -Xms512m -Xmx512 -Dprogram.name=run.sh
 CLASSPATH: /usr/local/jboss-4.0.2/bin/run.jar:/usr/local/jdk6/lib/tools.jar

Check in a browser if its alive for real:

http://xxxx.yyy.zz:8080/

Then kill it, execute:

/usr/local/jboss-4.0.2/bin/shutdown.sh --shutdown

Edit the installer configuration file

Go to the lams-unix-installer directory, e.g. /src/lams/lams-unix-installer-2.1/

cp lams.properties lams.properties.ORI

I did the following (roughly)

# Installation Options	
LAMS_DIR=/usr/local/lams/lams
LAMS_USER=admin
LAMS_PASS=secretX
DB_NAME=lams
DB_USER=lams
DB_PASS=secretY
# Wildfire installation (this is optional)
WILDFIRE_DOMAIN=tecfasun1.unige.ch
WILDFIRE_CONFERENCE=conference.tecfasun1.unige.ch
WILDFIRE_USER=admin
WILDFIRE_PASS=secretZ

# Essential settings (Certainly you got to change the server_url with the right port !)
LAMS_PORT=8080
SERVER_URL=http://tecfasun1.unige.ch:8080/lams/
JBOSS_DIR=/usr/local/jboss-4.0.2
JDK_DIR=/usr/local/jdk6
SQL_DIR=/usr/local/mysql/bin
SQL_HOST=localhost
SQL_PORT=3306
SQL_URL=jdbc:mysql://${SQL_HOST}/${DB_NAME}?characterEncoding=utf8&autoReconnect=true
DB_ROOT_PASSWORD=secretmysql

Using the installer

This may not work in old Solaris installations. You may have to install bash or try the simpler shell (sh).

bash install-lams.sh

Then answer the questions. Do not answer "yes" or "no", etc. just "y" etc.

I answered yes to all questions, except the wrapper one since it wont work for Solaris.

The install should complete with:

Configuring JBoss with your settings.
Buildfile: ant-scripts/configure-deploy.xml
LAMS 2.1 Configuration completed!
Please view the "readme" file for instructions on how to run LAMS.

Now LAMS is installed within the jboss server. LAMS related files in the system are:

  • Start-up script: /usr/local/jboss-4.0.2/bin/run-lams.sh
  • Repository files: /usr/local/lams/lams
  • Configuration file: /etc/lams2/lams.properties
  • LAMS server: /usr/local/jboss-4.0.2/server/default/deploy/lams.ear/

Run LAMS

Go to the bin directory

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

Inside this jboss bin directory type (else fix the script)

./run-lams.sh

First thing to do is:

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

If you see this:

2008-09-19 17:23:31,537 INFO  [org.apache.jk.server.JkMain] Jk running ID=0 time=0/46  config=null
2008-09-19 17:23:31,587 INFO  [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 2m:31s:271ms

then you are lucky :)

Check the URL, e.g.

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

You should see a woman working on a small laptop :)

Trouble shooting

For installation/startup trouble, look at the log files:

Directory:

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

If you forgot the admin login/ password:

  • It's in the configuration file
/etc/lams2/lams.properties

LAMS wont respond after some time

  • Probably you need to increase memory. For 2.1RC0 it needed about 1.5GB, hopefully less this time. Edit either of:
/usr/local/jboss-4.0.2/bin/run.conf
/usr/local/jboss-4.0.2/bin/run-lams.sh

Install the 2.1.1 patch

1) Shutdown the jboss server:

/usr/local/jboss-4.0.2/bin/shutdown.sh --shutdown

To see if it's down:

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

2) Read the doc and make a fix

cd /src/lams/lams-unix-patch-2.1.1

a) Read the "readme" file

b) Fix the script if you want (not really needed). Replace the line

du -chs $LAMS_DIR $JBOSS_DIR

with

du -hs $LAMS_DIR $JBOSS_DIR

3) Run the installer and answer questions. Since I did a fresh 2.1 install just minutes before I did not test any of the backup features. Didn't test the shutdown either.

bash install-lams-patch.sh 

4) Fix the startup script a bit, i.e. change line 1 with something like line 2

# nohup ./run.sh > /dev/null &
nohup /usr/local/jboss-4.0.2/bin/run.sh > /dev/null &

4) Test the new version

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

Wait a while and/or play with:

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

Configuration of LAMS

Once your server is up and running, go to the Administration "Edit Configuration Settings":

1) Essential:

  • add email (e.g. yours)
  • add the smtp server (but you have to make sure that your institution lets machines post to it. There might be some anti-spam censorship)

2) Uploaded files

  • I kept the defaults

3) LDAP

  • I am intrigued by this. It should not show since I didn't ask for it.... (later)
  • Basically I think that we will use LAMS only from Moodle ... and all our platforms should use LDAP but they don't ;)

4) Look an feel

  • I suggest making screen sizes a bit bigger (unless your students work with ultra-light portable computers)

Tweaking for production

(later)

Discussion / Problems

Compared to older LAMS installations and the 2.1RCx version, the 2.1 install + 2.1.1 patch install went rather flawlessly.

  • The install script gives to many privileges to the lams user in the MySQL database. Fix these if you are afraid.
  • The 2.1.1. patch install script had a slight problem, i.e. an incompatible "du" flag. You wont see how much diskspace your will need, doesn't matter since you certainly got a real server ;)
  • The startup script has a relative file name for the jboss "run.sh" script. You may make it full path for later use.$$$$
  • Only missing thing is a /etc/init.d/ startup/shutdown script (later)

Moodle - LAMS integration

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

The setup

  • Moodle 1.9.2+. It 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 !)

Installation:

  1. Download a new file (it seems that fixes are made sometimes)
  2. Unzip the file
  3. Move the lamstwo directory to moodle/mod/
  4. Move the lamstwo.php file to moodle/lang/en_utf8/
  5. Login as admin and go to http://yourmoodle/admin, LAMS tables will be created automatically.

Configuration on the Moodle Side:

  • Go to Modules / Activities / and click settings for 'LAMS v2 module. At this point you also should consider removing the old LAMS module from the system (but it doesn't matter).

I used the following values:

server_url:     http://tecfasun1.unige.ch:8080/lams
server_id:      moodle
server_key:     somethingsecret
request_source: moodle

Validate and Save

On the LAMS side

Note: There seems to be a bug. If you Disable Organization it will never come back. So don't tick this.

  • Go to "System Administration", then "Maintain integrated servers". click on edit. In particular: Make sure that you get the Moodle "user information" URL right and that all parameters match on both sides (be careful with "Moodle" vs. "moodle"!).
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

Test it

Get a pack from the lamscommunity. Three obvious choices are:

In Moodle you can add these in two steps:

1) "Add an activity"

If you can't see anything happen, e.g. you just get this message and nothing else:

 Sequence

 The directory structure below contains the sequences you can create a lesson for.
 Select one and click on the next button to continue.

then you made a mistake in the configuration, e.g. the "user information" URL is wrong.

2) Import a sequence in LAMS

Inside the LAMS application:

  • File->Import
  • File->Save

3) Then when you are back to Moodle:

  • Select the sequence from the workspace tree
  • Click Next and fill in the usual little Moodle activity infos (header and short text)

This may also fail because of communication timeouts between the two machines. I'll look into this later. You can retry installing an activity by editing it....

Moodle-LAMS Notes

You may have to adjust timeouts and other stuff if your server load is high.

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 once)

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

Be careful about using several browser windows and tabs. The "system Administration" page will use an already openend window/tab. So if the "Sys Admin" link doesn't bring up the tool or complains about your role, etc. look for it on your desktop and close it. Maybe also log out and in again from your LAMS server if you just tested Moodle before.

If you tried a Moodle LAMS integration in the past with an older LAMS server, your MOODLE may have junk left inside. Replace all older Moodle LAMS integration code (as we actually pointed out above)

Only if you don't have activities in production:

  • delete the LAMS2 module in MOODLE.

In any case:

  • Remove all the the files in the moodle/mod/lamstwo directory
  • Reinstall a new version (downloaded fresh).

LAMS 2.0 RC2 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 ! But since some of our students like to play with tech, I may update it some day .... - Daniel K. Schneider 16:54, 19 September 2008 (UTC)

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

  • Make sure that the LAMS port (8080) is free, e.g. install Active Ports or type something like netstat -a in a DOS terminal.
  • 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.

Documentation and using LAMS

This page is not a resource for end users like course designers or learners. See:

Official LAMS 2 installation documentation
Lams Moodle integration
Trouble shooting