You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Liyu,She" <li...@gmail.com> on 2007/03/13 08:48:43 UTC

[users@httpd] Another "attempt to invoke directory as script" Error

Hi, everyone.

I am running Apache 2.2.3 on FreeBSD 6.1release.
I was trying to make the /cgi/ path indexed while visiting.
More specifically, I want anyone visiting /cgi/ would be
automatically redirected to /cgi/index.html

The related configuration part is:
=========================================
    Alias /cgi/ "/sly/www/cgi/"

    <Directory "/sly/www/cgi/">
        Options Indexes ExecCGI FollowSymLinks
        AllowOverride None
        DirectoryIndex index.html
        Order allow,deny
        Allow from all
        SetHandler cgi-script
    </Directory>
=========================================

But I kept knocked off from the /cgi/ location with
 403 forbidden http status code. It says:

=========================================
Forbidden

You don't have permission to access /cgi/ on this server.
=========================================

I check log file and it says:

=========================================
[Tue Mar 13 15:24:39 2007] [error] [client 10.10.93.5] attempt to
invoke directory as script: /sly/www/cgi/
=========================================


I don't know why. I've searched a lot on google, but I can't find any answer.

Could anyone please help me on this?

Thanks a lot.


sly

---------------------------------------------------------------------
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


Re: [users@httpd] Another "attempt to invoke directory as script" Error

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 14.03.07 09:46, Liyu,She wrote:
> I replaced the "SetHandler cgi-script" with "AddHandler cgi-script .html"
> And it worked.
> I always thought that if there's only cgi programs in a directory,
> AddHandler and SetHandler would have no difference(There isn't such problem
> using apache on WIN32). But apparently, SetHandler also treat directories as
> script.

I wonder, why don't you just

ScriptAlias /cgi/ /sly/www/cgi/

- you should get the same behaviour. Or are there some files in that
directory that are not to be executed?

> >On 13/03/07, Liyu,She <li...@gmail.com> wrote:
> >> I am running Apache 2.2.3 on FreeBSD 6.1release.
> >> I was trying to make the /cgi/ path indexed while visiting.
> >> More specifically, I want anyone visiting /cgi/ would be
> >> automatically redirected to /cgi/index.html
> >>
> >> The related configuration part is:
> >> =========================================
> >>     Alias /cgi/ "/sly/www/cgi/"
> >>
> >>     <Directory "/sly/www/cgi/">
> >>         Options Indexes ExecCGI FollowSymLinks
> >>         AllowOverride None
> >>         DirectoryIndex index.html
> >>         Order allow,deny
> >>         Allow from all
> >>         SetHandler cgi-script
> >>     </Directory>

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
He who laughs last thinks slowest. 

---------------------------------------------------------------------
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


Re: [users@httpd] Another "attempt to invoke directory as script" Error

Posted by "Liyu,She" <li...@gmail.com>.
Thanks.
I replaced the "SetHandler cgi-script" with "AddHandler cgi-script .html"
And it worked.
I always thought that if there's only cgi programs in a directory,
AddHandler and SetHandler would have no difference(There isn't such problem
using apache on WIN32). But apparently, SetHandler also treat directories as
script.

Thanks again. Vincent.
Thank you all the same, Ashutosh.

Best regards.

sly

On 3/14/07, Vincent Bray <no...@gmail.com> wrote:
>
> On 13/03/07, Liyu,She <li...@gmail.com> wrote:
> > Hi, everyone.
> >
> > I am running Apache 2.2.3 on FreeBSD 6.1release.
> > I was trying to make the /cgi/ path indexed while visiting.
> > More specifically, I want anyone visiting /cgi/ would be
> > automatically redirected to /cgi/index.html
> >
> > The related configuration part is:
> > =========================================
> >     Alias /cgi/ "/sly/www/cgi/"
> >
> >     <Directory "/sly/www/cgi/">
> >         Options Indexes ExecCGI FollowSymLinks
> >         AllowOverride None
> >         DirectoryIndex index.html
> >         Order allow,deny
> >         Allow from all
> >         SetHandler cgi-script
> >     </Directory>
> > =========================================
> >
> > But I kept knocked off from the /cgi/ location with
> >  403 forbidden http status code. It says:
> >
> > =========================================
> > Forbidden
> >
> > You don't have permission to access /cgi/ on this server.
> > =========================================
> >
> > I check log file and it says:
> >
> > =========================================
> > [Tue Mar 13 15:24:39 2007] [error] [client 10.10.93.5] attempt to
> > invoke directory as script: /sly/www/cgi/
> > =========================================
> >
> >
> > I don't know why. I've searched a lot on google, but I can't find any
> answer.
>
> Bad google! I wrote this up on the wiki. Lemme know if it doesn't work
> out.
>
> http://wiki.apache.org/httpd/Errors/DirectoryAsScript
>
> --
> noodl
>
> ---------------------------------------------------------------------
> 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
>
>

Re: [users@httpd] Another "attempt to invoke directory as script" Error

Posted by Vincent Bray <no...@gmail.com>.
On 13/03/07, Liyu,She <li...@gmail.com> wrote:
> Hi, everyone.
>
> I am running Apache 2.2.3 on FreeBSD 6.1release.
> I was trying to make the /cgi/ path indexed while visiting.
> More specifically, I want anyone visiting /cgi/ would be
> automatically redirected to /cgi/index.html
>
> The related configuration part is:
> =========================================
>     Alias /cgi/ "/sly/www/cgi/"
>
>     <Directory "/sly/www/cgi/">
>         Options Indexes ExecCGI FollowSymLinks
>         AllowOverride None
>         DirectoryIndex index.html
>         Order allow,deny
>         Allow from all
>         SetHandler cgi-script
>     </Directory>
> =========================================
>
> But I kept knocked off from the /cgi/ location with
>  403 forbidden http status code. It says:
>
> =========================================
> Forbidden
>
> You don't have permission to access /cgi/ on this server.
> =========================================
>
> I check log file and it says:
>
> =========================================
> [Tue Mar 13 15:24:39 2007] [error] [client 10.10.93.5] attempt to
> invoke directory as script: /sly/www/cgi/
> =========================================
>
>
> I don't know why. I've searched a lot on google, but I can't find any answer.

Bad google! I wrote this up on the wiki. Lemme know if it doesn't work out.

http://wiki.apache.org/httpd/Errors/DirectoryAsScript

-- 
noodl

---------------------------------------------------------------------
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


Re: [users@httpd] Another "attempt to invoke directory as script" Error

Posted by Ashutosh Mohanty <as...@syncad.com>.
Hi,

 

Something like this might work:

<Location /mydir/script.cgi>
  Options ExecCGI
  SetHandler cgi-script
</Location>

You also need "DirectoryIndex script.cgi" in that directory
Look at AddHandler
(http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler) 

To extend CGI to all .cgi files.

  

Regards

Ashutosh



Liyu,She wrote:
> Hi, everyone.
> 
> I am running Apache 2.2.3 on FreeBSD 6.1release.
> I was trying to make the /cgi/ path indexed while visiting.
> More specifically, I want anyone visiting /cgi/ would be
> automatically redirected to /cgi/index.html
> 
> The related configuration part is:
> =========================================
>     Alias /cgi/ "/sly/www/cgi/"
> 
>     <Directory "/sly/www/cgi/">
>         Options Indexes ExecCGI FollowSymLinks
>         AllowOverride None
>         DirectoryIndex index.html
>         Order allow,deny
>         Allow from all
>         SetHandler cgi-script
>     </Directory>
> =========================================
> 
> But I kept knocked off from the /cgi/ location with
>  403 forbidden http status code. It says:
> 
> =========================================
> Forbidden
> 
> You don't have permission to access /cgi/ on this server.
> =========================================
> 
> I check log file and it says:
> 
> =========================================
> [Tue Mar 13 15:24:39 2007] [error] [client 10.10.93.5] attempt to
> invoke directory as script: /sly/www/cgi/
> =========================================
> 
> 
> I don't know why. I've searched a lot on google, but I can't find any
> answer. 
> 
> Could anyone please help me on this?
> 
> Thanks a lot.
> 
> 
> sly
> 
> ---------------------------------------------------------------------
> 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

---------------------------------------------------------------------
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