LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2003, 07:39 PM   #1
Kwasi
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Rep: Reputation: 0
redhat 9 cgi problems


Hi everyone.

Can't seem to get "any" simple cgi scripts to run in redhat9 installs.

Nothing special about them or the installs.
All is typical and simple
and yes, the permissions and locations are a-ok

installed redhat7.3 a bit earlier and ALL the same scripts ran fine.

just did a new install of redhat9 and the "exact" same scripts give me 500 errors . . . .

whats the deal on vers9 versus vers7.3 ???

what changed and where should I be looking to solve this.

makes no sense.

gotta be something simple being overlooked . . . .
 
Old 08-01-2003, 07:50 PM   #2
elam
LQ Newbie
 
Registered: Aug 2003
Posts: 21

Rep: Reputation: 15
What happpens when you run from the command line?
What errors are you getting?
 
Old 08-01-2003, 08:01 PM   #3
Kwasi
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
from the browser i'm calling the scripts:

http://www.zites.com/cgi-bin/wholite.cgi

my error log entries when I do this

[Thu Jul 31 13:17:39 2003] [error] [client 65.171.###.###] Premature end of script headers: wholite.cgi

I tried all kinda simplistic scripts with the same errors each time no matter what . . . .
env.pl
wholite.cgi
plus a whole bunch of others that i "know" work ok . . .


they DO seem to execute properly when i run them in a terminal window however.

[cgi-bin]# perl env.pl



is the default install of redhat 9 stopping cgi's from being executed unless i change something somewhere????

httpd.conf didn't seem to have anything i should be changing like that anywhere . . . .

I know the permissions and the directory paths are OK.
I keep thinking there is some little itsy bitsy thing I'm overlooking.

darn puzzling
 
Old 08-01-2003, 08:48 PM   #4
elam
LQ Newbie
 
Registered: Aug 2003
Posts: 21

Rep: Reputation: 15
Are you sure your permissions are correct? The apache deamon may not be running as root, and my not be able to execute scripts.
You might wanna try adding:


use CGI::Carp qw(fatalsToBrowser);


if it's not there already. This may give you a more descriptive error than 'premature end of script headers'. Although I tried the link above and I got redirected to a search engine page, I assume because of the error in executing the cgi script, so you probably won't see anything at all.

Last edited by elam; 08-01-2003 at 08:50 PM.
 
Old 08-01-2003, 09:02 PM   #5
Kwasi
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
all these same scripts ran fine earlier today on redhat7.3

i just tried the wholite.cgi in a terminal window and it seems to make all the html code that would output as a webpage

I did a search here on "cgi" problems and there seem to be some folks who had somewhat similar problems in 7.3, although not really, and not many real solutions were givem

can't seem to find anything specific towards about this on the apache site either.

I just can't fathom what's changed so drastically from a 7.3 to a 9 to stop all cgi's from running and where to add or change something so they do run.

(ps, the "zites" domain i used in the text is fictional)
 
Old 08-01-2003, 09:03 PM   #6
Kwasi
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
i forgot to add, I just checked the permissions and they are all ok
 
Old 08-02-2003, 02:33 PM   #7
HappyDude
Member
 
Registered: Jul 2003
Posts: 140

Rep: Reputation: 15
Do you have this as the second line of your program?:
Code:
print "Content-type: text/html\n\n";
 
Old 08-02-2003, 03:18 PM   #8
Kwasi
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
these aren't my programs, off the shelf stuff from places like cgi-resources, etc

they all run fine as is on redaht 7.3 / apache 1.3
all fail to run in redhat 9 / apache 2.0

they even all run in NT

gotta be somethinsg else i'm missing in either redhat or in apache

probably apache, but can't seem to get my finger on it
 
Old 08-02-2003, 06:12 PM   #9
elam
LQ Newbie
 
Registered: Aug 2003
Posts: 21

Rep: Reputation: 15
why dont you post your httpd.conf file?
 
Old 08-02-2003, 07:28 PM   #10
Kwasi
LQ Newbie
 
Registered: Aug 2003
Posts: 6

Original Poster
Rep: Reputation: 0
its the default httpd.conf file.

there are no changes made to it.

i've been trying to run these scripts without even getting into virtual hosts
 
Old 09-03-2003, 12:32 PM   #11
Zionpreach
LQ Newbie
 
Registered: Sep 2003
Distribution: Redhat, mandrake, suse, etc
Posts: 1

Rep: Reputation: 0
Exclamation

I have found also that there seems to be some difference between RedHat 9.0 and RedHat 7.2. I hav ebeen for several days try to configure the same stuff, with a constant failure. I have a working 7.2 that allows the scripts to run, yet the identical configuration (Or as much as possible) on my 9.0 and it fails.

Everything works in the terminal, yet not via the browser. The scripts I have tired are know working scripts, in both terminal and web, yet in 9.0 they only work in terminal.

I had recieved the message Access forbidden... I veriify my configuration and have to unremark the following lines...

# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options ExecCGI MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>

then it by passes that error and gives me a ...

"Premature end of script headers: test.cgi"

I cannot figure out why... the files have the permission necessary 7 5 5.

One thing of extra interest I even tired to give access to both User nobody, group nobody, and still on difference.

If you need more information I can try to help.... but am as you see, in need of it myself.


Last edited by Zionpreach; 09-03-2003 at 12:50 PM.
 
Old 09-07-2003, 11:04 PM   #12
a_morgan
LQ Newbie
 
Registered: Nov 2002
Location: BC, Canada
Distribution: Red Hat 9
Posts: 12

Rep: Reputation: 0
I was experiencing similar errors and just found my problem.

The scripts I had successfully run on 7.2 had a different directory for perl (The script had the line #!/usr/local/bin/perl but for RedHat 9 I need this to be #!/usr/bin/perl).

I hope this helps.
 
Old 09-16-2003, 11:23 AM   #13
Linux_cgi
LQ Newbie
 
Registered: Sep 2003
Posts: 1

Rep: Reputation: 0
Hi Kwasi,

Have you solved the problem? Please tell me how you what you have done since I have the same problem like you had.
 
  


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
cgi-bin in RedHat 7.1 Citizen Bleys Linux - Networking 10 03-27-2006 10:02 PM
plesk and cgi on redhat 9 techhost Linux - Software 0 03-03-2004 11:47 PM
CGI Script add user to redhat 9 djkoe Linux - General 1 02-08-2004 05:20 PM
Redhat 9 / Apache / cgi-bin ???? jeff0628 Linux - General 16 10-18-2003 07:50 AM
Redhat 9, cgi-bin for users linuxturtle Linux - Networking 2 09-25-2003 10:05 AM


All times are GMT -5. The time now is 10:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration