LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-30-2004, 12:19 PM   #1
baby_linu
LQ Newbie
 
Registered: Feb 2004
Distribution: RH8, Fedora
Posts: 10

Rep: Reputation: 0
Failed to execute cgi script in Apache!!


Hi,

I wroe a sample cgi program on Apache.But it is not working..!!

I had done the following steps.

1) Edited the httpd.conf file

Directory "/var/www/cgi-bin">
# AllowOverride None
Options +ExecCGI
#Order allow,deny
#Allow from all
</Directory>

ScriptAlias /cgi-bin/ /var/www/cgi-bin/

2)Put the sample script on /var/www/cgi-bin/

3) Change the permissions of /var/www/cgi-bin/ and its contents to 755

But it is not working!!
The error messege displayed by the browser is (when the URL is http://server.com/cgi-bin/

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster
Error 403

When typing the URL as http://server.com/cgi-bin/sample.pl
the error messege is


Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster
Error 404

What is the problem ??? Help me
 
Old 06-30-2004, 12:44 PM   #2
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Look at your error logs. Usually you can just look around your config file and find the various places for your error log. Open that file and see what apache says about it. Anytime apache gives an error, there is a relavent line written in the log about it. Usually this will tell you the problem. If that doesn't seem to help, maybe try posting your config file for everyone to see.
 
Old 06-30-2004, 12:53 PM   #3
baby_linu
LQ Newbie
 
Registered: Feb 2004
Distribution: RH8, Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
The condition is improving!!

One problem is solved!!
the problem was i added the ScriptAlias directive after setting the cgi-bin directory.
Now the error messege is changed

Server error!

The server encountered an internal error and was unable to complete your request.

Error message:
Premature end of script headers: example1.pl

If you think this is a server error, please contact th

Thank u
 
Old 06-30-2004, 01:22 PM   #4
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Is that the message shown in the error log as well? Maybe post the script you're trying to run so we can see what might be wrong with it. Also be sure your script is in unix format and not PC format. Unix format uses line feeds -- PC format uses carriage returns. If you created this file on the PC, it likely has CR so you just need to change them to LF's.
 
Old 06-30-2004, 04:23 PM   #5
baby_linu
LQ Newbie
 
Registered: Feb 2004
Distribution: RH8, Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
Thank u fro ur reply... the problem is now solved... now i can execute sample cgi programs
 
  


Reply



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
RH -> Debian migration breaks CGI script under Apache miggins Debian 1 09-02-2005 02:42 AM
how to execute shell scripts from cgi script rajatgarg Linux - General 1 07-08-2004 01:39 PM
Apache cgi-script problem palanisaravanan Linux - General 6 02-07-2004 09:41 AM
Apache CGI Problem : Browser not running script Zaknafien Linux - Software 3 12-31-2003 01:16 PM
Apache Config for users to execute CGI scripts CragStar Linux - General 9 01-20-2003 12:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:49 AM.

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