LAMS installation and configuration: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
(Added references to LAMS version 4.5, included default users, improve git instructions)
 
(143 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{under construction}}
{{incomplete}}
<!-- <pageby nominor="false" comments="false"/> -->
== Definition ==
== Definition ==


This page contains installation tips for [[LAMS]]
This page contains installation tips for a '''fresh''' install of [[LAMS]].


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 ==
Note: I put the legacy stuff in the [[Talk:LAMS_installation_and_configuration|discussion page]], e.g. LAMS 2.x for Ubuntu, LAMS 2.1RC for Solaris


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.
== LAMS 4.5+ ==
As of July 2021, LAMS 4.5 was released and is the latest stable release.  


=== Other Software ===
=== Getting the LAMS source code ===
To run it on windows you need to install other software.
Source code is available from [https://github.com/lamsfoundation/lams Github]. The code branch to use is v4.5
* Java JSE 5.0 (update 9), ''not just the JRE''. Get it from [http://java.sun.com/javase/downloads/index.jsp Sun].
* MySQL: Get it directly from [http://dev.mysql.com/downloads/ 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 [http://dev.mysql.com/doc/refman/5.0/en/windows-install-wizard.html information] from MySQL AB and [http://lamscommunity.org/dotlrn/clubs/technicalcommunity/forums/message-view?message_id=118753 this posting] and [http://lamscommunity.org/dotlrn/clubs/technicalcommunity/forums/attach/download/win_registry_msql%2ejpg?object_id=118756&attachment_id=118758 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: [http://lamscommunity.org/dotlrn/clubs/technicalcommunity/forums/message-view?message_id=341725 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 ===
'''Required software'''
* 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.
* Git
* Wildfly 14.0.1
* OpenJDK 11
* MySQL 8.0
* Ant  (Java task compiler)


=== LAMS ===
==== OpenJDK 11 ====
* 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.
In Debian/Ubuntu 20.04


== Lams 2.0.x on On Solaris ==
$ sudo apt install openjdk-11-jdk-headless
$ sudo apt install fontconfig
==== MySQL 8.0 DB ====


Lams 2.0 was released on december 6 2006. Since then there very several minor upgrades.
$ wget https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb
On March 2008, the current releases are 2.0.4 (stable) and 2.1 (RC1).
$ sudo dpkg -i  mysql-apt-config_0.8.15-1_all.deb
$ sudo apt update
$ sudo apt install mysql-server
$ sudo mysql_secure_installation


First, read the instructions in:
===== Basic MySQL configuration =====
* [http://wiki.lamsfoundation.org/display/lamsdocs/Unix+Installer+Help Unix Installation and Updating Help] (if you plan to use the unix installer)
''/etc/mysql/mysql.conf.d/mysqld.cnf''
* [http://wiki.lamsfoundation.org/display/lams/Building+LAMS Building LAMS] (if you plan a source install)
* [http://wiki.lamsfoundation.org/display/lams/Development+Environment Development Environment]


=== Java software ===
...
# LAMS stuff
explicit_defaults_for_timestamp
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
transaction-isolation=READ-COMMITTED
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
max_allowed_packet=32M
# Record slow queries
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 10
[mysqldump]
default-character-set=utf8mb4
hex-blob=1
single-transaction=1
quick=1
...


; Java + ant
After installing MySQL, create a user and a DB for LAMS and grant appropriate permissions:


* Solaris 10 ought to have the right java + ant installed.  
DROP DATABASE IF EXISTS lams;
CREATE DATABASE lamsdb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SET FOREIGN_KEY_CHECKS=1;
GRANT ALL PRIVILEGES ON lamsdb.* TO lamsdbuser@localhost IDENTIFIED BY 'real_secret_pw';
REVOKE SUPER ON *.* from lamsdbuser@localhost;


Check if java can be found, i.e. type:
==== Wildfly 14.0.1 ====
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.


=== Wildfire ===
$ wget https://download.jboss.org/wildfly/14.0.1.Final/wildfly-14.0.1.Final.tar.gz
$ cd /opt/lams
$ tar xvzf wildfly-14.0.1.Final.tar.gz


This is a [http://en.wikipedia.org/wiki/Xmpp XMPP] (Jabber) chat server, that actually is called Openfire now.  See:
==== LAMS source code pre-compilation ====
* [http://wiki.lamsfoundation.org/display/lamsdocs/Installing+Wildfire+for+LAM Installing Wildfire for LAMS]
LAMS is open source and its code is available from [https://github.com/lamsfoundation/lams GitHub]<syntaxhighlight lang="bash">
* Also read [http://www.igniterealtime.org/builds/wildfire/docs/latest/documentation/install-guide.html Installation guide] (at Igniterealtime).
git clone https://github.com/lamsfoundation/lams.git
</syntaxhighlight>By default branch is LAMS' latest stable release as of July 2021, that's version 4.5. If you need a previous branch, see [https://github.com/lamsfoundation/lams/branches other branches available].


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.
Wherever you have your LAMS v4.5 code, edit the following files
* 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.
* 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:
'''common.properties'''


1) Uncompress in /usr/local/wildfire
Primarily the DB settings and based system.


2) Start it with ./bin/wildfire start
If you are building LAMS using Windows, set the osPropertiesName to "windows" instead of "unix".  
* This is a typical starup 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).
...  
  http://localhost:9090/
  #======== DATABASE PROPERTIES =========
db.host=localhost
db.port=3306
db.name=lamsdb
db.username=lamsdbuser 
db.password=real_secret_pw
...
osPropertiesName=unix
...


* Use "embedded database" if you want to make it shorter, else you have to set up mysql
''If you are building LAMS in a unix based system, then change the file '''unix.properties.''' If you are using Windows, then change the '''windows.properties''' file instead.''


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.
'''unix.properties'''


* Tick "Don't Show History" (Group Chat -> History Settings)
Here you will need to figure a path to the content repository
contentrepository.base=/var/opt/lams


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 unbuntu, read [https://wiki.ubuntu.com/Jabber Jabber]
The path to your Wildfly folder
server.home=/usr/local/wildfly-14.0.1/


Installing wildfire should be easy, it was for me. It's a fairly popular product...
...
contentrepository.base=/var/opt/lams
...
server.home=/opt/lams/wildfly-14.0.1/
...  


=== Configure MySQL ===
==== Compilation and deployment ====


1) Make sure to have a MySQL '''5.x''' server.
cd lams_build
ant deploy-lams


2) Configure it according to the [http://wiki.lamsfoundation.org/display/lamsdocs/Installing+MySQL+on+Windows+for+LAMS instructions]
If no errors occurred, you are ready to start Wildfly.  


Edit file my.cnf according to the instructions
cd /opt/lams/wildfly-14.0.1/bin
* This cnf file may be in different locations
./standalone.sh
* Type ''mysql --help'' for a list of the places MySql 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.


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


  [mysqld]
LAMS should be available at localhost:8080/lams/  
....
transaction-isolation=READ-COMMITTED
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"


Then restart mysql !
By default, LAMS has a set of preconfigured users:
{| class="wikitable"
|+Default Users
!user
!password
!role
|-
|sysadmin
|sysadmin
|System administrator
|-
|test1
|test1
|Teacher, student, tutor
|-
|test2
|test2
|Teacher, student, tutor
|-
|test3
|test3
|Teacher, student, tutor
|-
|test4
|test4
|Teacher, student, tutor
|}
Of course, you can create and import users and courses into LAMS at any time from the sysadmin menu. 


3) Create a lams database.
(OPTIONAL) Wildfly comes with a ton of libraries that LAMS does not use. So to slim Wildfly to only use the libs that LAMS uses, please run the following ant task in the lams_build folder: <syntaxhighlight lang="bash">
ant slim-standalone
</syntaxhighlight>


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.
== LAMS 3.1 ==


Then create:
As of March 2019, we do have a new LAMS installation that works fine in virtual server running Ubuntu 18.x.
* 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:
* [https://github.com/lamsfoundation/lams Github]
mysql -u root -p
* [https://wiki.lamsfoundation.org/display/lams/LAMS+3.1+in+Ubuntu Quick compile guide for Ubuntu]


Then enter the following lines (alternatively read them from a file)
However, I do not feel doing system administration anymore (except for this wiki) and I asked our systems person to do it. So there is not documentation, sorry.
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


; JBOSS
Lams Moodle integration. There are two types of integration.
JBOSS is a Java application server.
* LAMS - Moodle integration with a Moodle plugin.
* [[IMS Learning Tools Interoperability|LTI]] integration, i.e. Moodle can "consume" LAMS contents


* I got the 4.0.2 binary from [http://labs.jboss.com/portal/jbossas/download Jboss.org]
=== LTI external tool integration ===


* Unpackage into /usr/local
Documentation
gtar xzf jboss-4.0.2.tar.gz -C /usr/local
* [https://docs.moodle.org/36/en/External_tool_settings External tool settings] (Moodle 3.6 manual).  
* [https://wiki.lamsfoundation.org/display/lams/Integrations Integrations] (LAMS documentation).


* Copy some jar files
An administrator can manually configure external tools in Site administration > Plugins > Activity modules > External tool> Manage tools so that they are available across the site.  
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 ===
=== Moodle LAMS integration through a Moodle plugin ===


Get the archive from the [http://wiki.lamsfoundation.org/display/lams/Downloads downloads] page.
* We did that with LAMS 2.5. To be tested with LAMS 3.0. There is a [https://wiki.lamsfoundation.org/display/lams/Integrations plugin for download] and the method should be the same.


Direct links: this may change !
== LAMS 3.0 ==


* [http://saturn.melcoe.mq.edu.au/installers/lams-unix-installer-2.0.4.tar.gz lams 2.0.4 Australian mirror]
As of November 2018, the current system is LAMS 3.x. You can test this with a [https://demo.lamsfoundation.org/lams/ demo version]. '''Below, we started documenting an installation on Ubunt 18x, but we did not find time to complete the installation'''. As you can see something went wrong. Instead, we installed LAMS 3.1 on a virtual server machine.
* [http://lamscommunity.org/2.0/stable/unix/lams-unix-installer-2.0.4.tar.gz lams 2.0.4 UK mirror]


Note: If you want to play with a release candiate, 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 [http://lamscvs.melcoe.mq.edu.au/cgi-bin/viewcvs.cgi/ lams cvs repository]. To get the code from CVS, consult [http://wiki.lamsfoundation.org/display/lams/Building+LAMS building lams]) and then build from source.
'''History'''


=== Preinstall configuration ===
LAMS 2.5 was initially promised for 2014. Then, after a funding cut, the LAMS team was mostly disbanded and the core team found a new "home" in Singapour. Sometimes in 2016 the version number was changed to LAMS 3.0.
(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.
'''Status as of Nov 2018'''


1) Decide where the files should go. Either use a typical unix installation with files
* The old LAMS community pages are still online, but no longer maintained.
all over the place or put all LAMS related in some directory, e.g. /usr/local/lams.
I prefer the second solution, since this way you can get rid of unwanted software easily...


2) Dezip the installer in some place, e.g. /src/lams
* LAMS 3.x it is available on [https://github.com/lamsfoundation/lams Github], but documentation is lacking. Also, there is no installer. You will have to install and configure like in the "good" old times ....
gtar -xvf lams-unix-installer-2.1-RC1.tar.gz
** LAMS 3.x will run under old 8.2.1 version of [http://wildfly.org/downloads/ Wildfly], formerly JBoss (?). E.g. see [https://www.howtoforge.com/tutorial/ubuntu-wildfly-jboss-installation/ How to install WildFly (JBoss) Java Application Server on Ubuntu 18.04].
** Create a MySQL database
** Build the system with ANT


3) Then edit the '''lams.properties''' file according to [http://wiki.lamsfoundation.org/display/lamsdocs/Unix+Installer+Help unix installer help].
* https://demo.lamsfoundation.org/lams/ does run a 3.x demo version for which you can require a login.
This file sits in the install directory.


Make a backup first
* LAMS 3.x is available as commercial offering through [https://www.lamsinternational.com/ Lams International] and also through content services (to be verified).
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.
=== Prerequisites ===


Port number. If you change this, you also have to reconfigure JBOSS !
;Java
  LAMS_PORT=8080
: Usually, this is installed. Check it. In principle, the Open JDK should work, however we do not know if that is true for older version. If it does not (we have to test) this, then it should be replaced with Oracle one. '''This is very likely the case'''.
java -version
gives something link:
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
  OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)


Server URL (certainly not localhost). E.g. you want something like:
Installation did not work with java 11, so I tried '''OpenJDK version 8'''. If you don't have Java 8 (it already was on my system), install it first.
SERVER_URL=http://tecfasun1.unige.ch:8080/lams/


=== Using the installer ===
udo apt install openjdk-8-jdk


* Reminder: Read [http://wiki.lamsfoundation.org/display/lamsdocs/Unix+Installer+Help Unix Installation and Updating Help]
To use Java 8 by default, you can do the following. Most software seems to use Java 8 anyhow ....
sudo update-alternatives --config java


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:


  echo $JAVA_HOME
;SASS (some kind of CSS pre-processor)
  sudo apt install sass


Depending on which shell you use, you may use something like:
;Ant
  setenv PATH /usr/java/bin/:$PATH
  sudo apt install ant


Then install, type:
;If exists, stop your old LAMS, e.g.
./install-lams.sh
: /etc/init.d/lams2 stop


; RC2 install script does not work on Solaris
=== Kill old LAMS ===


If it fails (which the one script I got did), use debugging modes, e.g.:
We did not try to upgrade an old LAMS installation since we did not have many sequences that were worthwhile keeping and since there are no instructions on how to do this. So, export sequences that are worth keeping ...
sh -x ./install-lams.sh
sh -v ./install-lams.sh
sh -vx ./install-lams.sh


Something was wrong in this install script. Since I know that java works, I just commented out two lines in install-lams.sh:
; Remove the startup script for old lams (or similar if it exists)
grep -R lams /etc
: For example
rm /etc/rc6.d/K02lams2
rm /etc/rc5.d/S02lams2
rm /etc/rc4.d/S02lams2
rm /etc/rc3.d/S02lams2
rm /etc/rc2.d/S02lams2
rm /etc/rc1.d/K02lams2
rm /etc/rc0.d/K02lams2


  # checkJava
=== Install and configure Wildfly ===
  ....
  # export JAVA_HOME=$ORIG_JAVA_HOME
  # cd /src
  wget http://download.jboss.org/wildfly/8.2.1.Final/wildfly-8.2.1.Final.tar.gz
  tar xvfz wildfly-8.2.1.Final.tar.gz


Then there was Linux specific line to be fixed:
sudo mv /src/wildfly-8.2.1.Final /opt/wildfly
  # cp -rv assembly/lams.ear ${DEFAULT_DIR}/deploy
sudo chown you:you /opt/wildfly
cp -r assembly/lams.ear ${DEFAULT_DIR}/deploy
  cd /opt/wildfly
more README.txt 


The I got:
#Now test
  LAMS 2.1-RC1 Configuration completed!
cd /opt/wildfly/bin
  Please view the README for instructions on how to run LAMS.
./standalone.sh
# If your X server works and if you got Firefox installed on the server machine
  firefox --new-instance
  http://localhost:9990


(then I had to go play taxi driver for a daughter, to be continued ....)
=== Create a new MySQL database and user ===


=== Legacy notes for solaris ===
(1) Check what you got


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
mysqlshow -p -u root
have changed.


==== LAMS pre-build configuration ====
(2) Create a new database and user
 
mysql -u root -p
and copy/paste an adapted version of the following
<source lang="sql">
DROP DATABASE IF EXISTS lams3; 
CREATE DATABASE lams3 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SET FOREIGN_KEY_CHECKS=1;
GRANT ALL PRIVILEGES ON lams3.* TO lams@localhost IDENTIFIED BY 'real_secret_pw';
REVOKE PROCESS,SUPER ON *.* from lams@localhost;
</source>


I configured the following entries in the following files. Most entries are related to file paths.
After aborting wildfly you can run intot the following type of error (see also [https://lamscommunity.org/dotlrn/clubs/technicalcommunity/forums/message-view?message_id=1069554 this], dated 07/14/10)
/opt/wildfly/bin$ 18:25:34,136 INFO  [JdbcMigrationLauncher]  If this isn't from a long-running patch, but a stale lock, either:
18:25:34,136 INFO  [JdbcMigrationLauncher]    1) run MigrationTableUnlock (probably 'ant patch.unlock')
18:25:34,136 INFO  [JdbcMigrationLauncher]    2) set the lockPollRetries property so the lock times out
18:25:34,136 INFO  [JdbcMigrationLauncher]        (this is dangerous in combination with long-running patches)
  18:25:34,136 INFO  [JdbcMigrationLauncher]    3) set the 'patch_in_progress' in the patches table to 'F'


In lams_build directory:
In the LAMS DataBASE, run the following SQL
update patches set patch_in_progress = "F";


File: lams/lams_build/shared.properties
=== Dowload, configure and build LAMS ===
  (nothing to change)
 
File: lams/lams_build/common.properties
  osPropertiesName=unix
  db.password=XXXX


File: lams/lams_build/unix.properties
In order to find these files again, we decided to put them in /opt but any place can do.
  contentrepository.directory=/usr/local/lams/repository


Change this in '''three''' locations !!
  sudo chown you:your_group /opt/lams
  File: lams_build/conf/unix/jboss/service/mysql-ds.xml
cd /opt/
    <password>XXXX</password>
git clone https://github.com/lamsfoundation/lams.git


In lams_common directory:
'''Edit the configuration files'''


  File: lams/lams_common/db/sql/insert_unix_config_data.sql
  cd /opt/lams/lams_build
  ('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) !
* Make a copy of the *.properties files just be sure. In addition, do not change the properties files themselves since they may be overridden by upgrades. Put them into a file called build.properties.


In the same directory you may change the admin login and password (not tested !)
Change common.properties:
  File: lams/lams_common/db/sql/insert_users.sql 
db.host=localhost
db.port=3306
db.name=lams3
  db.username=lams.....
db.password=real_secret....


Note: I did not find an LamsHome property in any file (''this conflicts with the installation instructions'').
Change file unix.properties:
# Maybe not the best place for you, but at TECFA we always create a /data directory for data that must be kept, e.g. portalware, web server files, etc.
contentrepository.base=/data/lams


==== What if you have another server running on port 8080 ? ====
#JBoss deploy directory (Unix)
server.home=/opt/wildfly


You can run JBOSS on a different port, but need to edit a few files. Read this:
#Sass executable.  
sass_exec_file=/usr/bin/sass


* [http://wiki.lamsfoundation.org/display/lamsdocs/Configuring+Multiple+LAMS+Instances+on+One+Machine Configuring Multiple LAMS Instances on One Machine] (LAMS)
'''Copy the properties to file''' <code>build.properties</code>
* [http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstancesOnOneMachine ConfiguringMultipleJBossInstancesOnOneMachine] (JBoss)


==== Make directories for lams (they must match the above of course) ====
'''Build LAMS'''
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
It is not clear to me if one should build various components. In principle, lams-cruise alone should do the trick.
chmod -R 777 /usr/local/lams


==== Build ====
# go to the build directory
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 /opt/lams/lams_build
  cd /src/lams/lams_build


  ant rebuild-db
  # Optional: build some stuff
  ant assemble-ear
  ant build-db
  ant deploy-ear
  ant deploy-ear  
  ant deploy-tools
  ant deploy-tools
ant copyfiles


==== Run it ====
  # build lams (ant will read the build.xml file and "cruise" is a "target" that should build the whole thing)
  cd /usr/local/jboss-4.0.2/bin/
  ant lams-cruise
  ./run.sh &


The adminstrator login is '''sysadmin''' (don't forget this)
At the end you should see something like:
lams-cruise:
BUILD SUCCESSFUL
Total time: 3 minutes 35 seconds


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 ;)
Now, in principle, LAMS is deployed in the Wildfly sever and could launch it again.
/src/lams/lams_common/db/sql/insert_users.sql


==== Server configuration ====
=== Compilation errors with OpenJDK 11 ===
See [http://www.lamsinternational.com/documentation/advanced_p.php?g=configure 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.
Some library is missing with openjdk '''11''' and something else is wrong. I did not get these errors with Openjdk 8, but then I might have installed some extra libraries in the past. I cannot remember.


File: /usr/local/jboss-4.0.2/bin/run.sh
    [echo] LAMS Common: Compiling Java sources
Around line 150 insert:
    [javac] Compiling 469 source files to /opt/lams/lams_common/build/classes/java
JAVA_OPTS="$JAVA_OPTS -Xms500m -Xmx500m -Dprogram.name=$PROGNAME"
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 8
# Display our environment
    [javac] /opt/lams/lams_common/src/java/org/lamsfoundation/lams/policies/dao/hibernate/PolicyDAO.java:22: error: package com.sun.webkit does not exist
    [javac] import com.sun.webkit.PolicyClient;
    [javac]                      ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 1 error
    [javac] 1 warning


==== Things I did wrong ====
=== Test running LAMS with WildFly ===
Now for some human touch ....


* Forget to specify the OS
Make sure that the port that you plan to use with WildFly is free. By default the standalone server version is port 8080.
* 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 ===
#Now test
Look at files in:
  cd /opt/wildfly/bin
  /usr/local/jboss-4.0.2/server/default/log/
./standalone.sh
   
 
Then stop JBoss,
This will take some time since it will have to digest LAMS.
  cd /usr/local/jboss-4.0.2/bin/shutdown -S &
 
   
  # If your X server works and if you got Firefox installed on the server machine you can see something on the server.
Repair misconfigurations above, rebuild with ant and run it again :)
  firefox --new-instance
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.:
  http://localhost:8080
# Execute ''ant clean''
 
# Drop the lams database (and don't forget to create it again)
'''Shutting down the test server'''
# Empty the JBoss server/default/deploy/lams.ear/ directory ?


=== To Do list ===
* CTRL-C in the console
(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
Else if you ran it as background process:
* Test and tweak
jboss-cli.sh --connect --command=:shutdown
* Integrate with Moodle


== Moodle - LAMS integration ==
== Documentation and using LAMS ==


The [http://wiki.lamsfoundation.org/display/lamsdocs/LAMS+v2.0+Integration+Setup+Step-by-Step+Guide  LAMS v2.0 Integration Setup Step-by-Step Guide] is fairly well done :)
'''Attention''': This wiki page is not a resource for end users like course designers or learners. Instead see:


=== Short installation summary (see the above guide) ===
* [http://wiki.lamsfoundation.org/display/lamsdocs/Home LAMS documentation Wiki Home]


{{under construction}}
* [[LAMS]] (this wiki)
I didn't manage to get this going yet. Moodle somehow complains about not being able to make a second instance of LAMS... Probably this has to do with the fact that I run LAMS on an other server and that I need some bridge from JBOSS to an Apache server on port 80 which I need to install :(


; On the Moodle side
; Official LAMS 2 installation documentation
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
* [http://wiki.lamsfoundation.org/display/lamsdocs/Installing+MySQL+on+Windows+for+LAMS Installing Windows for LAMS] (also includes important MySQL configuration information)
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:    .....
request_source: Moodle


; On the LAMS side:
* [http://wiki.lamsfoundation.org/display/lamsdocs/Integrations LAMS & LMS Integrations]
# Made a "moodle" Group and added a test lesson
# The integrated server setup is:
Id:          moodle
Key: .        ....
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:
* [http://wiki.lamsfoundation.org/display/lamsdocs/Unix+Installer+Help Unix Installation and Updating Help] (if you plan to use the unix installer)
* 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)


=== Documentation ===
; Lams Moodle integration


; General
* [http://docs.moodle.org/en/Category:LAMS Category:LAMS in the Moodle Wiki]
* [http://docs.moodle.org/en/Category:LAMS Category:LAMS in the Moodle Wiki]


; LAMS 1 (you rather should use LAMS 2)
* [http://wiki.lamsfoundation.org/display/lamsdocs/LAMS+v2.0+Integration+Setup+Step-by-Step+Guide LAMS v2.0 Integration Setup Step-by-Step Guide]
* [http://www.linuxtraining.org.uk/blogger1.html LAMS installation on CentOS 4 (RHEL 4)] (LAMS 1.x)
* [http://lamsfoundation.org/integration/moodle/walkthru.html LAMS and Moodle Integration Walkthrough] (LAMS 1.x)


; LAMS 2
; Trouble shooting
* [http://wiki.lamsfoundation.org/display/lamsdocs/LAMS+v2.0+Integration+Setup+Step-by-Step+Guide  LAMS v2.0 Integration Setup Step-by-Step Guide]
* [http://lamscommunity.org/dotlrn/clubs/technicalcommunity/ Technical community - Forums]


[[Category: Educational technologies]]
[[Category: Installation tips]]
[[Category: Installation tips]]

Latest revision as of 01:55, 16 November 2021

Definition

This page contains installation tips for a fresh install of LAMS.

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.x for Ubuntu, LAMS 2.1RC for Solaris

LAMS 4.5+

As of July 2021, LAMS 4.5 was released and is the latest stable release.

Getting the LAMS source code

Source code is available from Github. The code branch to use is v4.5

Required software

  • Git
  • Wildfly 14.0.1
  • OpenJDK 11
  • MySQL 8.0
  • Ant (Java task compiler)

OpenJDK 11

In Debian/Ubuntu 20.04

$ sudo apt install openjdk-11-jdk-headless
$ sudo apt install fontconfig

MySQL 8.0 DB

$ wget https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb
$ sudo dpkg -i  mysql-apt-config_0.8.15-1_all.deb
$ sudo apt update
$ sudo apt install mysql-server
$ sudo mysql_secure_installation
Basic MySQL configuration

/etc/mysql/mysql.conf.d/mysqld.cnf

...
# LAMS stuff
explicit_defaults_for_timestamp
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
transaction-isolation=READ-COMMITTED
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
max_allowed_packet=32M
# Record slow queries
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 10

[mysqldump]
default-character-set=utf8mb4
hex-blob=1
single-transaction=1
quick=1
...

After installing MySQL, create a user and a DB for LAMS and grant appropriate permissions:

DROP DATABASE IF EXISTS lams;
CREATE DATABASE lamsdb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SET FOREIGN_KEY_CHECKS=1;
GRANT ALL PRIVILEGES ON lamsdb.* TO lamsdbuser@localhost IDENTIFIED BY 'real_secret_pw';
REVOKE SUPER ON *.* from lamsdbuser@localhost;

Wildfly 14.0.1

$ wget https://download.jboss.org/wildfly/14.0.1.Final/wildfly-14.0.1.Final.tar.gz
$ cd /opt/lams
$ tar xvzf wildfly-14.0.1.Final.tar.gz

LAMS source code pre-compilation

LAMS is open source and its code is available from GitHub

git clone https://github.com/lamsfoundation/lams.git

By default branch is LAMS' latest stable release as of July 2021, that's version 4.5. If you need a previous branch, see other branches available.

Wherever you have your LAMS v4.5 code, edit the following files

common.properties

Primarily the DB settings and based system.

If you are building LAMS using Windows, set the osPropertiesName to "windows" instead of "unix".

... 
#======== DATABASE PROPERTIES =========
db.host=localhost
db.port=3306
db.name=lamsdb
db.username=lamsdbuser  
db.password=real_secret_pw
...
osPropertiesName=unix
... 

If you are building LAMS in a unix based system, then change the file unix.properties. If you are using Windows, then change the windows.properties file instead.

unix.properties

Here you will need to figure a path to the content repository contentrepository.base=/var/opt/lams

The path to your Wildfly folder server.home=/usr/local/wildfly-14.0.1/

... 
contentrepository.base=/var/opt/lams 
... 
server.home=/opt/lams/wildfly-14.0.1/
... 

Compilation and deployment

cd lams_build
ant deploy-lams 

If no errors occurred, you are ready to start Wildfly.

cd /opt/lams/wildfly-14.0.1/bin
./standalone.sh


LAMS should be available at localhost:8080/lams/

By default, LAMS has a set of preconfigured users:

Default Users
user password role
sysadmin sysadmin System administrator
test1 test1 Teacher, student, tutor
test2 test2 Teacher, student, tutor
test3 test3 Teacher, student, tutor
test4 test4 Teacher, student, tutor

Of course, you can create and import users and courses into LAMS at any time from the sysadmin menu.

(OPTIONAL) Wildfly comes with a ton of libraries that LAMS does not use. So to slim Wildfly to only use the libs that LAMS uses, please run the following ant task in the lams_build folder:

ant slim-standalone

LAMS 3.1

As of March 2019, we do have a new LAMS installation that works fine in virtual server running Ubuntu 18.x.

However, I do not feel doing system administration anymore (except for this wiki) and I asked our systems person to do it. So there is not documentation, sorry.

Lams Moodle integration. There are two types of integration.

  • LAMS - Moodle integration with a Moodle plugin.
  • LTI integration, i.e. Moodle can "consume" LAMS contents

LTI external tool integration

Documentation

An administrator can manually configure external tools in Site administration > Plugins > Activity modules > External tool> Manage tools so that they are available across the site.

Moodle LAMS integration through a Moodle plugin

  • We did that with LAMS 2.5. To be tested with LAMS 3.0. There is a plugin for download and the method should be the same.

LAMS 3.0

As of November 2018, the current system is LAMS 3.x. You can test this with a demo version. Below, we started documenting an installation on Ubunt 18x, but we did not find time to complete the installation. As you can see something went wrong. Instead, we installed LAMS 3.1 on a virtual server machine.

History

LAMS 2.5 was initially promised for 2014. Then, after a funding cut, the LAMS team was mostly disbanded and the core team found a new "home" in Singapour. Sometimes in 2016 the version number was changed to LAMS 3.0.

Status as of Nov 2018

  • The old LAMS community pages are still online, but no longer maintained.
  • LAMS 3.x is available as commercial offering through Lams International and also through content services (to be verified).


Prerequisites

Java
Usually, this is installed. Check it. In principle, the Open JDK should work, however we do not know if that is true for older version. If it does not (we have to test) this, then it should be replaced with Oracle one. This is very likely the case.
java -version

gives something link:

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)

Installation did not work with java 11, so I tried OpenJDK version 8. If you don't have Java 8 (it already was on my system), install it first.

udo apt install openjdk-8-jdk
To use Java 8 by default, you can do the following. Most software seems to use Java 8 anyhow ....
sudo update-alternatives --config java


SASS (some kind of CSS pre-processor)
sudo apt install sass
Ant
sudo apt install ant
If exists, stop your old LAMS, e.g.
/etc/init.d/lams2 stop

Kill old LAMS

We did not try to upgrade an old LAMS installation since we did not have many sequences that were worthwhile keeping and since there are no instructions on how to do this. So, export sequences that are worth keeping ...

Remove the startup script for old lams (or similar if it exists)
grep -R lams /etc
For example
rm /etc/rc6.d/K02lams2
rm /etc/rc5.d/S02lams2
rm /etc/rc4.d/S02lams2
rm /etc/rc3.d/S02lams2
rm /etc/rc2.d/S02lams2
rm /etc/rc1.d/K02lams2
rm /etc/rc0.d/K02lams2

Install and configure Wildfly

# cd /src
wget http://download.jboss.org/wildfly/8.2.1.Final/wildfly-8.2.1.Final.tar.gz
tar xvfz wildfly-8.2.1.Final.tar.gz 
sudo mv /src/wildfly-8.2.1.Final /opt/wildfly
sudo chown you:you /opt/wildfly
cd /opt/wildfly
more README.txt   
#Now test
cd /opt/wildfly/bin
./standalone.sh
# If your X server works and if you got Firefox installed on the server machine
firefox --new-instance
http://localhost:9990

Create a new MySQL database and user

(1) Check what you got

mysqlshow -p -u root

(2) Create a new database and user

mysql -u root -p

and copy/paste an adapted version of the following

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

After aborting wildfly you can run intot the following type of error (see also this, dated 07/14/10)

/opt/wildfly/bin$ 18:25:34,136 INFO  [JdbcMigrationLauncher]   If this isn't from a long-running patch, but a stale lock, either:
18:25:34,136 INFO  [JdbcMigrationLauncher]     1) run MigrationTableUnlock (probably 'ant patch.unlock')
18:25:34,136 INFO  [JdbcMigrationLauncher]     2) set the lockPollRetries property so the lock times out
18:25:34,136 INFO  [JdbcMigrationLauncher]        (this is dangerous in combination with long-running patches)
 18:25:34,136 INFO  [JdbcMigrationLauncher]     3) set the 'patch_in_progress' in the patches table to 'F'

In the LAMS DataBASE, run the following SQL

update patches set patch_in_progress = "F";

Dowload, configure and build LAMS

In order to find these files again, we decided to put them in /opt but any place can do.

sudo chown you:your_group /opt/lams 
cd /opt/
git clone https://github.com/lamsfoundation/lams.git

Edit the configuration files

cd /opt/lams/lams_build
  • Make a copy of the *.properties files just be sure. In addition, do not change the properties files themselves since they may be overridden by upgrades. Put them into a file called build.properties.

Change common.properties:

db.host=localhost
db.port=3306
db.name=lams3
db.username=lams.....
db.password=real_secret....

Change file unix.properties:

# Maybe not the best place for you, but at TECFA we always create a /data directory for data that must be kept, e.g. portalware, web server files, etc.
contentrepository.base=/data/lams
#JBoss deploy directory (Unix)
server.home=/opt/wildfly
#Sass executable. 
sass_exec_file=/usr/bin/sass

Copy the properties to file build.properties

Build LAMS

It is not clear to me if one should build various components. In principle, lams-cruise alone should do the trick.

# go to the build directory
cd /opt/lams/lams_build
# Optional: build some stuff
ant build-db
ant deploy-ear    
ant deploy-tools
# build lams (ant will read the build.xml file and "cruise" is a "target" that should build the whole thing)
ant lams-cruise

At the end you should see something like:

lams-cruise:
BUILD SUCCESSFUL
Total time: 3 minutes 35 seconds

Now, in principle, LAMS is deployed in the Wildfly sever and could launch it again.

Compilation errors with OpenJDK 11

Some library is missing with openjdk 11 and something else is wrong. I did not get these errors with Openjdk 8, but then I might have installed some extra libraries in the past. I cannot remember.

   [echo] LAMS Common: Compiling Java sources
   [javac] Compiling 469 source files to /opt/lams/lams_common/build/classes/java
   [javac] warning: [options] bootstrap class path not set in conjunction with -source 8
   [javac] /opt/lams/lams_common/src/java/org/lamsfoundation/lams/policies/dao/hibernate/PolicyDAO.java:22: error: package com.sun.webkit does not exist
   [javac] import com.sun.webkit.PolicyClient;
   [javac]                      ^
   [javac] Note: Some input files use or override a deprecated API.
   [javac] Note: Recompile with -Xlint:deprecation for details.
   [javac] Note: Some input files use unchecked or unsafe operations.
   [javac] Note: Recompile with -Xlint:unchecked for details.
   [javac] 1 error
   [javac] 1 warning

Test running LAMS with WildFly

Make sure that the port that you plan to use with WildFly is free. By default the standalone server version is port 8080.

#Now test
cd /opt/wildfly/bin
./standalone.sh

This will take some time since it will have to digest LAMS.

# If your X server works and if you got Firefox installed on the server machine you can see something on the server.
firefox --new-instance
http://localhost:8080

Shutting down the test server

  • CTRL-C in the console

Else if you ran it as background process:

jboss-cli.sh --connect --command=:shutdown

Documentation and using LAMS

Attention: This wiki page is not a resource for end users like course designers or learners. Instead see:

Official LAMS 2 installation documentation
Lams Moodle integration
Trouble shooting