You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by John Green <jo...@hotmail.com> on 2002/07/03 12:37:34 UTC
setting up apache to accept cgi
hi
I am used to writing perl/cgi programs at uni where i had a public_html
directory for my html, and a cgi-bin directory for my cgi scripts, but have
little experience of setting up apache on my new system to allow cgi.
I have installed mandrake 7.2 and installed the apache module.I don't
currently have a domain name as i have yet to decide what isp to setup, but
i want to write perl/cgi programs as standalone on my machine at home.
I have looked at the apache conf information and faqs, but still not sure,
as i am very new to apache.
my http.conf file has the line scriptalias cgi-bin /var/www/cgi-bin and my
test cgi script as well as the test script by apache is located in this
directory.
it also has the code in the http.conf:
<directory /var/www/protected-cgi-bin>
allow from localhost
the Exec option is set so the directory /var/www/cgi-bin should be fine to
accept cgi scripts.
I tried in my web broswer putting http://localhost/cgi-bin/printenv
with printenv being the cgi test script.
when i do this it comes up with the error forbidden access to
/cgi-bin/printenv
i am not sure what i am doing wrong,
if anyone can see where i am going wrong, or give any advice to setting my
machine up to accept cgi-scripts i would be very greateful.
Thank you
dave
_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: setting up apache to accept cgi
Posted by Rich Bowen <rb...@rcbowen.com>.
On Wed, 3 Jul 2002, John Green wrote:
> <directory /var/www/protected-cgi-bin>
> allow from localhost
>
> the Exec option is set so the directory /var/www/cgi-bin should be fine to
> accept cgi scripts.
>
> I tried in my web broswer putting http://localhost/cgi-bin/printenv
>
> with printenv being the cgi test script.
> when i do this it comes up with the error forbidden access to
> /cgi-bin/printenv
>
> i am not sure what i am doing wrong,
>
> if anyone can see where i am going wrong, or give any advice to setting my
> machine up to accept cgi-scripts i would be very greateful.
Step one is (and this is always the case when you encounter an error)
look in the error logs.
Here's a hint, however. By default, printenv comes without the execute
bits set. This is just for general security reasons - every Apache
server everywhere has this CGI program installed, and so in a default
config, it's just made inaccessible so as to not give crackers any more
information than necessary. So, just try making sure that the file is
executable.
--
Rich Bowen
Apache - mod_perl - Perl - CGI
http://www.ApacheAdmin.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org