LinuxQuestions.org
Review your favorite Linux distribution.
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, 07: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, 08: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, 03: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, 05: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, 05: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


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

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

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