Apache cgi script configuration problem.

This is a discussion on Apache cgi script configuration problem. within the Linux Web Servers forums, part of the Web Server and Related Forums category; Problem: unknown reason to "premature ending of script headers" error message I run a simple perl cgi problem ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-18-2005
Autumn-Fox
 
Posts: n/a
Default Apache cgi script configuration problem.

Problem: unknown reason to "premature ending of script headers" error
message

I run a simple perl cgi problem on my machine.

---------------------------hello.cgi-------------------------------
#! /usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
{
local ($oldbar) = $|;
$cfh = select (STDOUT);
$| = 1;
print "Content-type: text/html\n\n";
$| = $oldbar;
select ($cfh);
}

print "hello\n";
--------------------------------------------------------------------

I run it in some other places and works fine.

Now I upload to another server and got the error message I mentioned.(
I checked it with pico first.)
I changed my configuration file for httpd as follows:

uncomment "UserDir public_html",
uncomment the following:
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options 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>

add the following
<Directory /home/*/public_html/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>

uncomment addHandler cgi-script .cgi

-------------------------------------
Then I changed the following file permissions:
chmod 711 /home/*
chmod 755 /home/*/public_html
chmod 755 /home/*/public_html/*.html
chmod 755 /home/*/public_html/cgi-bin
chmod 755 /home/*/public_html/cgi-bin/*.cgi

And the machine still still gives me the error

But if I use the ScriptAlias
ScriptAlias /cgi-bin2/ /home/span/public_html/cgi-bin/

I can run the hello.cgi well from http://localhost/cgi-bin2/

I want to know what could be the reason I can't run my cgi from
http://localhost/~span/cgi-bin /hello.cgi
(span is one of the users ).

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:38 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0