Alpine Linux

The IIPImage server, iipsrv, is now available as an Alpine Linux package. Alpine Linux is a security-oriented, lightweight Linux distribution that is designed to be small, simple, and secure and thanks to its small footprint is widely used for virtual machines and container environments, such as Docker.

The iipsrv package provides a fully featured build and is part of Alpine’s default distribution. The package can be installed using Alpine’s standard package manager, apk

apk add iipsrv

Runtime settings for iipsrv can be configured via the configuration file in /etc/conf.d/iipsrv. The default settings provide a production-ready environment with support for all of iipsrv’s available API’s including a pre-configured IIIF version 3 API end-point at the URL /iiif/. The iipsrv log file can be found by default in /var/log/iipsrv/iipsrv.log.

The iipsrv service can be started and stopped using the standard OpenRC init system:

/etc/init.d/iipsrv start

This starts an instance of iipsrv listening for FCGI requests on port 9000. You will need to configure your front-end web server to proxy FCGI requests to this port. Alternatively, if you wish to use Apache or Lighttpd directly within your instance of Alpine Linux in order to create a full HTTP-ready service, configuration files for these web servers are provided through the iipsrv-apache and iipsrv-lighttpd sub-packages. For example to install the iipsrv apache configuration files and necessary modules:

apk add iipsrv-apache

You will then need to start Apache or Lighttpd to enable standard HTTP port 80 web access to the iipsrv end-points at the URLs /fcgi-bin/iipsrv.fcgi and /iiif/

For Nginx, you will need to install the nginx package, then manually modify the /etc/nginx/http.d/default.conf default virtual host to add the following location:

location /fcgi-bin/iipsrv.fcgi {
	fastcgi_pass 	localhost:9000;
	fastcgi_param   PATH_INFO $fastcgi_script_name;
        fastcgi_param   REQUEST_METHOD $request_method;
        fastcgi_param   QUERY_STRING $query_string;
        fastcgi_param   CONTENT_TYPE $content_type;
        fastcgi_param   CONTENT_LENGTH $content_length;
        fastcgi_param   SERVER_PROTOCOL $server_protocol;
        fastcgi_param   REQUEST_URI $request_uri;
        fastcgi_param   HTTPS $https if_not_empty;
}

iipsrv’s man page can optionally be installed via the sub-package iipsrv-doc:

apk add iipsrv-doc

Docker

The official IIPImage Docker Hub image is based on the iipsrv Alpine Linux package and provides a fully featured, yet very compact Docker image of a mere 12MB in size. To pull the latest image:

docker pull iipsrv/iipsrv

and to run the image:

docker run -it -p 9000:9000 -p 80:80 -v /home/images/:/images iipsrv/iipsrv

This will bind port 9000 on your host machine directly to the iipsrv FCGI listening port and port 80 on the host to the container’s web server. iipsrv end-points will then be available at http://host/fcgi-bin/iipsrv.fcgi for IIP requests and and http://host/iiif for IIIF requests.

See the Docker Hub README for full details.