httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From she...@techflow.com
Subject [users@httpd] Apache not treating .EXE as CGI
Date Wed, 18 May 2005 18:27:42 GMT
<FONT face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=2><DIV>&nbsp;<DIV>Hi
all, </DIV><DIV> </DIV><DIV>Question from a newbie. I have&nbsp;Apache
2.0.52 for Win32 installed locally on Windows XP, SP2. I'm trying to run&nbsp;a set of
CGI .EXEs (that's Windows executables, not Perl scripts or similar)&nbsp;from NIST. The
instructions from the NIST install read as follows about setting up a ScriptAlias in Apache:
</DIV><DIV> </DIV><DIV> </DIV><DIV>Add the following ScriptAlias
at the appropriate postion in httpd.conf: </DIV><DIV><FONT face=monospace size=2>Alias
/WebTools "C:/{path}/WebTools"ScriptAlias /WebTools/WebCAT/cgi-bin/ "C:/{path}/WebTools/WebCAT/cgi-bin/"<DIRECTORY
? ?C: {path} WebTools WebCAT cgi-bin> &nbsp; &nbsp;AllowOverride None &nbsp;
&nbsp;Options ExecCGI &nbsp; &nbsp;Order allow,deny &nbsp; &nbsp;Allow
from all</DIRECTORY><BR></FONT></DIV><DIV> </DIV><DIV>I've
added these sections to my httpd.conf file, making the appropriate substituions for the {path}
placeholders,&nbsp;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. </DIV><DIV> </DIV><DIV>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 <A href="http://localhost.../"
target=blank>http://localhost... </A>URL. </DIV><DIV> </DIV><DIV>I've
tried adding the following&nbsp;directives within the &lt;Directory&gt; pragma,
singly and in combination,&nbsp;to no avail: </DIV><DIV>-&nbsp;AddHandler
cgi_script .exe </DIV><DIV>- SetHandler cgi_script .exe </DIV><DIV>
</DIV><DIV>I've also tried&nbsp;to use&nbsp;a standard Alias (rather than
ScriptAlias) and forcibly enable CGI within the &lt;Directory&gt; pragma according
to the instructions in the Apache manual. </DIV><DIV> </DIV><DIV><DIV>What
am I missing in my configuration? See below for the relevant sections of my httpd.conf file.&nbsp;I
have only used Apache thus far to&nbsp;test my own default homepage, and try this NIST
installation, so the Apache configuration is 99% "plain vanilla" default. </DIV><DIV>
</DIV></DIV><DIV>Cheers, </DIV><DIV>Steve <BR></DIV><DIV>
</DIV><DIV>&nbsp;</DIV><DIV>[Excerpt from&nbsp;httpd.conf.
My additions for the NIST installation start with </DIV><DIV>### WebCAT ###.]
</DIV><DIV> </DIV><DIV># <BR># Aliases: Add here as many aliases
as you need (with no limit). The format is <BR># Alias fakename realname <BR>#
<BR># Note that if you include a trailing / on fakename then the server will <BR>#
require it to be present in the URL.&nbsp; So "/icons" isn't aliased in this <BR>#
example, only "/icons/".&nbsp; If the fakename is slash-terminated, then the <BR>#
realname must also be slash terminated, and if the fakename omits the <BR># trailing
slash, the realname must also omit it. <BR># <BR># We include the /icons/ alias
for FancyIndexed directory listings.&nbsp; If you <BR># do not use FancyIndexing,
you may comment this out. <BR># <BR>Alias /icons/ "C:/Program Files/Apache Group/Apache2/icons/"
</DIV><DIV>&lt;Directory "C:/Program Files/Apache Group/Apache2/icons"&gt;
<BR>&nbsp;&nbsp;&nbsp; Options Indexes MultiViews <BR>&nbsp;&nbsp;&nbsp;
AllowOverride None <BR>&nbsp;&nbsp;&nbsp; Order allow,deny <BR>&nbsp;&nbsp;&nbsp;
Allow from all <BR>&lt;/Directory&gt; </DIV><DIV><BR>### WebCAT
### <BR>############## <BR>Alias /WebTools "C:/WebMetrics/WebTools" </DIV><DIV><BR>#
<BR># This should be changed to the ServerRoot/manual/.&nbsp; The alias provides
<BR># the manual, even if you choose to move your DocumentRoot.&nbsp; You may comment
<BR># this out if you do not care for the documentation. <BR># <BR>AliasMatch
^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "C:/Program Files/Apache Group/Apache2/manual$1"
</DIV><DIV>&lt;Directory "C:/Program Files/Apache Group/Apache2/manual"&gt;
<BR>&nbsp;&nbsp;&nbsp; Options Indexes <BR>&nbsp;&nbsp;&nbsp;
AllowOverride None <BR>&nbsp;&nbsp;&nbsp; Order allow,deny <BR>&nbsp;&nbsp;&nbsp;
Allow from all </DIV><DIV>&nbsp;&nbsp;&nbsp; &lt;Files *.html&gt;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetHandler
type-map <BR>&nbsp;&nbsp;&nbsp; &lt;/Files&gt; </DIV><DIV>&nbsp;&nbsp;&nbsp;
SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/ prefer-language=$1 <BR>&nbsp;&nbsp;&nbsp;
RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2 <BR>&lt;/Directory&gt;
</DIV><DIV># <BR># ScriptAlias: This controls which directories contain
server scripts. <BR># ScriptAliases are essentially the same as Aliases, except that
<BR># documents in the realname directory are treated as applications and <BR>#
run by the server when requested rather than as documents sent to the client. <BR>#
The same rules about trailing "/" apply to ScriptAlias directives as to <BR># Alias.
<BR># <BR>ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"
</DIV><DIV># <BR># "C:/Program Files/Apache Group/Apache2/cgi-bin" should
be changed to whatever your ScriptAliased <BR># CGI directory exists, if you have that
configured. <BR># <BR>&lt;Directory "C:/Program Files/Apache Group/Apache2/cgi-bin"&gt;
<BR>&nbsp;&nbsp;&nbsp; AllowOverride None <BR>&nbsp;&nbsp;&nbsp;
Options None <BR>&nbsp;&nbsp;&nbsp; Order allow,deny <BR>&nbsp;&nbsp;&nbsp;
Allow from all <BR>&lt;/Directory&gt; </DIV><DIV><BR>### WebCAT
### <BR>############## <BR>ScriptAlias /WebTools/WebCAT/cgi-bin/ "C:/WebMetrics/WebTools/WebCAT/cgi-bin/"
<BR>&lt;Directory "C:/WebMetrics/WebTools/WebCAT/cgi-bin"&gt; <BR>&nbsp;&nbsp;&nbsp;
AllowOverride None <BR>&nbsp;&nbsp;&nbsp; Options ExecCGI <BR>&nbsp;&nbsp;&nbsp;
AddHandler cgi-script .exe <BR>&nbsp;&nbsp;&nbsp; Order allow,deny <BR>&nbsp;&nbsp;&nbsp;
Allow from all <BR>&lt;/Directory&gt; </DIV><DIV> </DIV><BR><DIV><BR></DIV></DIV></FONT>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message