Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Application Configuration

The Fedora web-application supports several deploy-time, system-level configuration options. These configuration elements are set via the definition of System Properties.

Note

See: Best Practices - Fedora Configuration

Deployments

Four means of deploying Fedora have been verified

  • Tomcat 9 servlet container
  • Jetty 9 servlet container
  • Maven jetty:run plugin - for testing
  • One-Click Run - for testing

Each of these deployment approaches has its own way of setting System Properties.

Anchor
tomcat
tomcat
Tomcat 9

On Debian Linux systems, the typical way of setting System Properties is to update the following file:

No Format
/etc/default/tomcat9

Within that file, new properties can be added per the example below:

Code Block
JAVA_OPTS="${JAVA_OPTS} -Dfcrepo.home=/mnt/fedora-data"


Additional information regarding the configuration of System Properties in Tomcat 9 can be found here.

Windows notes

Alternatively on Windows systems you can set the following file:

No Format
CATALINA_BASE/bin/setenv.bat (windows)

Within that file, new properties can be added per the example below:

Code Block
set CATALINA_OPTS=%CATALINA_OPTS% -Dfcrepo.home=/mnt/fedora-data

Anchor
jetty
jetty
Jetty 9

On Debian Linux systems, one way of setting System Properties is to update the following file:

No Format
/etc/default/jetty

Within that file, new properties can be added per the example below (note the use of JAVA_OPTIONS instead of JAVA_OPTS):

Code Block
JAVA_OPTIONS="${JAVA_OPTIONS} -Dfcrepo.home=/mnt/fedora-data"

Additional information regarding the configuration of System Properties in Jetty 9 can be found here.

Windows notes

Alternatively on Windows systems you can set the following file:

No Format
{JETTY_DIST}/start.ini

Within that file, new properties can be added per the example below:

Code Block
--exec
-Dfcrepo.home=/mnt/fedora-data
Maven jetty:run

System Properties can be set when using the Maven jetty:run plugin by passing them per the example below:

Code Block
mvn -Dfcrepo.home=/mnt/fedora-data jetty:run

One-Click Run

One option is to use the "one click" application, which comes with an embedded Jetty servlet. This can be optionally built by running:

Code Block
mvn install -pl fcrepo-webapp -P one-click


and can be started by either double-clicking on the jar file or by running the following command:

Code Block
java -jar ./fcrepo-webapp/target/fcrepo-webapp-<version>-jetty-console.jar


By default, a Fedora home directory, fcrepo, is created in the current directory. You can change the default location by passing in an argument when starting the one-click, e.g.:

Code Block
java -Dfcrepo.home=/data/fedora-home -jar fcrepo-webapp-6.0.0-SNAPSHOT-jetty-console.jar

Anchor
configelements
configelements
Configuration Elements

There are a number of configuration elements that can be optionally be set when starting the Fedora web-application, noted below within brackets: <>. The only configuration element that is required to be set is "fcrepo.modeshape.configuration".

No Format
fcrepo.home=<cwd/fcrepo4-data>

This can be set to a path (relative to the current working directory or absolute) to which Fedora repository content will be written.  Any of the Modeshape configuration options below will default to being within this folder if unset or if set to a relative path.  If unset, content will be put in the "fcrepo4-data" directory within the current working directory.

No Format
fcrepo.spring.configuration=<classpath:/config/spring/fcrepo-config.xml | file:/path/to/fcrepo-config.xml>

This specifies the location of the spring context configuration for the Fedora application it defaults to a provided configuration. For more configuration options review the fcrepo-webapp-plus supplied spring configuration.

No Format
java.io.tmpdir=</tmp on Linux, $TMPDIR on MacOSX, and %TEMP% on Windows>

This specifies the directory for writing temp files.  You may need to set this property to a larger disk/filesystem to upload large files, particularly on Linux where /tmp is sometimes on a small partition.

No Format
fcrepo.jms.baseUrl=<http://localhost:8080/fcrepo/rest>

This specifies the baseUrl to use when generating JMS messages. You can specify the hostname with or without port and with or without path. If your system is behind a NAT firewall you may need this to avoid your message consumers trying to access the system on an invalid port. If this system property is not set, the host, port and context from the user's request will be used in the emitted JMS messages.

Note: If you have multiple instances of Fedora running, the following system properties must be set to avoid messaging port conflicts:

No Format
fcrepo.dynamic.jms.port=<default-of-61616>
fcrepo.dynamic.stomp.port=<default-of-61613>

This specifies the ports used by the embedded JMS-based message broker, both for OpenWire and STOMP protocols.

No Format
fcrepo.velocity.runtime.log=<$fcrepo.home/velocity.log>

The HTML template code uses Apache Velocity, which generates a runtime log called velocity.log. By default this is placed inside fcrepo.home, but it is possible to override the location to have it written to an alternate location.

No Format
fcrepo.external.content.allowed=</path/to/allowed.txt>

This provides the path to a file defining a list of allowed external binary content paths. If this parameter is not provided, then clients will be disallowed from creating external binary resources. See the external content allowed paths configuration for more details.

No Format
-Dfcrepo.autoversioning.enabled=false

This results in every change to Fedora resources being persisted in the OCFL "mutable-head" extension, as opposed in a new OCFL version. (default is "true")

No Format
    <!-- Containment Index DB -->
    <bean id="containmentIndexDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName" value="org.h2.Driver" />
      <property name="url" value="jdbc:h2:mem:index" />
    </bean>

Within Fedora's fcrepo-config.xml file, the value of "url" can be changed to support a wide range of connection modes and connection settings. Reference

No Format
-Dfcrepo.session.timeout=<milliseconds>

This sets the duration for which a transaction will stay active before auto-rolling back. Defaults to 180000 ms, or 3 minutes

No Format
-Dfcrepo.persistence.defaultDigestAlgorithm=[sha512|sha256]

This sets the default digest algorithm on ingested binary resources (default: sha512)

Anchor
ocfl
ocfl
OCFL

The OCFL persistence configurations mentioned above have a number of more detailed configuration elements that can optionally be set.

Some common elements relate to the directories in which application information is persisted. As mentioned above, if no fcrepo.home property is set then application information will be persisted in the current working directory under the directory "fcrepo/". There will then be several directories within "fcrepo/":

No Format
fcrepo/data/staging
fcrepo/data/ocfl-root
fcrepo/data/ocfl-temp

To set the location of the fcrepo.home directory ("fcrepo/"), use the following system property:

No Format
-Dfcrepo.home=<some_directory>

For a more granular approach, the three directories within fcrepo.home can individually be set with their respective properties:

No Format
-Dfcrepo.ocfl.staging=<some_staging_directory>
-Dfcrepo.ocfl.root=<some_root_directory>
-Dfcrepo.ocfl.temp=<some_temp_directory>



No Format
fcrepo.activemq.directory

Contains the reliable messaging information maintained by ActiveMQ.


Configuration Chain

The standard configuration chain is as follows:

  1. fcrepo/fcrepo-webapp/src/main/webapp/WEB-INF/web.xml contains a context-param element with param-name "contextConfigLocation".  The param-value points to a repository.xml which includes either the default fcrepo-config.xml or your spring configuration file (as defined by the fcrepo.spring.configuration property.
  2. Your spring configuration file contains a property repositoryConfiguration defining the location of your repository.json