The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

can't access .gif in cgi-bin directory

Discussion in 'General Discussion' started by colet, Jun 23, 2006.

  1. colet

    colet Member

    Joined:
    Apr 26, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    When I try to serve a gif in my cgi-bin directory, I get 500 Internal Server Error and the error_log shows:
    Premature end of script headers: /home/myhome/public_html/cgi-bin/my.gif

    Searching the forum just shows problems with cgis not working.

    I've editted my http.conf:
    <Directory "/usr/local/apache/cgi-bin">
    #AllowOverride None
    AllowOverride All
    Options None
    Order allow,deny
    Allow from all
    </Directory>

    and added:
    <Files ~ "\.gif$">
    Options FollowSymLinks
    Allow from all
    </Files>

    Then restarted apache, but I still get this error. I can work around the problem, but I'd like to understand why this doesn't work.

    Thanks for any tips!

    --
    Cole
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    You mention the gif file is at /home/myhome/public_html/cgi-bin/my.gif but say that you are making changes to code:

    <Directory "/usr/local/apache/cgi-bin">

    This is not the same.

    I think the actual reason that you are seeing this message is because CPanel setups user's cgi-bin directories as a ScriptAlias. You will see this the VirtualHost section for that specific account.

    The real issue is, why are you wanting to call an image in the cgi-bin directory? The cgi-bin directory is really intended for CGI scripts and is not set up to handle regular files such as images. I think a better solution would be to place this image into another directory on the account and call the images from that directory rather than from the cgi-bin directory.
     
  3. colet

    colet Member

    Joined:
    Apr 26, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for taking the time to reply.

    I'm running htdig and have some menu bar js in the results header that is looking in the current working directory for arrow.gif. I thought I might just put a symlink to the real gif next to htsearch and be done with it. I've settled with mod rewrite as a workaround for now. I would just edit the java script, but it's not my code and I don't want it to break each time the site is updated.

    --
    Cole
     
Loading...

Share This Page