iipsrv
iipsrv copied to clipboard
Empty response from server
Hello, I have tried setting up the IIP server from both command line and using lighttpd but ran into the same problem - the server seems to be running but is providing no response.
Let me walk you through the steps on Ubuntu 20.04:
- Installed IIP image server using package manager with
sudo apt-get install iipimage-server
- Exported the following env variables (notice the highest verbosity level):
export VERBOSITY=6
export MEMCACHED_SERVERS=localhost
- Ran the server with:
./iipsrv.fcgi --bind 127.0.0.1:9000
from/usr/lib/iipimage-server
According to the Troubleshooting page, pointing the browser to http://localhost:9000/ should reveal server version number. However, I get an ERR_EMPTY_RESPONSE
When trying to reach the same address through wget
, the response is following:
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:9000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
--2022-08-22 15:57:56-- (try: 2) http://localhost:9000/
Connecting to localhost (localhost)|127.0.0.1|:9000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
I've checked the log file - it seems to catch only the server initialisation log, but reveals nothing about the empty response:
<----------------------------------->
Mon Aug 22 14:50:10 2022
IIPImage Server. Version 1.1
*** Ruven Pillay <[email protected]> ***
Verbosity level set to 6
Running in standalone mode on socket: 127.0.0.1:9000 with backlog: 2048
Setting maximum image cache size to 10MB
Setting filesystem prefix to ''
Setting default JPEG quality to 75
Setting maximum CVT size to 5000
Setting HTTP Cache-Control header to 'max-age=86400'
Setting 3D file sequence name pattern to '_pyr_'
Setting Allow Upscaling to true
Setting ICC profile embedding to true
Setting up JPEG2000 support via OpenJPEG
Setting image processing engine to CPU processor
OpenMP enabled for parallelized image processing with 12 threads
Unable to load watermark image '/tmp/watermark.tif'
Memcached support enabled. Connected to servers: 'localhost' with timeout 86400
Initialisation Complete.
<----------------------------------->
Caught Interrupt signal. Terminating after 0 accesses
Mon Aug 22 15:57:44 2022
<----------------------------------->
<----------------------------------->
Mon Aug 22 15:57:51 2022
IIPImage Server. Version 1.1
*** Ruven Pillay <[email protected]> ***
Verbosity level set to 6
Running in standalone mode on socket: 127.0.0.1:9000 with backlog: 2048
Setting maximum image cache size to 10MB
Setting filesystem prefix to ''
Setting default JPEG quality to 75
Setting maximum CVT size to 5000
Setting HTTP Cache-Control header to 'max-age=86400'
Setting 3D file sequence name pattern to '_pyr_'
Setting Allow Upscaling to true
Setting ICC profile embedding to true
Setting up JPEG2000 support via OpenJPEG
Setting image processing engine to CPU processor
OpenMP enabled for parallelized image processing with 12 threads
Memcached support enabled. Connected to servers: 'localhost' with timeout 86400
Initialisation Complete.
<----------------------------------->
I have tried to follow the lighttpd
directions from http://circle-theory.blogspot.com/2015/01/jpeg2000-support-with-iipimage-iipsrv.html, however, the result is exactly the same.
Googling for the error did not bring me further. Only thing I found was this https://groups.google.com/g/iiif-discuss/c/nxjGYieLaLQ however there only the log file was mentioned and no answer was provided after linking to the circle-theory blog.
Could you please let me know how to proceed with debugging this?
Thank you
iipsrv runs as an FCGI process, so you cannot make direct HTTP requests. You need to connect via a web server, such as Lighttpd.
When you install the Ubuntu package iipimage-server, it should normally install an iipsrv lighttpd config file. Take a look in /etc/lighttpd/conf-available/. If it's not there, uninstall the iipimage-server package and then re-install.
If it's now there, activate using the lighttpd-enable-mod command if necessary, restart lighttpd and iipsrv should hopefully be running at http://localhost/iipsrv/iipsrv.fcgi
Hey @ruven, thank you for the quick response!
iipsrv runs as an FCGI process, so you cannot make direct HTTP requests. You need to connect via a web server, such as Lighttpd.
Sorry, I was mislead by the documentation stating it is possible to start the server directly from the command line.
When you install the Ubuntu package iipimage-server, it should normally install an iipsrv lighttpd config file. Take a look in /etc/lighttpd/conf-available/. If it's not there, uninstall the iipimage-server package and then re-install.
Indeed the config was not present. However, following your advice and reinstalling the iipimage-server
package did not add the config. The documentation specifies that lighttpd must be installed for this to take place, which it is.
As for lighttpd, I've tried using it in the following manner following the above linked circle-theory
instructions:
# install lighttpd
sudo apt-get install lighttpd
# set up server area
cd /var/www
sudo mkdir localhost
sudo chmod 755 localhost
cd localhost
sudo mkdir fcgi-bin
sudo chmod 755 fcgi-bin
sudo mkdir data
sudo chmod 755 data
# copy iipserv binaries to server area
sudo cp ~/iipsrv/src/iipsrv.fcgi /var/www/localhost/fcgi-bin/
sudo chmod 755 /var/www/localhost/fcgi-bin/iipsrv.fcgi
After that,
- I've edited the main lighttpd config
/etc/lighttpd/lighttpd.conf
by adding
fastcgi.server = ( "/fcgi-bin/iipsrv.fcgi" =>
(( "host" => "127.0.0.1",
"port" => 9000,
"check-local" => "disable",
"min-procs" => 1,
"max-procs" => 1,
"bin-path" => "/var/www/localhost/fcgi-bin/iipsrv.fcgi",
"bin-environment" => (
"LOGFILE" => "/tmp/iipsrv.log",
"VERBOSITY" => "5",
"MAX_IMAGE_CACHE_SIZE" => "10",
"FILENAME_PATTERN" => "_pyr_",
"JPEG_QUALITY" => "50",
"MAX_CVT" => "3000"
)
))
)
- enabled FastCGI mode with
sudo lighttpd-enable-mod fastcgi
- Started the server with
sudo /etc/init.d/lighttpd start
At this point, by pointing the browser at the localhost:9000
, I should get a lighttpd page at least, however, same problem occurs:
@ruven Is there anything else I could check to come across this?
In fact the blog you refer to is really about manually building iipsrv with Kakadu, so you have ended up massively over-complicating things!
Anyway, I think your error is simply because you're connecting with your browser to the wrong address. You should connect to lighttpd itself, which is running on port 80 (not port 9000) and use the path defined for iipsrv in your config, which is: http://localhost/fcgi-bin/iipsrv.fcgi
You can change this path to whatever you want. Your lighttpd config defines this path at the beginning:
fastcgi.server = ( "/fcgi-bin/iipsrv.fcgi" =>
Hopefully this should fix things for you. If not, let me know.