Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird issue with images in cgi-bin

Status
Not open for further replies.

majorbiff

Programmer
Mar 8, 2005
53
0
0
AU
I have recently changed over to a new server with 2.0.54. It seems to be the default behaviour of Apache on the new server to try to excecute all files in a cgi-bin directory. In other words, Apache attempts to excecute all files, not just scripts.
My old server has 2.0.43 and didn't have this behaviour.

What makes it more confusing is that the config files are practically identical.
The problem started when I moved a perl script to the new server and started to get this:
Code:
[Mon Aug 01 14:04:58 2005] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: service.gif, referer: ...xxx.../cgi-bin/webform/PsychTracRequest.pl

I tracked it down to this line in my script:
Code:
print '</FONT><p><br></TD></TR><TR><TD bgcolor="#cFFFFF"><center><img src="../images/service.gif" width=130 height=100></center></TD></TR></TABLE>';

The script itself ran fine and spat out the HTML. The client browser hit 'service.gif' and Apache attempted to excecute it as a script.

I have moved the image out of the cgi-bin directory so it works now. However, I would like to get it to work in cgi-bin so it can go in its proper location.
I have been experimenting with <Directory> and <Files> to over-ride the ScriptAlias for .jpg's and .gif's, but alas no luck.

Alchemy is easy with Perl!
s/lead/gold/g;
 
majorbiff said:
However, I would like to get it to work in cgi-bin so it can go in its proper location.

The correct location for images should be outside of the cgi-bin directory anyway, the cgi-bin should be for scripts as the name suggests.

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top