Wiki

Clone wiki

lmf / Installation-Setup

Quick Installation Instructions

The Linked Media Framework (LMF) is implemented as a Java Web Application that can in principle be deployed to any Java Application Server. It has been tested under Tomcat 7.x. It can be installed using the source code or as a binary package.

Requirements

Hardware: - standard workstation (Dual-Core or similar) - 1GB main memory - about 100MB hard disk

Software: - Java JDK 6 or higher - Java Application Server compatible with Servlet 3.0 (Tomcat 7.x) - Database (PostgreSQL, MySQL - if not explicitly configured, an embedded H2 database will be used)

Installation (Standalone)

The most straightforward way of installing the LMF is to use the standalone installer, which will automatically install and configure all core components of the LMF including a version of Apache Tomcat for running the web application.

To install the standalone version, download the lmf-installer-....jar files from the downloads section and execute the jar file (double click or java -jar command).

IMPORTANT: The installation path on windows systems may not contain whitespaces (e.g. 'C:/Program Files' is not usable). This is a serious bug of Tomcat application server and will most probably be fixed in further versions.

Depending on the underlying operating system, the installer will also create shortcuts for starting/stopping the LMF server: - on Windows, these can be found in the Start Menu under "Salzburg NewMediaLab -> Linked Media Framework" - on Linux, these are created on the desktop and also in the Applications menu under "Linked Media Framework" - on MacOS, there are two actions "Start Linked Media Framework" and "Shutdown Linked Media Framework" in the program folder of the LMF installation

After installation, you can access the administration interface of the Linked Media Framework by pointing your browser to http://{your_host_name}:8080/LMF or by clicking on the LMF systray icon and selecting "Administration" from the menu.

Installation (Binary)

The binary installation comes as a Java Web Archive (.war) file that can be deployed in any application server. The deployment procedure is as follows:

  1. Download and install the application server (Tomcat 7.0.x or Jetty 6.x) and the database you intend to use (optional, default is H2 embedded)
  2. Copy the .war file into the application server's deployment directory (Tomcat and Jetty: the webapps subdirectory)
  3. In the console where you will start the application server, set the environment variable LMF_HOME to the directory that will be used for storing the persistent runtime data of the Linked Media Server
  4. Startup the application server and go to the deployment URL with a web browser (e.g. http://localhost:8080). The Linked Media Server will then carry out initial setup using the embedded H2 database. The default interface will also contain links to the admin area and API documentation of the Linked Media Server.
  5. (OPTIONAL) If you do not want to use H2, go to the admin interface and configure the database according to your own preferences. It is recommended that you restart the application server when you have done so.

To avoid setting the environment variable LMF_HOME every time you open a new terminal, you can also enter it persistently by adding the following lines to catalina.sh (Unix):

export LMF_HOME=<PATH-TO-HOME>
export JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"

The latter option will give more memory to the Linked Media Server. You can even increase the value of 1024 to something higher as needed.

Specific Settings for Tomcat

In production environments, Apache Tomcat will be the application server of choice. This is a collection of issues arising with Tomcat installations.

Tomcat Versions

Tomcat 6.0.x used to be significantly faster and reliable, but that is not true anymore. So we strongly recommend to use Tomcat 7.0.x, precisely we recommend to use Tomcat 7.0.35 to work with the LMF.

Multiple LMF Instances

In some settings it might be desirable to set up multiple instances of the LMF in the same application server installation under different context URLs. This can be achieved by creating context definition files under

conf/Catalina/localhost/<appname>.xml

where <appname>.xml is a context configuration file. <appname> is the name of the web application, e.g. "LMF" or "MyApp". The file will contain a configuration similar to the following:

<Context docBase="/data/LMF/build/libs/LMF-2.0rc5-SNAPSHOT.war" unpackWAR="false" useNaming="true">
  <Parameter name="kiwi.home" value="/data/instances/lmf" override="false"/>

  <Resource name="BeanManager" auth="Container"
            type="javax.enterprise.inject.spi.BeanManager"
            factory="org.jboss.weld.resources.ManagerObjectFactory"
            />
</Context>
  • The docBase attribute specifies the location of the WAR file of the LMF in case it is not located in the webapps directory.
  • The value of the parameter kiwi.home provides the location of the LMF home directory (for historical reasons called kiwi.home)
  • The Resource registers a factory for creating the Java EE 6 Bean Manager. This entry will typically remain unchanged, but it is necessary for the system to work properly.

Specific Settings for Jetty

The Linked Media Framework uses JNDI for looking up services. While most application servers have this enabled by default, Jetty needs a little bit of setup to enable JNDI functionality. The procedure is described in the Jetty Documentation.

In short, what you need to do is to copy the plus-settings from the jetty-plus.xml file to the jetty.xml file:

  <Array id="plusConfig" type="java.lang.String">
    <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
    <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
    <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>   
    <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
    <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
  </Array>

and then add the option

<Set name="configurationClasses"><Ref id="plusConfig"/></Set>

to the call of org.mortbay.jetty.deployer.WebAppDeployer (search jetty.xml for it).

Installation (Maven)

It is easy to build custom projects based on the LMF using a Maven archetype. To create a custom project, simply run the following command and enter the base information when prompted:

mvn archetype:generate -DarchetypeArtifactId=lmf-archetype-webapp 
    -DarchetypeGroupId=at.newmedialab.lmf -DarchetypeVersion=2.6.0 
    -DarchetypeRepository=http://devel.kiwi-project.eu:8080/nexus/content/repositories/releases/

Afterwards, change to the newly created project directory and run:

mvn clean tomcat7:run

To start an empty LMF installation.

Installation (Source)

The LMF Source Code can be obtained from the Code Repository at Bitbucket.

Additional Requirements: - Git (https://git-scm.com/) - Maven 3.x (http://maven.apache.org) - JDK 7.x

Installation steps: 1. Clone the repository 1. Install the maven plugins: cd maven-plugins && mvn clean install && cd .. 1. Install LMF in your local Maven repository: mvn clean install 1. Run "mvn tomcat7:run" to start the LMF in Tomcat 7

Maybe you could find also useful these [[Development Tricks|development tricks]].

Updated