Skip to end of metadata
Go to start of metadata

LAMS 2.4 for Production

The current LAMS 2.4 windows installer is not meant to be use for production servers.

Therefore these are instructions for installing LAMS 2.4 in a production environment.

See the video tutorial for a complete walkthru of the installation process.

See for the complete walkthru.

Software Requirements

  1. MySQL 5.1 or 5.5 Server
  2. Oracle/Sun Java JDK 6 (not version 7)
  3. 7Zip
  4. LAMS 2.4 Binary package

Installing MySQL Server

Download MySQL for your appropriate Windows version (32 or 64 bits) and follow the standard/tyical MySQL Server installation. Here are some screenshots for it

Make sure you include MySQL directory in the PATH. That will make things easier:

Set up a root password (and make sure you remember it!)


Installing Sun/Oracle JDK 6

Go to the Oracle JDK Downloads page and scroll down to get the Java SE 6 Update ## JDK. Make sure you get the JDK 6 and not the JRE 6. Ensure also that you get it from your appropriate Windows version (32 or 64 bits).

When running the installer, just make sure that you install the JDK in an easier to access directory. By default the JDK will try to install in "C:\Program Files\..." but when working with the command line it's always easier to have it more handly like C:\jdk1.6.0_37 for example.


7Zip is an open source implementation of zip and other compressors that is very very fast and efficient. You can download it from here.

LAMS Binary package

The LAMS Binary package contains all the rest you need to get LAMS up and running quickly in production. But make sure that you unzip this in the C: drive. So once you unzip this, your directory structure should look like this:

Tell LAMS the path to the JDK

Edit C:\lams2\jboss-5.1\bin\run.conf.bat file and set the JAVA_HOME path according to the one you set up while installing Java SE 6 JDK. In my case, this would look like:

rem #
rem # Specify the location of the Java home directory (it is recommended that
rem # this always be set). If set, then "%JAVA_HOME%\bin\java" will be used as
rem # the Java VM executable; otherwise, "%JAVA%" will be used (see below).
rem #
set "JAVA_HOME=C:\jdk1.6.0_37"
Create the LAMS DB in MySQL, add the database and tell LAMS how to connect to it

Open a command line prompt and type

mysql -u root -p

You'll be prompted with the password you set up while installing MySQL. Once you enter it correctly you will see:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.28 MySQL Community Server (GPL)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


In the mysql prompt enter the following commands to create the LAMS database:


Now we create the user and password to access this database. Note that we call the user lams and the password lamsdemo. But you can change as you wish/want:

GRANT ALL PRIVILEGES ON lams.* TO lams@localhost IDENTIFIED BY 'lamsdemo';

Let's import the LAMS database model into the newly created mysql db. In the mysql prompt type:

mysql> use lams;
mysql> \. c:\lams2\data\db\lams.sql

Ok, so now we have created the database, populated with the LAMS data structure and now we need to tell the LAMS application how to connect to it. So edit the C:\lams2\jboss-5.1\server\default\deploy\mysql-ds.xml and edi the user-name and password



Starting/Stopping LAMS as service

Edit the file C:\lams2\jboss-5.1\bin\service.bat and set the JAVA_HOME appropriately again according to your setup:

set JAVA_HOME=c:\jdk1.6.0_37

Once you have set the JAVA_HOME, save the file and then open an command line prompt as Administrator and go to the c:\lams2\jboss-5.1\bin folder and enter type service.bat install to install LAMS as a Windows service. See pic:

Done! LAMS is now install as a service.

To test this, go to your service window and start LAMS:

By default, LAMS starts on http://localhost:8080/lams/, so point your browser there and you should be able to see the LAMS login page. The default user is sysadmin password sysadmin.

Video tutorial

Changing Server URL, IP and port

By default, this installing instructions would start LAMS on http://localhost:8080/lams/. However, and most likely, you will need to run LAMS on another IP and port and change its domain name.

You can also have a look at this video tutorial on how you do these changes:

Bounding LAMS to an IP

By default, the application server LAMS uses (JBoss 5.1) bounds itself to the localhost IP address: or localhost. In order to change this, you need to specify the IP you want JBoss to bound to.

To do this, here are the changes you need to do to c:\lams2\jboss-5.1\bin\service.bat (set the IP address to the one for your server):

set "JAVA_OPTS=-Xms128M -Xmx512M -XX:MaxPermSize=256M"
set "IP="

In the same file, you will find two lines that contain the following text:

call run.bat < .r.lock >> run.log 2>&1

Change these lines to:

call run.bat -b %IP% < .r.lock >> run.log 2>&1

Save and restart your LAMS server. LAMS would now be bound to the specified IP address. Note that you will need to change the Server URL (see below in Changing domain name)

Changing Port

By default and in order to prevent LAMS to collide with another web server running, LAMS runs on port 8080. However, you might want to change this to port 80. Make sure that there's no other web server like IIS running on this port before you do this changes.

Change the file c:\lams2\jboss-5.1\server\default\deploy\jbossweb.sar\server.xml to read port="80" instead of port="8080":

      <Connector protocol="HTTP/1.1" port="80" address="${jboss.bind.address}" URIEncoding="UTF-8" 
               connectionTimeout="20000" redirectPort="8443" />

Note that you will need to change the Server URL (see below in Changing domain name).

Changing domain name

If you have change the IP and/or port, you will also need to tell LAMS about the changes you have done by setting the new Server URL. To do this, you will need to login into LAMS as the sysadmin user, goto the sysadmin menu, then click on "Edit configuration settings" and change the server URL to your domain like

Make sure you don't forget to include the last / after lams.

  • No labels