LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   cgi-bin again being forbidden on my virtual host site (https://www.linuxquestions.org/questions/linux-server-73/cgi-bin-again-being-forbidden-on-my-virtual-host-site-866911/)

j.smith1981 03-07-2011 04:01 AM

cgi-bin again being forbidden on my virtual host site
 
I am having yet another problem with getting forbidden on my cgi-bin folder in Centos 5.5, here are my versions of perl:

I typed in: "perl --version" this came up:
Quote:

This is perl, v5.8.8 built for i386-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Then I typed in "rpm -q mod_perl" as this is the language I am wanting to write in and this came up:

Quote:

mod_perl-2.0.4-6.el5
Is there a compatibility problem with these versions at all?

I was following this tutorial again:

http://httpd.apache.org/docs/1.3/howto/cgi.html

Then added these in:
Quote:

ScriptAlias /cgi-bin/ /www/example.com/cgi-bin/

<Directory /www/example.com/cgi-bin>
Options +ExecCGI
Order deny,allow
Allow from all
</Directory>
Then of course:
Quote:

AddHandler cgi-script cgi pl
But its now bringing up instead of:
Quote:

client denied by server configuration: /www/example.com/cgi-bin/
It's bringing up:
Quote:

attempt to invoke directory as script: /www/example.com/cgi-bin/
Is there any obvious error I am making here as to why its bringing this error message up?

Thanks and I look forward to any replies,
Jez.

PS I have run the script and its producing output from the shell not a web browser, tried using:

Quote:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";
Same error so it can't be the program/script itself, must be something wrong with my configs, but of course it could be the headers in the output to html?

This is the script of course:
Quote:

#!/usr/bin/perl
print "Hello, World.";
Double checked the which perl command and its coming up with the same directory.

Hmm I'm really confused.

bathory 03-07-2011 07:58 AM

Hi,

You need to give the full URI, including the script's name in order not to get this error. Something like: http://www.example.com/cgi-bin/script.cgi
Or you can add script.cgi in the DirectoryIndex directive

Note also that your script should be like the 1st one (containing the Content-type line):
Quote:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";
Regards

j.smith1981 03-07-2011 09:17 AM

Ah thank you for reminding me.

It works now, what it actually was also was of course my file permissions!

Thank you ever so much!

Jez.


All times are GMT -5. The time now is 08:21 AM.