How can I serve the image from the cgi directory under Tomcat?

I have configured Tomcat 6 to work with Perl CGI scripts. This part is well documented and works fine for me.

But, when the browser requests an image from this CGI file, the Tomcat CGI servlet refuses to serve the image, instead displaying only the image url. I believe this is a security feature that prevents users from viewing the contents of such files in general.

How can I configure tomcat, tomcat CGI servlet and / or default tomcat servlet to actually serve the image file that is in my CGI directory? Is it possible?

0


source to share


4 answers


Resolution: I ditched my "single server" (ie existing Tomcat server) and installed Apache. Naturally, Bugzilla works much easier on Apache. No surprises.

I conclude that:



  • Apache has no problem serving image files from under the cgi-bin directory.

  • The Bugzilla devs don't seem to think it's a bad thing to put a graphics file in an application script.

  • Tomcat support for cgi-bin is not as rich / extensive as Apache.

  • The answer to my original question is, this cannot be done in Tomcat 6.

0


source


Why do you want to put images in your CGI directory? Shouldn't they be under a normal root document?



If you are creating relative paths in the output of your script, add a BASE tag to the HTML header, or make the links absolute urls.

+1


source


Since the Bugzilla Guide only provides configuration guidelines for Apache and MS IIS, and google does not disclose any successful deployment reports, it is best to stick to a documented and maintained Apache or IIS configuration.

+1


source


OK, I wrote a quick guide to installing Bugzilla on Apache Tomcat 6 (on Ubuntu 10.04 + MysSQL).

I played around with the BZ instance and it seemed to work fine.

http://blog.inmite.eu/2010/08/installing-bugzilla-on-the-apache-tomcat-6/

Good luck!

peter @inmite [dot] eu

0


source







All Articles