LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-07-2011, 04:01 AM   #1
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Rep: Reputation: 1
Question 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.

Last edited by j.smith1981; 03-07-2011 at 04:16 AM.
 
Old 03-07-2011, 07:58 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
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
 
1 members found this post helpful.
Old 03-07-2011, 09:17 AM   #3
j.smith1981
Member
 
Registered: Feb 2009
Distribution: Mainly CentOS6.4 x64
Posts: 161

Original Poster
Rep: Reputation: 1
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cgi-bin error 403 Forbidden You do not have permission to access this document. samguy Linux - Newbie 13 06-02-2010 02:04 AM
Apache2 cgi-bin Forbidden Access cluckshot Linux - Software 5 01-09-2009 12:26 PM
CGI-bin Directory Request = 403 Forbidden King4lex Linux - Server 1 04-10-2007 09:43 PM
Apache2 virtual host cgi 403 Forbidden / mossy Linux - Software 15 07-27-2005 04:56 PM
cgi-bin (object not found, access forbidden) orish Linux - Newbie 3 05-24-2004 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration