• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

Non-cgi files in "AllowCGI" directory

My Apache 2.0 on RedHat 8.0 is trying to execute all my image files residing in a subdirectory of /eng which is ScriptAlias-ed. I tried adding

 <Directory /var/www/html/eng/html>
Options -ExecCGI

to no avail. I get "premature end of script headers" in my logs. It is essentual to keep the curent file structure, since it's going to be a lot of work to edit all the scripts to reflect such a change. How can I tell Apache not to execute files in surton subdirectories. If you need me to, I can give you more ditails about the current configuration and even post the httpd.conf file here.

Thanks in advance
1 Solution
OK - best bet is to think about the structure of your whole web site, and decide where you want executable cgi scripts and where you don't.

There are a number of global parameters within your http.conf file that effectively allow/disallow you to alter features for subdirectories.

One that you are interested is:

AllowOverride ExecCGI

needs to exist as a global directive in order to enable you to do what you want the way you have attempted.

Perhaps it would be easier to just enable your executable scripts in the one directory where they exist using the ExecCGI?

.......or use a special processing script:

<Directory /var/www/html/eng/html>
    <FilesMatch "\.(gif|jpg)$">
        SetHandler /cgi-bin/display-image.cgi

Hope that helps:)

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now