LinuxQuestions.org
Help answer threads with 0 replies.
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 10-10-2005, 06:15 AM   #1
fatturi
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Rep: Reputation: 0
Premature end of script headers: CGI


I am having a lot of difficulty configuring httpd.conf to handle CGI.

I edited httpd.conf to add the Alias and ScriptAlias directives as
described in the nagios documentation.

I'm able to access the documentation, but i cannot manage the CGI commands, I keep getting the error: "Premature end of script headers: CGI"

any help?

thank you very much!
 
Old 10-10-2005, 07:09 AM   #2
blindcoder
ROCK Linux
 
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
The first output of a CGI program must be valid HTML headers.
Something like this:
Code:
Content-Type: text/html
Note the one empty line after Content-Type.

HTH,
Benjamin
 
Old 10-11-2005, 02:23 AM   #3
fatturi
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Original Poster
Rep: Reputation: 0
thanks for your reply, i am trying to get nagios to work (Version: 2.0 Release: 0.b4.1)
with my FEDORA core 4, apache 2.0.43 webserver.

when i login to the specified url (http://localhost/nagios) i get to see the nagios index page,
but when i click the left hand menu the page will not load and will give me an internal server error.

when i browse httpd-error.log i find out it gives me this error:

[error] Pemature end of script headers: *.CGI referer: http://127.0.0.1/nagios/side.html

last but not least i'll put my httpd.conf additions for nagios:

ScriptAlias /nagios/cgi-bin/ /usr/local/bin/nagios/
<Directory "/usr/local/bin/nagios/">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

Alias /nagios /usr/local/share/nagios/
<Directory "/usr/local/share/nagios/">
Options None
AllowOverride Authconfig
Order allow,deny
Allow from all
</Directory>

can be this problem due to a different users group? or a wrong setting of external cgi in http.conf?
 
Old 10-11-2005, 04:10 AM   #4
blindcoder
ROCK Linux
 
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
It looks like Apache tries to run side.html as a CGI which is obviously wrong.
Can you post your entire httpd.conf? I suspect an error in there, not just in the part you added.

Greetings,
Benjamin
 
Old 07-19-2007, 04:55 PM   #5
mineshpatel1984
LQ Newbie
 
Registered: Jul 2007
Posts: 2

Rep: Reputation: 0
Hi

I am trying to configure nagios on my server i have configured the .cfg files and have got access to the web interface but after clicking any of the links i get an error:

Server Info:
-------------
Distro: Suse 10.2
S/w: nagios 2.9
Webserver: Apache 2.0

Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: tac.cgi
Error 500

My httpd.conf file section for this looks like:

ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/

<Directory "/usr/local/nagios/sbin">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios /usr/local/nagios/share

<Directory "/usr/local/nagios/share">
Options None
AllowOverride Authconfig
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Each link gives the same error with different cgi file referenced:

Premature end of script headers: tac.cgi

The actual file is in binary so can't read it. Any ideas on what i'm missing or what i can try.

Thanks for your help.

Minesh
 
  


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
Premature end of script headers bhomass Debian 1 12-02-2005 05:31 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
Premature end of script headers webhead Red Hat 5 09-22-2004 01:56 AM
Perl/CGI Problem "Premature Premature end of script headers: countdown.pl" newuser455 Linux - Software 2 07-18-2004 11:47 AM
Premature End of Script Headers (Error 500) bsdb3 Red Hat 5 05-06-2004 11:55 AM

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

All times are GMT -5. The time now is 10:37 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