Marmotta is implemented as a Java Web Application that can in principle be deployed to any Java Application Server. It has been tested under Jetty 6.x and Tomcat 6.x/7.x. It can be installed using the source code or as a binary package.

The most straightforward way of installing Marmotta 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 marmotta-installer-X.Y-standalone.jar file 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 "Apache -> Marmotta" * on Linux, these are created on the desktop and also in the Applications menu under "Marmotta" * on MacOS, there are two actions "Start Marmotta" and "Shutdown Marmotta" in the installation folder

After installation, you can access the administration interface of Marmotta by pointing your browser to `http://{your_host_name}:8080/marmotta` or by clicking on the Marmotta 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:

# Download and install the application server (Tomcat 6.0.x or Jetty 6.x) and the database you intend to use (optional, default is H2 embedded) # Copy the .war file into the application server's deployment directory (Tomcat and Jetty: the webapps subdirectory) # 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 # 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. # (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 opena new terminal, you can also enter it persistently by adding the following lines to catalina.sh (Unix):

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 ===

Believe it or not, but Tomcat can also have bugs. We recommend to use *Tomcat 6.0.33* to work with the LMF, because it is the fastest and currently most reliable version: * Tomcat 6.0.32 or lower contains a serious bug that does not allow to set context parameters * Tomcat 7.x is significantly slower and not as reliable when using CDI/Weld

=== 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. "Marmotta" or "MyApp". The file will contain a configuration similar to the following:

* 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 ==

Marmotta 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 [http://docs.codehaus.org/display/JETTY/JNDI 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: