CANTALOUPE IIIF ISSUE

Hi all,

ISSUE:

We have installed Cantaloupe for our Islandora 7.x build, however I am having issues with Internet Archive Bookreader and Openseadragon. When we open a book, we are not presented any images, nor are we able to view the individual pages.

ANALYSIS:

As you can see, our cantaloupe server appears to be running (we went with the “standalone” config) as we are able to see the cantaloupe welcome page when we visit http://localhost:8182 as well as the api page when we visit http://localhost:8182/iiif/2

Islandora > Islandora Viewers > Internet Archive BookReader shows where we could specify the url/path for cantaloupe. We have http://localhost:8182/iiif/2 at the moment. I have tried a few other variations. Unsure which to go with.

Islandora > Islandora Viewers > Openseadragon is also configured with url http://localhost:8182/iiif/2

My http.conf file is specified as follows:



ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost

<Directory />
    AllowOverride none
    Require all denied
</Directory>

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error_log"
LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
    LogFormat "%h %l %u %t "%r" %>s %b" common

    <IfModule logio_module>
      LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
    </IfModule>
    
    CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>

AddDefaultCharset UTF-8

<IfModule mime_magic_module>
    MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
IncludeOptional conf.d/*.conf

<VirtualHost *:80>
        
	ServerAdmin webmaster@localhost
	DocumentRoot "/var/www/html/islandora"
        ServerName www.ninedivines.club
        ServerAlias ninedivines.club
        ProxyRequests Off
        ProxyPreserveHost On

	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>

	<Directory "/var/www/html/islandora">
		Options FollowSymLinks MultiViews
		AllowOverride All
		Require all granted
		RewriteEngine on
		RewriteBase /
		RewriteCond %{REQUEST_FILENAME} !-f
		RewriteCond %{REQUEST_FILENAME} !-d
		RewriteRule ^(.*)$ index.php?q=local256=0COLORTERM0XTERM_VERSION0ROXTERM_ID0KONSOLE_DBUS_SESSION [L,QSA]
	</Directory>

        <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>

	RequestHeader set X-Forwarded-Path /	

        ProxyRequests off
	ProxyPass /iiif/2 http://localhost:8182/cantaloupe/iiif/2
	ProxyPassReverse /iiif/2 http://localhost:8182/cantaloupe/iiif/2
	ProxyPass /adore-djatoka http://localhost:8080/adore-djatoka
        ProxyPassReverse /adore-djatoka http://localhost:8080/adore-djatoka

</VirtualHost>

#Include /etc/httpd/conf/httpd-le-ssl.conf

http://localhost:8182/iiif/2/http%3A%2F%2Fninedivines.club%2Fislandora%2Fobject%2Fislandora%253A121%2Fdatastream%2FJP2%2Fview%3Ftoken%3D254dfc2d6f6bc6

… so it looks like the GET is going out as a call to localhost:8182/iiif/2 ….but with the unnecessary appendage of my servers FQDN (or maybe the first part is the redundant part, not sure yet.) Still looking. The cause is probably right here in front of me, just the lightbulb has not gone off over my head yet.

#############################

10APR2019:1333hrs

I have now removed the server url from the bookreader and openseadragon config pages (leaving only blank space in the form box)

Restarted server. Attempted to reproduce issue: issue persists.

Malformed URL’s now look like this:


http://ninedivines.club//http%3A%2F%2Fninedivines.club%2Fislandora%2Fobject%2Fislandora%253A121%2Fdatastream%2FJP2%2Fview%3Ftoken%3Dfbf0953d03b0a051d834fff49eab4d9f991684b691fd6187b56c99d4c5ad3e4d/info.json [HTTP/1.1 404 Not Found 5ms]

10APR2019:1407hrs

I have now commented out the proxy pass statements in the httpd.conf file.

# ProxyPass /iiif/2 http://localhost:8182/cantaloupe/iiif/2
# ProxyPassReverse /iiif/2 http://localhost:8182/cantaloupe/iiif/2

— restarted httpd.
Reproduced issue: Issue persists.

Malformed urls now look like this:


http://ninedivines.club//http%3A%2F%2Fninedivines.club%2Fislandora%2Fobject%2Fislandora%253A119%2Fdatastream%2FJP2%2Fview%3Ftoken%3D9efeda705b53b0863888158600f899369fde7df353454b22df729d8fbcc10ad5/full/pct:Infinity/0/default.jpg

–so not much apparent difference.

# Re-Installation of Cantaloupe (per Diego’s advice)


# delete any previously installed cantaloupe instances

wget https://github.com/medusa-project/cantaloupe/releases/download/v4.0.3/cantaloupe-4.0.3.zip
unzip cantaloupe-4.0.3.zip
sudo mv cantaloupe-4.0.3 /opt/

sudo mkdir /srv/cache /srv/log /srv/home
sudo useradd -d /srv/home -s /bin/false cantaloupe

sudo chown -R cantaloupe:cantaloupe /opt/cantaloupe-4.0.3

sudo cp /opt/cantaloupe-4.0.3/deps/Linux-x86-64/lib/libkdu_* /usr/lib/

cd /opt/cantaloupe-4.0.3
sudo cp cantaloupe.properties.sample cantaloupe.properties

sed -i "s|temp_pathname =.*$|temp_pathname = /srv/tmp|" cantaloupe.properties

sed -i "s|http.host = 0.0.0.0|http.host = 127.0.0.1|" cantaloupe.properties

sed -i "s|endpoint.admin.enabled = false|endpoint.admin.enabled = true|" cantaloupe.properties

sed -i "s|endpoint.admin.username =.*$|endpoint.admin.username = cantaloupeadminuser|" cantaloupe.properties

sed -i "s|endpoint.admin.secret =.*$|endpoint.admin.secret = SpartanBlueGold#2\!|" cantaloupe.properties 

sed -i "s|endpoint.api.enabled = false|endpoint.api.enabled = true|" cantaloupe.properties

sed -i "s|endpoint.api.username =.*$|endpoint.api.username = cantaloupeapiuser|" cantaloupe.properties

sed -i "s|endpoint.api.secret =.*$|endpoint.api.secret = SpartanBlueGold#2\!|" cantaloupe.properties 

sed -i "s|source.static = FilesystemSource|source.static = HttpSource|" cantaloupe.properties

sed -i "s|FilesystemSource.BasicLookupStrategy.path_prefix = /home/myself/images/|FilesystemSource.BasicLookupStrategy.path_prefix = /tmp/|" cantaloupe.properties

sed -i "s|HttpSource.trust_all_certs = false|HttpSource.trust_all_certs = true|" cantaloupe.properties

sed -i "s|HttpSource.request_timeout =|HttpSource.request_timeout = 20|" cantaloupe.properties

sed -i "s|HttpSource.BasicLookupStrategy.url_prefix = http://localhost/images/|HttpSource.BasicLookupStrategy.url_prefix =|" cantaloupe.properties


sed -i "s|HttpSource.BasicLookupStrategy.auth.basic.username =|HttpSource.BasicLookupStrategy.auth.basic.username = anonymous|" cantaloupe.properties

sed -i "s|HttpSource.BasicLookupStrategy.auth.basic.secret =|HttpSource.BasicLookupStrategy.auth.basic.secret = anonymous|" cantaloupe.properties

sed -i "s|processor.stream_retrieval_strategy = StreamStrategy|processor.stream_retrieval_strategy = CacheStrategy|" cantaloupe.properties

sed -i "s|processor.background_color = white|processor.background_color = black|" cantaloupe.properties

sed -i "s|cache.server.source.ttl_seconds = 2592000|cache.server.source.ttl_seconds = 172800|" cantaloupe.properties

sed -i "s|cache.server.derivative.enabled = false|cache.server.derivative.enabled = true|" cantaloupe.properties

sed -i "s|cache.server.derivative =|cache.server.derivative = FilesystemCache|" cantaloupe.properties

sed -i "s|cache.server.derivative.ttl_seconds = 2592000|cache.server.derivative.ttl_seconds = 172800|" cantaloupe.properties

sed -i "s|cache.server.worker.enabled = false|cache.server.worker.enabled = true|" cantaloupe.properties

sed -i "s|FilesystemCache.pathname = /var/cache/cantaloupe|FilesystemCache.pathname = /srv/cache|" cantaloupe.properties

sed -i "s|log.application.level = debug|log.application.level = info|" cantaloupe.properties

sed -i "s|log.application.ConsoleAppender.enabled = true|log.application.ConsoleAppender.enabled = false|" cantaloupe.properties

sed -i "s|log.application.FileAppender.pathname = /path/to/logs/application.log|log.application.FileAppender.pathname = /srv/log/application.log|" cantaloupe.properties

sed -i "s|log.application.RollingFileAppender.enabled = false|log.application.RollingFileAppender.enabled = true|" cantaloupe.properties

sed -i "s|log.application.RollingFileAppender.pathname = /path/to/logs/application.log|log.application.RollingFileAppender.pathname = /srv/log/application.log|" cantaloupe.properties

sed -i "s|log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/application-%d{yyyy-MM-dd}.log|log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/application-%d{yyyy-MM-dd}.log|" cantaloupe.properties

sed -i "s|log.error.FileAppender.enabled = false|log.error.FileAppender.enabled = true|" cantaloupe.properties

sed -i "s|log.error.FileAppender.pathname = /path/to/logs/error.log|log.error.FileAppender.pathname = /srv/log/error.log|" cantaloupe.properties

sed -i "s|log.error.RollingFileAppender.pathname = /path/to/logs/error.log|log.error.RollingFileAppender.pathname = /srv/log/error.log|" cantaloupe.properties

sed -i "s|log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/error-%d{yyyy-MM-dd}.log|log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/error-%d{yyyy-MM-dd}.log|" cantaloupe.properties

sed -i "s|log.access.FileAppender.pathname = /path/to/logs/access.log|log.access.FileAppender.pathname = /srv/log/access.log|" cantaloupe.properties
 
sed -i "s|log.access.RollingFileAppender.pathname = /path/to/logs/access.log|log.access.RollingFileAppender.pathname = /srv/log/access.log|" cantaloupe.properties
 
sed -i "s|log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/access-%d{yyyy-MM-dd}.log|log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/access-%d{yyyy-MM-dd}.log|" cantaloupe.properties

cat > /etc/systemd/system/cantaloupe.service <<END_CLP
[Unit]

Description=Cantaloupe Image Server

[Service]

Type=simple
User=cantaloupe
ExecStart=/usr/bin/java -Dcantaloupe.config=/opt/cantaloupe-4.0.3/cantaloupe.properties -Xmx12g -jar /opt/cantaloupe-4.0.3/cantaloupe-4.0.3.war
ExecStop=/usr/bin/killall -9 cantaloupe-4.0.3.war
Restart=on-failure

[Install]
WantedBy=multi-user.target
END_CLP

systemctl daemon-reload
systemctl enable cantaloupe.service
systemctl start cantaloupe.service

####################################################
####################################################

RESULT:

– No Change. Problem Still Exists.
Manifests itself same as before.

####################################################
####################################################

###############
WEEK OF 18APR
###############

– Decided to come at problem from another angle. Since Djatoka is still installed on the server, lets see if Bookreader and Openseadragon will work with it instead.

################

– Verified Djatoka functioning properly by
visiting http://localhost:8080/adore-djatoka/

— successful retrieval of test image.

— Set Islandora Internet Archive Bookreader to Adore-Djatoka

–Set openseadragon to adore-djatoka

Attempted to open a book object. No pages displayed. Note that the GET request has “localhost” within. I think if reverse proxy was working correctly, we would not see this. Not sure though.


[Thu Apr 18 16:27:52.317292 2019] [proxy:debug] [pid 19411] proxy_util.c(1843): AH00925: initializing worker http://localhost:8080/adore-djatoka shared
[Thu Apr 18 16:27:52.317442 2019] [proxy:debug] [pid 19411] proxy_util.c(1885): AH00927: initializing worker http://localhost:8080/adore-djatoka local
[Thu Apr 18 16:27:52.317500 2019] [proxy:debug] [pid 19411] proxy_util.c(1936): AH00931: initialized single connection worker in child 19411 for (localhost)
[Thu Apr 18 16:27:52.317543 2019] [proxy:debug] [pid 19411] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Thu Apr 18 16:27:52.317551 2019] [proxy:debug] [pid 19411] proxy_util.c(1885): AH00927: initializing worker proxy:reverse local
[Thu Apr 18 16:27:52.317571 2019] [proxy:debug] [pid 19411] proxy_util.c(1936): AH00931: initialized single connection worker in child 19411 for (*)
[Thu Apr 18 16:27:53.320481 2019] [proxy:debug] [pid 19416] proxy_util.c(1843): AH00925: initializing worker http://localhost:8080/adore-djatoka shared
[Thu Apr 18 16:27:53.320575 2019] [proxy:debug] [pid 19416] proxy_util.c(1885): AH00927: initializing worker http://localhost:8080/adore-djatoka local
[Thu Apr 18 16:27:53.320628 2019] [proxy:debug] [pid 19416] proxy_util.c(1936): AH00931: initialized single connection worker in child 19416 for (localhost)
[Thu Apr 18 16:27:53.320684 2019] [proxy:debug] [pid 19416] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Thu Apr 18 16:27:53.320695 2019] [proxy:debug] [pid 19416] proxy_util.c(1885): AH00927: initializing worker proxy:reverse local
[Thu Apr 18 16:27:53.320718 2019] [proxy:debug] [pid 19416] proxy_util.c(1936): AH00931: initialized single connection worker in child 19416 for (*)
[Thu Apr 18 16:27:53.322935 2019] [proxy:debug] [pid 19417] proxy_util.c(1843): AH00925: initializing worker http://localhost:8080/adore-djatoka shared
[Thu Apr 18 16:27:53.323098 2019] [proxy:debug] [pid 19417] proxy_util.c(1885): AH00927: initializing worker http://localhost:8080/adore-djatoka local
[Thu Apr 18 16:27:53.323205 2019] [proxy:debug] [pid 19417] proxy_util.c(1936): AH00931: initialized single connection worker in child 19417 for (localhost)
[Thu Apr 18 16:27:53.323285 2019] [proxy:debug] [pid 19417] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared
[Thu Apr 18 16:27:53.323415 2019] [proxy:debug] [pid 19417] proxy_util.c(1885): AH00927: initializing worker proxy:reverse local
[Thu Apr 18 16:27:53.323549 2019] [proxy:debug] [pid 19417] proxy_util.c(1936): AH00931: initialized single connection worker in child 19417 for (*)

Leave a Reply

Your email address will not be published. Required fields are marked *