Skip to content

Instantly share code, notes, and snippets.

@netsensei
Created May 12, 2018 15:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netsensei/01bc664ccdd85ed620fdb1e65357ff9f to your computer and use it in GitHub Desktop.
Save netsensei/01bc664ccdd85ed620fdb1e65357ff9f to your computer and use it in GitHub Desktop.
Installing the Loris IIIF server

Python 2.7.9

sudo apt-get install build-essential sudo apt-get install zlib1g-dev libssl-dev python-dev

sudo apt-get install python-pip sudo pip install --upgrade pip sudo pip install virtualenv

cd /opt sudo curl -LO https://github.com/loris-imageserver/loris/archive/v2.3.2.tar.gz sudo mv loris-2.3.2 loris cd /opt/loris

sudo virtualenv env . env/bin/activate

Workzeug

sudo pip install Werkzeug

Pillow

libjpeg-turbo8-dev should be libjpeg62-turbo-dev

sudo apt-get install libjpeg62-turbo-dev libfreetype6-dev zlib1g-dev
liblcms2-dev liblcms2-utils libtiff5-dev python-dev libwebp-dev apache2
libapache2-mod-wsgi

sudo pip uninstall Pillow

adduser loris

sudo python setup.py install

Here be errors

Error 1: Package libffi was not found in the pkg-config search path. fatal error: ffi.h: No such file or directory

Solution: sudo apt-get install libffi-dev

Error 2:

Setup script exited with error in cryptography setup command: Invalid environment marker: python_version < '3'

Solution:

pip install cffi sudo pip install --upgrade setuptools

Installs setuptools 5.5.1

Error 3:

ImportError: No module named configobj

Solution:

sudo pip install configobj

Will say it is already installed. But now setup.py will work. Oddly enough.

finalise setup

virtualenv in wsgi: sudo nano /var/www/loris2/loris2.wsgi

Add this line and save: site.addsitedir('/opt/loris/env/local/lib/python2.7/site-packages')

sudo nano /etc/apache2/sites-available/000-default.conf

ExpiresActive On ExpiresDefault "access plus 5184000 seconds"

AllowEncodedSlashes On

WSGIDaemonProcess loris2 user=loris group=loris processes=10 threads=15 maximum-requests=10000 WSGIScriptAlias /loris /var/www/loris2/loris2.wsgi WSGIProcessGroup loris2

sudo a2enmod wsgi sudo a2enmod headers expires

navigate to http://server/loris => You'll get an "Internal server error"

Error in /var/log/apache2/error.log:

File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 105, in SSL_ST_INIT = lib.SSL_ST_INIT AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

Solution:

sudo pip install --upgrade pyOpenSSL

reinstalls both cryptography 2.1.4 and pyOpenSSL 0.14

=> Now everything should work correctly when navigating to http://servername/loris. You should see:

This is Loris, an image server that implements the IIIF Image API Level 2. See http://iiif.io/api/image/2.0/ for details and https://github.com/loris-imageserver/loris for the source code and implementation details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment