Web Servers on Unix and Linux - Apache cgi script configuration problem.

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > August 2005 > Apache cgi script configuration problem.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache cgi script configuration problem.
Autumn-Fox

2005-08-18, 5:51 pm

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 ).

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com