[users@httpd] Apache not treating .EXE as CGI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
Hi all,
Question from a newbie. I have Apache 2.0.52 for Win32 installed locally on Windows XP, SP2. I'm trying to run a set of CGI .EXEs (that's Windows executables, not Perl scripts or similar) from NIST. The instructions from the NIST install read as follows about setting up a ScriptAlias in Apache:
Add the following ScriptAlias at the appropriate postion in httpd.conf:
Alias /WebTools "C:/{path}/WebTools"ScriptAlias /WebTools/WebCAT/cgi-bin/ "C:/{path}/WebTools/WebCAT/cgi-bin/"    AllowOverride None    Options ExecCGI    Order allow,deny    Allow from all
I've added these sections to my httpd.conf file, making the appropriate substituions for the {path} placeholders, and the simple alias works as expected. However, any reference to one of the .EXEs in the ".../cgi-bin/" directory results in the browser trying to download the EXE rather than Apache running it as a CGI program.
This occurs in both Mozilla and IE, and both browsers report the .EXE as a MIM type "application/octet" -- so it appears Apache isn't getting the message that it should *run* the EXEs in that directory, rather than download them. I'm accessing the Apache server locally with a http://localhost... URL.
I've tried adding the following directives within the <Directory> pragma, singly and in combination, to no avail:
- AddHandler cgi_script .exe
- SetHandler cgi_script .exe
I've also tried to use a standard Alias (rather than ScriptAlias) and forcibly enable CGI within the <Directory> pragma according to the instructions in the Apache manual.
What am I missing in my configuration? See below for the relevant sections of my httpd.conf file. I have only used Apache thus far to test my own default homepage, and try this NIST installation, so the Apache configuration is 99% "plain vanilla" default.
Cheers,
Steve
 
[Excerpt from httpd.conf. My additions for the NIST installation start with
### WebCAT ###.]
#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL.  So "/icons" isn't aliased in this
# example, only "/icons/".  If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings.  If you
# do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "C:/Program Files/Apache Group/Apache2/icons/"
<Directory "C:/Program Files/Apache Group/Apache2/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

### WebCAT ###
##############
Alias /WebTools "C:/WebMetrics/WebTools"

#
# This should be changed to the ServerRoot/manual/.  The alias provides
# the manual, even if you choose to move your DocumentRoot.  You may comment
# this out if you do not care for the documentation.
#
AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "C:/Program Files/Apache Group/Apache2/manual$1"
<Directory "C:/Program Files/Apache Group/Apache2/manual">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
    <Files *.html>
        SetHandler type-map
    </Files>
    SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/ prefer-language=$1
    RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2
</Directory>
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"
#
# "C:/Program Files/Apache Group/Apache2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

### WebCAT ###
##############
ScriptAlias /WebTools/WebCAT/cgi-bin/ "C:/WebMetrics/WebTools/WebCAT/cgi-bin/"
<Directory "C:/WebMetrics/WebTools/WebCAT/cgi-bin">
    AllowOverride None
    Options ExecCGI
    AddHandler cgi-script .exe
    Order allow,deny
    Allow from all
</Directory>


--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux