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:
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:
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:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2014-02-06
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
var url = require('url');
var proxy = require('proxy-middleware');
app.use('/fcgi-bin/iipsrv.fcgi', proxy(url.parse('http://localhost/fcgi-bin/iipsrv.fcgi'));
and wuuuupsi!
Cheers,
Seb
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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'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:
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.
View and moderate all "Help" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
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:
https://www.npmjs.com/package/proxy-middleware
var url = require('url');
var proxy = require('proxy-middleware');
app.use('/fcgi-bin/iipsrv.fcgi', proxy(url.parse('http://localhost/fcgi-bin/iipsrv.fcgi'));
and wuuuupsi!
Cheers,
Seb
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.