"Forbidden" error accessing cgi files in browser

"Forbidden" error accessing cgi files in browser

Post by mega » Tue, 11 Apr 2000 04:00:00



I am getting a 'forbidden' error when trying to access my cgi files from the
cgi-bin in my home directory in a browser. I have checked the access.conf
and it SEEMS to be fine. I am able to execute the script from the command
prompt and it works fine in /etc/httpd/cgi-bin but not in
/home/megan/cgi-bin/. Any ideas?

Megan

 
 
 

"Forbidden" error accessing cgi files in browser

Post by Andrew William » Wed, 12 Apr 2000 04:00:00


are they world-execute?


> I am getting a 'forbidden' error when trying to access my cgi files from the
> cgi-bin in my home directory in a browser. I have checked the access.conf
> and it SEEMS to be fine. I am able to execute the script from the command
> prompt and it works fine in /etc/httpd/cgi-bin but not in
> /home/megan/cgi-bin/. Any ideas?

> Megan

--
Mielipiteet omiani - Opinions personal, facts suspect, especially on my
        http://home.germany.net/101-69082/samba.html
Simple Samba Solutions web page.                            ICQ 1722461

 
 
 

"Forbidden" error accessing cgi files in browser

Post by mega » Wed, 12 Apr 2000 04:00:00


Yep,  they have been set to 'chmod 755'  as well as the entire directory.
Also, it is Apache 1.3.9


> are they world-execute?


> > I am getting a 'forbidden' error when trying to access my cgi files from
the
> > cgi-bin in my home directory in a browser. I have checked the
access.conf
> > and it SEEMS to be fine. I am able to execute the script from the
command
> > prompt and it works fine in /etc/httpd/cgi-bin but not in
> > /home/megan/cgi-bin/. Any ideas?

> > Megan

> --
> Mielipiteet omiani - Opinions personal, facts suspect, especially on my
>         http://home.germany.net/101-69082/samba.html
> Simple Samba Solutions web page.                            ICQ 1722461

 
 
 

"Forbidden" error accessing cgi files in browser

Post by ke.. » Wed, 12 Apr 2000 04:00:00


The easiest way would probably be to add

AddHandler cgi-script .cgi

to your httpd.conf file, and then make sure all your cgi scripts end in
.cgi.  I'm guessing you're having this problem because you don't have
a ScriptAlias directive in your config pointing to your personal cgi
directory.  You might also be able to do it with a line like

ScriptAlias /~megan/cgi-bin/ "/home/megan/cgi-bin/"

If none of that works, post (or e-mail) the relevant parts of your
config.

Kevin


> I am getting a 'forbidden' error when trying to access my cgi files from the
> cgi-bin in my home directory in a browser. I have checked the access.conf
> and it SEEMS to be fine. I am able to execute the script from the command
> prompt and it works fine in /etc/httpd/cgi-bin but not in
> /home/megan/cgi-bin/. Any ideas?

> Megan

 
 
 

"Forbidden" error accessing cgi files in browser

Post by mega » Wed, 12 Apr 2000 04:00:00


Thanks, that helped. All I had to do was change the ScriptAlias to what you
recommended but there is one small problem. I have multiple users that are
going to be using their /cgi-bin in their user directories. Is there any
easy way to make this work for all user directories without adding 100's of
these lines (not sure this would even work)?

Megan


> The easiest way would probably be to add

> AddHandler cgi-script .cgi

> to your httpd.conf file, and then make sure all your cgi scripts end in
> .cgi.  I'm guessing you're having this problem because you don't have
> a ScriptAlias directive in your config pointing to your personal cgi
> directory.  You might also be able to do it with a line like

> ScriptAlias /~megan/cgi-bin/ "/home/megan/cgi-bin/"

> If none of that works, post (or e-mail) the relevant parts of your
> config.

> Kevin


> > I am getting a 'forbidden' error when trying to access my cgi files from
the
> > cgi-bin in my home directory in a browser. I have checked the
access.conf
> > and it SEEMS to be fine. I am able to execute the script from the
command
> > prompt and it works fine in /etc/httpd/cgi-bin but not in
> > /home/megan/cgi-bin/. Any ideas?

> > Megan

 
 
 

"Forbidden" error accessing cgi files in browser

Post by ke.. » Wed, 12 Apr 2000 04:00:00


Don't feel like typing 100's of lines of config, huh :)
Try this:

ScriptAliasMatch ^/~(.*)/cgi-bin/(.*) /home/$1/cgi-bin/$2

ScriptAliasMatch let's you use regex's to transform the URL into a
pathname, so that should do what you're looking for.

Kevin


> Thanks, that helped. All I had to do was change the ScriptAlias to what you
> recommended but there is one small problem. I have multiple users that are
> going to be using their /cgi-bin in their user directories. Is there any
> easy way to make this work for all user directories without adding 100's of
> these lines (not sure this would even work)?

> Megan

>> directory.  You might also be able to do it with a line like

>> ScriptAlias /~megan/cgi-bin/ "/home/megan/cgi-bin/"

 
 
 

"Forbidden" error accessing cgi files in browser

Post by mcnu.. » Wed, 19 Apr 2000 04:00:00


This will solve it.  I had the same problem with Apache 1.3.9 (vanilla
RedHat install) just a few days ago.  The AddHandler command seemed the
most straightforward way to do it, since that basically enabled CGIs across
the whole system instead of just in one directory.

--J

: The easiest way would probably be to add

: AddHandler cgi-script .cgi

: to your httpd.conf file, and then make sure all your cgi scripts end in
: .cgi.  I'm guessing you're having this problem because you don't have
: a ScriptAlias directive in your config pointing to your personal cgi
: directory.  You might also be able to do it with a line like

: ScriptAlias /~megan/cgi-bin/ "/home/megan/cgi-bin/"

: If none of that works, post (or e-mail) the relevant parts of your
: config.

: Kevin

:> I am getting a 'forbidden' error when trying to access my cgi files from the
:> cgi-bin in my home directory in a browser. I have checked the access.conf
:> and it SEEMS to be fine. I am able to execute the script from the command
:> prompt and it works fine in /etc/httpd/cgi-bin but not in
:> /home/megan/cgi-bin/. Any ideas?
:>
:> Megan
:>
:>