Application Configuration
The Fedora 5 web-application supports several deploy-time, system-level configuration options. These configuration elements are set via the definition of System Properties.
...
Deployments
Four means of deploying Fedora 5 have Fedora have been verified
- Tomcat 7 8 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 | ||||
---|---|---|---|---|
|
...
8
On Debian Linux systems, the typical way of setting System Properties is to update the following file:
No Format |
---|
/etc/default/tomcat7tomcat8 |
Within that file, new properties can be added per the example below:
Code Block |
---|
JAVA_OPTS="${JAVA_OPTS} -Dfcrepo.modeshape.configuration=classpath:/config/file-simple/repository.json -Dfcrepo.home=/mnt/fedora-data" |
Warning |
---|
The |
Additional information regarding the configuration of System Properties in Tomcat 7 8 can be found here.
Windows notes
Alternatively on Windows systems you can set the following file:
...
Code Block |
---|
set CATALINA_OPTS=%CATALINA_OPTS% -Dfcrepo.modeshape.configuration=classpath:/config/file-simple/repository.json |
Reverse Proxy
If you have a reverse proxy for serving HTTPS that uses Tomcat's HTTP port, you will also need to set up a RemoteIPValve in your server.xml in order for Tomcat to rewrite links with HTTPS.
To do this you will first need to make sure the X-Forwarded-Proto header is set in your server config (example with Apache):
No Format |
---|
<VirtualHost *:443>
RequestHeader set X-Forwarded-Proto "https"
ServerName dummy-host.example.com
SSLEngine on
SSLCertificateFile /etc/ssl/certs/localhost.crt
SSLCertificateKeyFile /etc/ssl/private/localhost.key
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
DocumentRoot "/opt/fedora/apache-tomcat-8.5.66/webapps/fcrepo-webapp"
</VirtualHost>
|
Then you will need to add a Valve to the localhost Engine in Tomcat's server.xml:
No Format |
---|
<Valve className="org.apache.catalina.valves.RemoteIpValve"
protocolHeader="x-forwarded-proto" /> |
Anchor | ||||
---|---|---|---|---|
|
On Debian Linux systems, one way of setting System Properties is to update the following file:
...
There are a number of configuration elements that can be optionally be set when starting the Fedora 5 webFedora 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/fcrepo5fcrepo4-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 "fcrepo5fcrepo4-data" directory within the current working directory.
...
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.
Anchor | ||||
---|---|---|---|---|
|
...
Some common elements for Modeshape 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 under the directory "fcrepo5fcrepo4-data" in the application's current working directory. There will then be several directories within "fcrepo5fcrepo4-data" that are named by default with the name of the property that can be set to configure each of those directories.
...
Contains the internal Lucene index used by Modeshape/Admin Search.
No Format |
---|
fcrepo.activemq.directory |
Contains the reliable messaging information maintained by ActiveMQ.
No Format |
---|
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.default.objectStoreDir com.arjuna.ats.arjuna.objectstore.objectStoreDir |
...
The standard configuration chain is as follows:
- fcrepo5fcrepo/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 thefcrepo.spring.configuration
property. - Your spring configuration file contains a property repositoryConfiguration defining the location of your repository.json
- fedora-node-types.cnd is defined in repository.json