IIP Image Server

Submitted by rnsrk on Wed, 10/20/2021 - 11:54

The IIP Image Server takes care of the distribution and processing of image pyramids. We use it as a FastCGI module together with Apache Server.

Installation

We hardly recommend to install the IIP Server on a Linux system or use an existing server at your institutional or operational environment. Installation options for Windows and MacOS are no picnic.

If you're using WissKI inside the virtual Lubuntu image, or installed WissKI with the IIP-Image option via the default server setup you already have IIP Image Server and all dependencies installed and you can skip these part.

Ubuntu - simple solution

This may install an outdatet version, and you have to alias the folder /fcg-bin/, so if you like to have the latest IIP server or using multiple fcgi-scripts, you need to build it from source.

To install the IIP Image server, get it from the repos and restart the Apache server with

sudo apt update && sudo apt install iipimage-server -y

Open /etc/apache2/mods-available/iipsrv.conf and change the ScriptAlias and Location to /fcgi-bin/.

# Create a directory for the iipsrv binary
ScriptAlias /fcgi-bin/ "/usr/lib/iipimage-server/"

# Set the options on that directory
<Location "/fcgi-bin/">
   AllowOverride None
   Options None
   <IfModule mod_version.c>
     <IfVersion < 2.4>
       Order allow,deny
       Allow from all
     </IfVersion>
     <IfVersion >= 2.4>
       Require all granted
     </IfVersion>
   </IfModule>

   # Set the module handler
   AddHandler fcgid-script .fcgi
</Location>

# Set our environment variables for the IIP server
FcgidInitialEnv VERBOSITY "1"
FcgidInitialEnv LOGFILE "/var/log/iipsrv.log"
FcgidInitialEnv MAX_IMAGE_CACHE_SIZE "10"
FcgidInitialEnv JPEG_QUALITY "90"
FcgidInitialEnv MAX_CVT "5000"
FcgidInitialEnv MEMCACHED_SERVERS "localhost"

# Define the idle timeout as unlimited and the number of
# processes we want
FcgidIdleTimeout 0
FcgidMaxProcessesPerClass 1

Restart the Apache Server with

sudo systemctl restart apache2

Visit your browser at localhost/fcgi-bin/iipsrv.fcgi you should see the IIP Image Server page.

Example Screencast

Linux - Advanced solution: build from source

Install build dependencies

sudo apt update
sudo apt-get install \
                    autoconf \
                    automake \
                    git \
                    libapache2-mod-fcgid \
                    libfreetype6-dev \
                    libjpeg-dev \
                    libopenjp2-7 \
                    libopenjp2-7-dev \
                    libpng-dev \
                    libpng16-16 \
                    libpq-dev \
                    libtiff-dev \
                    libtiff5 \
                    libtool \
                    libmemcached11 \
                    libmemcached-dev \
                    imagemagick \
                    pkg-config -y

Create build environment and change inside

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 
WORK_DIR=`mktemp -d -p "$DIR"` 
cd ${WORK_DIR} 

Build iipsrv.fcgi

git clone https://github.com/ruven/iipsrv.git && \
                cd iipsrv && \
                sudo ./autogen.sh && \
                sudo ./configure && \
                sudo make

Copy iipsrv.fcgi at the right place and restart the Apache server

sudo mkdir -p /fcgi-bin
sudo cp src/iipsrv.fcgi /fcgi-bin/iipsrv.fcgi
cd ${DIR}

Alter the content of /etc/apache2/mods-available/fcgid.conf to contain the following codesnipped (be sure not to overwrite rules specific to your system)

<IfModule mod_fcgid.c>
   ScriptAlias /fcgi-bin/ "/fcgi-bin/"

   <Location "/fcgi-bin/">
      AllowOverride None
      Options None
      Require all granted
      <IfModule mod_mime.c>
         AddHandler fcgid-script .fcgi
      </IfModule>
   </Location>

   # Set our environment variables for the IIP server
   FcgidInitialEnv VERBOSITY "1"
   FcgidInitialEnv LOGFILE "/var/log/iipsrv.log"
   FcgidInitialEnv MAX_IMAGE_CACHE_SIZE "10"
   FcgidInitialEnv JPEG_QUALITY "90"
   FcgidInitialEnv MAX_CVT "5000"
   FcgidInitialEnv MEMCACHED_SERVERS "localhost"

   # Define the idle timeout as unlimited and the number of
   # processes we want
   FcgidConnectTimeout 20
   FcgidIdleTimeout 0
   FcgidMaxProcessesPerClass 1
</IfModule>

Restart the Apache server by

sudo systemctl restart apache2

Check if the server is running at http:/localhost/fcgi-bin/iipsrv.fcgi http:// website-name ... is your (future) registered second level domain without http://www. like wisski.com - even If you are working on a local machine and want to migrate to a server later. /fcgi-bin/iipsrv.fcgi.

The path (respectively the alias or link) to the IIP Image Server script must be /fcgi-bin/iipsrv.fcgi if you are using WissKI IIP Image View or WissKI Mirador Integration; so the first part of the ScriptAlias-variable must be /fcgi-bin/!

Screencast example

Windows

Try the steps here and here.

MacOS

You may be able to abstract the steps for ubuntu, but you can also find help here.

Was this reply helpful?
0
0
1 votes with an average rating of 0.

Need help?