LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 03-31-2006, 08:49 PM   #1
baruah
LQ Newbie
 
Registered: Feb 2006
Distribution: RH9.0, RHEL 4
Posts: 12

Rep: Reputation: 0
Unhappy 500 Internal Server Error/Premature end of script headers


Hi,
sorry for the repeating the same question. I believe many have encountered this and find a solution.

Problem is when I try to execute a CGI script from anyone of the user's directory I'm get the error
"Premature end of script headers:". The script works just fine from the "/var/www/cgi-bin" which is set as ScriptAliase.

In order run the script from the user's directory I have added the following in the httpd.conf file

AddHandler cgi-script .cgi
<Directory /home/*/public_html/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>

Changed the ownership of the script to apache:apache and permission to 755

The script is

#!/bin/bash
echo Content-type: text/plain
echo ""
echo ""
/usr/bin/cal
echo ""

Can anyone help me please to run this ? I'm using "httpd-2.0.52-19.ent" on "2.6.9-22.EL" Kernel.

Thanks
Baruah
 
Old 04-01-2006, 05:10 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,167
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
The only thing that comes in mind since you can execute your script from /var/www/cgi-bin is that you use suexec. Check with
Code:
/path/to/apache/bin/apachectl -V
or take a look at the logs when you restart apache to see if that's the case. Then you can either disable it, or read the whole document of the previous link in order to configure it correctly
 
  


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
FAQ: Internal Server Error / Premature End of Script Header / MS-DOS Carriage Return rebel Red Hat 2 04-30-2005 03:11 PM
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 - Software

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