httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] bizarre cgi stuff
Date Fri, 06 Dec 2002 08:13:17 GMT
To add to Zac's comments:

In a normal set-up, ScriptAlias and AddHandler are *alternative*
mechanisms. You don't use both*.

ScriptAlias says: "All the files in this directory are programs,
regardless of their extension. Execute them via CGI and do not list the

AddHandler says: "All the files with this extension are programs,
regardless of their location. Execute them via CGI.

Scriptalias is good because you don't have to bother about extensions.
Also, from a filesystem management POV, you can keep all your
executables in one directory which might be nice. AddHandler is good
because you don't have to bother about putting all your executables in
the one directory.

So pick one mechanism and concentrate on getting it to work - don't mix
and match or you (and apache) will just get confused.

Regarding your DirectoryIndex, you can set this in a ScriptAlias
directory but then it has to point to a dynamic file (i.e. a program) -
if it points to an HTML file, CGI will try to execute it and that
obviously won't work.


Owen Boyle

*Before everyone writes back, I guess there are some peculiar
circumstances where you would want to use both but this would be a
fairly advanced and complicated situation. I am assuming the poster is
just starting out and simply wants to get a few progs running.

>-----Original Message-----
>From: Matthew Webster []
>Sent: Donnerstag, 5. Dezember 2002 23:39
>Subject: [users@httpd] bizarre cgi stuff
>Ok, I got the Perl cgi to work, the only thing is....
>...all that ScriptAlias appears to do is prevent a directory 
>listing of 
>the cgi-bin directory AND prevent the DirectoryIndex directive from 
>working inside the cgi-bin directory!
>This is very bizarre.
>Also, it doesn't appear to matter what directives I use to control 
>where scripts are allowed to be executed; as long as I have
>AddHandler cgi-script .pl
>in or above the directory with the script, it will execute.
>This is all rather odd to my mind.  I thought that the 
>AddHandler would 
>let scripts get executed and ScriptAlias (as one method) would 
>WHERE they should be executed.  Anywhere else they would just 
>be normal 
>Does anyone know what's going on or do I have a rogue version 
>of Apache?
>Best regards,
>Matthew Webster - 07984 164 535
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:> for more info.
>To unsubscribe, e-mail:
>   "   from the digest:
>For additional commands, e-mail:

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message