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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent script execution for filetype in cgi-bin? 1

Status
Not open for further replies.

Phaethar

Technical User
Nov 24, 2003
27
US
Hey all,

I've set up an Apache server running on Fedora 3 to be a backup system to a Windows IIS server. For the most part, things are working great. However, I'm running into a problem with a javascript file that needs to be placed in the cgi-bin folder. Apache is trying to execute it, and I need to tell it to simply read it. I'm reading the Apache docs here:


They mention it's possible to exclude a filetype, but don't really show how, and I can't really make heads or tails of the detailed mod_rewrite section.

So, I'm hoping someone can help to simplify the syntax needed to tell Apache not to execute .js files located in the cgi-bin folder.

Thanks!
 
Phaethar,

Does the javascript file really need to be in the cgi-bin diectory?

Apache treats all files in your ScriptAlias directory as CGI scripts, regardless of their file type.

Wishdiak
A+, Network+, Security+, MCSA: Security 2003
 
Wishdiak,

Right now, it does need to be in cgi-bin, simply because this system is a backup to a current production system. Of course, it's backing up a Windows system, which doesn't care what's in cgi-bin, but as they're both reading from the same source we can't really change the script without a lot of trouble.

I have to believe there's a way that's not so difficult to just tell Apache to not execute .js files in tha folder.
 
If your httpd.conf file has this
Code:
ScriptAlias /cgi-bin/ "/path/to/your/cgi-bin/"
<Directory "/path/to/your/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
Change it to this
Code:
Alias /cgi-bin/ "/path/to/your/cgi-bin/"
<Directory "/path/to/your/cgi-bin">
    Options ExecCGI
    AddHandler cgi-script .cgi .pl
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Tell me what happen


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
Perluserpengo,

That did it! Thanks a lot for the tip!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top