Old Release

This documentation covers an old version of Fedora. Looking for another version? See all documentation.


What backend configuration should I use?

Best Practice 1

For production use, we recommend a MySQL or PostgreSQL backend. For development, testing and trial a simple file backend is adequate.


Is there advice on best practices for customizing Fedora 4 configuration files?

Best Practice 1

One recommended practice is to store modified configuration files outside of the unpacked war file.

 This is an example of production Fedora JAVA_OPTS:

JAVA_OPTS="-Dfile.encoding=UTF-8 \
  -Dfcrepo.home=/mnt/data/fcrepo \
  -Dfcrepo.spring.configuration=file:/etc/fcrepo/fcrepo-config.xml \
  -Dfcrepo.modeshape.configuration=file:/etc/fcrepo/repository.json \
  -Dfcrepo.activemq.configuration=file:/etc/fcrepo/activemq.xml \
  -Dfcrepo.auth.webac.authorization=/etc/fcrepo/root-authentication.ttl \
  -Dfcrepo.spring.audit.configuration=file:/etc/fcrepo/audit.xml \
  -Dlogback.configurationFile=/etc/fcrepo/logback.xml \
  -Dfcrepo.modeshape.index.directory=modeshape.index \
  -Dfcrepo.binary.directory=binary.store \
  -Dfcrepo.activemq.directory=activemq \
  -Dcom.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.default.objectStoreDir=arjuna.common.object.store \
  -Dcom.arjuna.ats.arjuna.objectstore.objectStoreDir=arjuna.object.store \
  -Dnet.sf.ehcache.skipUpdateCheck=true \
  -Dfcrepo.audit.container=/audit \
  # GC Configuration
  -XX:+UseConcMarkSweepGC \ 	# for smaller (< 4 GB) heaps
  -XX:+CMSClassUnloadingEnabled \ # for use with UseConcMarkSweepGC
  -XX:+UseG1GC \ 				# for larger (> 4 GB) heaps
  -XX:ConcGCThreads=5 \
  -XX:ParallelGCThreads=20 \
  # Memory usage
  -XX:MaxMetaspaceSize=512M \
  -Xms1024m \ 					# minimum heap size
  -Xmx2048m"					# maximum heap size

You will see that all of the configuration files are stored outside of the unpacked war file. In this case, that is /etc/fcrepo, but it could be any place that makes sense for your system.

All of these configuration files may be customized, and by placing them in an administrator-controlled directory, any local changes are not overwritten when re-deploying a war file.

At a minimum, it is recommended that production deployments of Fedora store at least the following configuration files separately, and if you customize these at all, you should absolutely do this:

* fcrepo-config.xml (this is the central config for dependency-injected Fedora Spring beans)
* repository.json (this is the central config for Modeshape, and you should control that)
* activemq.xml (common update: turn the topic into a queue)
* root-authentication.ttl (if you are using webac)
* logback.xml (common update: direct logging to /var/log/fcrepo/fcrepo.log rather than catalina.out)


How do I configure logging output?

Best practice 1

Logging can be configured with a logback.xml file. For example, if you would like output to go to /var/log/fcrepo/fcrepo.log while rotating that log when it exceeds 20MB, this would be a possible configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>
  <property name="FCREPO_LOG_PATH" value="/var/log/fcrepo/fcrepo${logfile.extension:-.log}"/>
  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <pattern>%d{dd-MMM HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern>

    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">

    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
  <logger name="org.fcrepo.auth" additivity="false" level="${log.fcrepo.auth:-null}">
    <appender-ref ref="FILE"/>

  <logger name="org.fcrepo.http.api" additivity="false" level="${log.fcrepo.http.api:-null}">
    <appender-ref ref="FILE"/>

  <logger name="org.fcrepo.http.commons" additivity="false" level="${log.fcrepo.http.commons:-null}">
    <appender-ref ref="FILE"/>

  <logger name="org.fcrepo.jms" additivity="false" level="${log.fcrepo.jms:-null}">
    <appender-ref ref="FILE"/>

  <logger name="org.fcrepo.kernel" additivity="false" level="${log.fcrepo.kernel:-null}">
    <appender-ref ref="FILE"/>

  <logger name="org.fcrepo" additivity="false" level="${log.fcrepo:-INFO}">
    <appender-ref ref="FILE"/>

  <logger name="org.apache.activemq" additivity="false" level="WARN">
    <appender-ref ref="FILE"/>
  <root additivity="false" level="WARN">
    <appender-ref ref="FILE"/>

If you customize this file, you should store it outside of the unpacked fcrepo.war directory by adding this to your JAVA_OPTS: "-Dlogback.configurationFile=/etc/fcrepo/logback.xml". Otherwise, when the application is re-deployed, your customizations will be lost.

  • No labels