I'm trying to embed the mooviewer into a Django Python application. In a dev environment, Django runs its own WSGI server on port 8000. As a result, I am getting a "No response from /fcgi-bin/iipsrv.fcgi" error when the app runs at http://localhost:8000. in my HTML, the iip server path is set as:
var server = '/fcgi-bin/iipsrv.fcgi';
The Chrome debugger tells me that it's a 404 on the requested URL of http://localhost:8000/fcgi-bin/iipsrv.fcgi?FIF=/home/parallels/public_html/iipmooviewer/iipmooviewer/200_tiled.tif&obj=IIP,1.0&obj=Max-size&obj=Tile-size&obj=Resolution-number
I'm running Apache 2 and I can reach http://localhost/fcgi-bin/iipsrv.fcgi just fine, so my IIP server is working. I've tried setting up a proxy, but cannot get that to work either:
ProxyPass /fcgi-bin/iipsrv.fcgi http://localhost/fcgi-bin/iipsrv.fcgi
ProxyPassReverse /fcgi-bin/iipsrv.fcgi http://localhost/fcgi-bin/iipsrv.fcgi
Actually, when the proxy is in place, then I get a 404 on http://localhost/fcgi-bin/iipsrv.fcgi, not sure why.
Is there a way to route these different ports?
You seem to have CSS turned off.
Please don't fill out this field.
You've set up Apache on port 80, but are trying to request iipsrv on port 8000. So either setup Apache to listen on port 8000 for iipsrv or specify explicitly the port for the server variable you pass to the client:
var server = 'http://localhost/fcgi-bin/iipsrv.fcgi';
Ruven, if I set Apache to listen on 8000, then when I try to run the Django dev WSGI server on 8000, it gets denied, as Apache is already on that port. I have tried to set it up so like you suggested above, just pointing the server to http://localhost/fcgi-bin/iipsrv.fcgi, but then I get into cross-domain issues. I've tried setting up Apache to allow CORS, but I still keep getting the error of "Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers." from mootools-core-1.4.5-full-nocompat.js. I see from another forum post you suggest setting the load parameter. I tried that, and I get my nav window and overview image, but my main image never loads into the canvas element, and I get a waiting cursor. What exactly is the size part of the load parameter (couldn't find that anywhere in the docs).
Is there a way to get around the CORS issue? Thanks.
Why don't you simply do proxy forwarding, so that all requests are handled by Apache on port 80, then dispatched to the appropriate backend?
For iipsrv, you can proxy in this way: http://iipimage.sourceforge.net/documentation/server/#forwarding
And you can setup something similar for your Django installation.
Hi Ruven and Anonymous1,
I was facing the same problem than Anonymous1 with a node.js / express application.
I tried a lot of differents approaches, enabling CORS in Apache, trying to use https://www.npmjs.com/package/cors
Finally proxy-middleware made my day:
var url = require('url');
var proxy = require('proxy-middleware');
Thanks for the info. Yes, proxying is currently the most robust way of doing this as CORS support will also depend on whether the browser supports this and is not simply a question of enabling it server-side.
Sign up for the SourceForge newsletter: