We have been using the Djatoka image server for years in the BDR. However, we are currently in the process of switching to the Loris image server. Loris is a IIIF-compliant image server, and its development is led by Jon Stroop at Princeton. Loris is written in Python, and it uses the WSGI standard (like Django and other Python web frameworks).
Loris comes with a setup.py file for installing, but I’ve developed some scripts that can help with installing Loris on RHEL/CentOS 7. There are three main things that need to happen for Loris to work: setting up the Python environment, creating the configuration files and directories that Loris is looking for, and configuring Loris as a WSGI application that can be served by Phusion Passenger or other application servers. If you run my “install_loris.sh” script (as root), it will set up loris for you and you’ll be able to immediately test it out. Then you can go to update the configuration and/or install an application server for production.
Python Environment
Loris is written in Python, so it requires certain Python packages to be installed, including requests and Pillow. The packages can be installed to the system Python site-packages, but in my scripts I set them up to install to a Python virtual environment. There are also some system Linux packages that need to be installed before the Python packages – these include image packages, gcc for compiling a Pillow extension, and others.
Filesystem Configuration
My script installed Loris to /opt/local/loris. Loris needs a configuration file, and I put that in /opt/local/loris/etc/loris2.conf; cache, tmp, and log directories go in /opt/local/loris as well. My script installs Kakadu (for JP2 images – make sure you have the appropriate license) to /opt/local/loris/bin and /opt/local/loris/lib, and configures the shared library dynamic linking to be able to load the Kakadu library from /opt/local/loris/lib.
WSGI application
I set up the loris WSGI app in /opt/local/loris/loris, where I copied the loris code. My script allows for two ways of running Loris – using a simple test server, and running a full application server.
If you just want to test the installation quickly, there’s a launcher.py file in /opt/local/loris/loris that uses Werkzeug’s run_simple command. To kick this off, just activate the python environment and run “python loris/launcher.py”.
For production environments, you can use an application server like Passenger. All you have to do is point the app server to the /opt/local/loris/loris and the passenger_wsgi.py file. I have a script called install_passenger.sh, and it installs the standalone version of passenger. After running that script, cd to /opt/local/loris/loris and run “passenger start”.


