Fedora Deployment

The Fedora (Flexible Extensible Digital Object Repository Architecture) Repository project page describes Fedora as:

Fedora is a robust, modular, open source repository system for the management and dissemination of digital content. It is especially suited for digital libraries and archives, both for access and preservation. It is also used to provide specialized access to very large and complex digital collections of historic and cultural materials as well as scientific data. Fedora has a worldwide installed user base that includes academic and cultural heritage organizations, universities, research institutions, university libraries, national libraries, and government agencies. 

The latest stable release of Fedora is v4.5.1, and it is the version we will be using for the CLACI project. For more information on Fedora, see this page.

Technical requirements for installing and running Fedora

The official Fedora documentation lists the following requirements that must be met for a successful installation:

  • Java (runtime) 8 or better
  • a Servlet 3.0 container such as Tomcat 7, or Jetty 9.x

For Java we have two options – Oracle Java, or OpenJDK/JRE. But given that the server (Javelin) runs Ubuntu 14.04LTS, OpenJDK 8 repository is not configured for by default.

For the Servlet 3.0 container requirement, we would be using Jetty 9.x. We chose Jetty over Tomcat as an initial web search indicated that Jetty is lighter weight, and faster than some of the alternatives like Apache Tomcat, GlassFish, and Resin.

Open JDK 8 JRE configuration

Since Ubuntu 14.04LTS does not ship with the correct repository configured for Open JDK 8, we needed to manually add a repository. The following were the steps involved:

  • sudo add-apt-repository ppa:openjdk-r/ppa
  • sudo apt-get update 
  • sudo apt-get install openjdk-8-jre

Jetty 9 installation

At the time this post was written, Jetty 9.3.9 was the latest stable release and therefore our default choice. But before we move ahead, it is important to talk about what Jetty is.

Jetty is described on Eclipse.org as follows:

The Jetty Web Server provides an HTTP server and Servlet container capable of serving static and dynamic content either from a standalone or embedded instantiations.

Basically, Jetty is a server program that serves Java-based web pages and web applications (for example, .jsp, .jar, and .war files).

How Java and Jetty fit into the picture with Nginx

Fedora is essentially a Java-based web application shipped as a single .war file. So the Java Runtime Environment (JRE) is the most important component needed on the server so that it can compile and run Fedora. Then comes Jetty – it does the job of serving out the web application to the external world when requested to. While Jetty is in itself capable of acting like a standalone server process, but it is limited to serving Java-based web applications only. For example, it cannot, and is not designed to, run or serve PHP applications.

This is where Nginx comes into the picture. Since Nginx is a 'general purpose' web server (pretty much like the Apache http server), it is a much better option when our server (in this case server refers to the physical machine called Javelin) is running multiple applications written in different languages. What is most commonly done is that a general purpose web server like Nginx is used as a 'proxy' to a more specific web server.

In this case though we will configure Jetty to run on a forwarded port, i.e. a port which is allowed to receive incoming connections. This enables external HTTP requests to be served directly by Jetty, rather than having to come through Nginx.

Configuring and Running Fedora

Current URL and Port for access

As of June 17, 2016, a temporary, out-of-the-box installation of Fedora 4.5.1 is accessible at http://javelin.ischool.utexas.edu:8080/fedora

For reasons of simplicity, we have configured Jetty to listen on its default port 8080.

Important OS paths

For the above-mentioned temporary installation, the following are the most important paths.

PathDescription 
/opt/jettyThis is the path where all the Jetty binary files, Java class libraries, modules, and demo projects/webapps are kept 
/etc/jettyThis is the path where the Fedora webapp is kept (inside the webapps subdirectory)

 

Installing Fedora 4.5.1

Installing Fedora is as simple as downloading it from https://github.com/fcrepo4/fcrepo4/releases/download/fcrepo-4.5.1/fcrepo-webapp-4.5.1.war and copying it to /etc/jetty/webapps. The way Jetty handles URIs for webapps requires the user to type the URL as http://<server name>:<port number>/<name of webapp>. Therefore, for the temporary installation, the 4.5.1 war file has been renamed as fedora.war.

Running Fedora

As long as fedora.war is present in /etc/jetty/webapps/, the only thing that needs to be done is starting Jetty. That needs to be done with the following commands:

cd /etc/jetty
java -jar /opt/jetty/start.jar&

Output of the following form should appear as a result:

Once this is done, you can check that the installation is working by visiting http://javelin.ischool.utexas.edu:8080/fedora, which should display as follows:

Â