On Sun, 12 Sep 2004, Octavian Rasnita wrote:
> I have named index.html a file that in fact is a perl cgi program and I have
> put it in the directory /cgi-bin/
>
> It works fine if I access it using an URL like:
>
> http://localhost/cgi-bin/index.html
>
> The problem is that I want to access that program using:
>
> http://localhost/cgi-bin/
>
> But it gives me the 403 Access denied error.
Right -- I don't know that that's possible.
If you're okay with having scripts execute from any directory based on
file extension, then you can do something like this:
* for the directory you want scripts to execute in, find the right
"<Directory ...>" section, and in that the "Options ..." line. Add
ExecCGI to this line. (In a typical httpd.conf, the first Directory
line is for the base of your filesystem, and has very restrictive
access; the second Directory directive is the base of your web
document tree -- adding ExecCGI here is probably what you want.)
* Find the DirectoryIndex line(s), and add a new extension for your CGI
scripts: "DirectoryIndex index.html index.pl index.cgi" etc
Make these changes, then test & re-start Apache:
$ sudo apachectl configtest && sudo apachectl restart
Then try putting a CGI script in your regular document tree -- not the
one that is used for cgi-bin, the one with all your html, images, etc --
and see if it executes the same way it did in the cgi-bin directory. if
so, then try setting the name to index.pl, and see if you urls such as
http;//yoursite/project/index.pl
and
http;//yoursite/project/
end up being the same thing. They should be, but test it.
--
Chris Devers
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>