2.2. New OLAT installation

2.2.1. Install the prerequisites

Quick start installation of the needed tools (advanced users)

  • Install Java SDK (JRE is not enough, because Tomcat needs the Java compiler) from java.sun.com and set the JAVA_HOME environment variable to the install location like JAVA_HOME=C:\java\jdk1.5.0.

  • Install Tomcat Servlet Engine ( Tomcat download) and set the CATALINA_HOME environment variable to the location where you installed Tomcat. Start Tomcat by running startup (located in CATALINA_HOME/bin directory) and point your browser to http://localhost:8080/ If you see the Tomcat screen, these steps are done.

  • Install Ant (Built tool, that will compile and setup your OLAT installation) from jakarta.apache.org/ant and set the ANT_HOME environment variable to the install directory. Add the ANT_HOME to your PATH variable as well, so you can run Ant from everywhere.

  • Install Mysql Database (http://www.mysql.com) Create a new database 'olat' with a user 'olat' and the password of your choice. If you want to execute the jUnit tests, you also need an aditional test-database. E.g. 'testdb' would be a good database name. Some MySQL versions have problems with too long database names (together with the generated tables), eg. olattestdb is too long on some versions. For most users it is fine to just generate the 'olat' database.

    There are two alternatives to set up the database and the database users:

    1) Use the tool /olat3/bin/dbAndUserSetup.sh. This will generate the OLAT database and the user to access the database automatically.

    2) Manually for MySql 4.x: Go to the mysql/bin directory and create a database with mysql_admin programm.

    # mysql_admin create olat -u root
    Change to the mysql database tablespace.
    # mysql -u root -p
    # use mysql; 
    On the console run the following two SQL-statements:
    # mysql> insert into user (Host,User,Password) values("localhost","olat",password("olat"));
    # mysql> insert into db values("localhost","olat","olat","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y");
    # mysql> flush privileges;

    2) Manually for MySql 5.x: Go to the mysql/bin directory and create a database with mysql_admin programm.

    # mysql -u root -p
    On the console run the following SQL-statements:
    # use mysql; 
    # mysql> create database olat;
    # mysql> create user 'olat'@'localhost' identified by 'olat';
    # mysql> grant all on olat.* to 'olat';
    # mysql> flush privileges;

    Alternative Database: Install of PostgreSQL database. See Section 2.3.2, “Postgres”

    Now you have a user 'olat' with password 'olat' in the database 'olat'. Note the database username, databasename and password. You will need this later in the build.properties file.

    Now your tools are ready to run OLAT.

2.2.2. Getting the sources.

  • Get the OLAT sources from our homepage www.olat.org.

  • Create directory for your OLAT installation. We will refer to this directory by PATH_TO_YOUR_OLAT throughout the rest of these installation instructions. Change into your OLAT installation directory now.

  • Unpack the actual OLAT-X.X.X.zip file in this directory. (eg 'unzip OLAT-X.X.X.zip').

2.2.3. OLAT configuration

  • Now that you've set up the infrastructure software, you're just a few steps away from your own OLAT installation. All that's left is configuring OLAT according to your setup. This task is almost completely automated by Ant build files.

  • Copy the PATH_TO_YOUR_OLAT/olat3/build.properties.default to PATH_TO_YOUR_OLAT/olat3/build.properties

  • Edit PATH_TO_YOUR_OLAT/olat3/build.properties to match your installation. You'll find instructions with regard to the parameters to set in the build.properties file.

  • Run 'ant config-all' - This will create the necessary config files.

  • There are two config files for Tomcat generated by 'ant config-all':

    server.xml configures Tomcat to accept HTTP requests directly. All requests to OLAT rebuild code will go to Tomcat directly. For testing go with this file and you don't need to install Apache.

    server_jk_contector.xml configures your Tomcat with Apache as main gateway to OLAT. All requests go through Apache first and are forwarded through a Tomcat JK Connector by Apache if necessary. This shields Tomcat from the outside world. We suggest using this connector for security reasons.

    Rename either of the two files as server.xml and copy it to TOMCAT_HOME/conf/server.xml

  • To force Tomcat using the compatible XML-APIs, copy the necessary DOM3-enabled XML JARs (xercesImpl.jar, xml.apis.jar and xalan.jar) into Tomcat's endorsed directory.

    # cp PATH_TO_YOUR_OLAT/workspace/olat3/webapp/WEB-INF/lib/xercesImpl.jar xml.apis.jar xalan.jar CATALINA_HOME/common/endorsed
    To compile OLAT with your installed JDK you need the XML API's also in your Java enviroement.
    The JDK endorsed directory is not created by default.
    You'll have to manually create a directory called $JAVA_HOME/jre/lib/endorsed.
    # mkdir JAVA_HOME/jre/endorsed
    # cp PATH_TO_YOUR_OLAT/workspace/olat3/webapp/WEB-INF/lib/xercesImpl.jar xml.apis.jar xalan.jar JAVA_HOME/jre/endorsed
    
    Now you should be ready to compile OLAT, type:
    # ant build
  • Finally you'll need to setup the necessary database tables for OLAT. 'ant dbsetup' will do the job for you. Be careful with that target on a productive system since you will loose all your data!

  • You can now start Tomcat (if configured restart Apache)

  • Access your OLAT installation:

    You can reach your OLAT installation at http://your.site.com:[PORT]/CONTEXT_PATH where CONTEXT_PATH is the context path of your application as you've configured it in your build.properties file. The default is "olat" e.g. http://localhost:8080/olat

    There are some accounts setup by default:

    Login: 'administrator' Password: 'olat'. This account has full administrative rights. We advise you to change the password immediately (see 'Home' -> 'settings' -> 'Password')

    Login: 'gast' Password: 'gast'. This account is the default account for 'Learningresources' which grant access to guests. By default, this account does not have access to any content in OLAT.

  • Note: If you encounter an error like: "Error creating bean with name 'bbfactory' defined in file [/opt/OLAT/webapp/WEB-INF/olat_extensions.xml" make shure you give the right ownership to all files processed by the user that runs tomcat. On linux you can reach this by using the command "chown -R yourtomcatuser:yourgroup PATH_TO_YOUR_INSTALLATION".