Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 13152

Summary: Apache 2.0.43-r1 fails on executing scripts at user's cgi-bin (/home/*/public_html/cgi-bin)
Product: Gentoo Linux Reporter: Pekka-Matti Nieminen <pmn>
Component: [OLD] ServerAssignee: Donny Davies (RETIRED) <woodchip>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: 1.4_rc1   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Pekka-Matti Nieminen 2003-01-03 06:44:12 UTC
Hiya folks,

I installed Apache 2 on my Gentoo system by "emerge apache2". Started daemon 
with "/etc/init.d/apache2 start" and browsed into http://localhost/~user/cgi-
bin/test.cgi. Http error 500 hits on screen. Apache's errorlog contains a line:

[snip]
[Fri Jan 03 13:41:20 2003] [error] [client 192.168.0.2] Premature end of 
script headers: test.cgi
[/snip]

Guess: the script dies before sending output..

I move the script into /home/httpd/cgi-bin folder, which is a scriptalias'ed 
folder for http://localhost/cgi-bin. I browse http://localhost/cgi-
bin/test.cgi and screen has text: "testing".

The test.cgi contais next three lines:
  #!/usr/bin/perl
  print "Content-type: text/html\n\n";
  print "<html>testing</html>";

I disabled all apache (and apache2) "extra" modules that may interfere 
executing the script, restarted apache2 and no difference. Not any other 
modifactions were made, so all other is default in config files.



[my make.conf contains:]
USE="x86 -alsa apache2 apm arts avi crypt cups encode gif -gnome gpm gtk imap
imlib java jpeg kde -ldap libg++ libwww mbox mikmod mmx motif mpeg ncurses nls
oggvorbis opengl pam pdflib perl png python qt qtmt quicktime readline samba
scanner sdl slang snmp spell ssl svga tcpd truetype X xml2 xmms xv zlib"

CXXFLAGS="${CFLAGS}"

CHOST='i586-pc-linux-gnu'
CFLAGS='-march=pentium-mmx -mcpu=pentium-mmx -O3 -pipe'
CXXFLAGS='-march=pentium-mmx -mcpu=pentium-mmx -O3 -pipe'

ACCEPT_KEYWORDS="~x86"
[/make.conf]

Some of my system components' versions:
  gcc 3.2.1-r6
  glibc 2.3.1-r3
  perl 5.8.0-r7
  apache 2.0.43-r1
  gentoo-sources 2.4.19-r10
Comment 1 Donny Davies (RETIRED) gentoo-dev 2003-01-04 06:49:08 UTC
why dont you try adding this to your configuration...

ScriptAliasMatch ^/~([^/]*)/cgi-bin/(.*) /home/$1/public_html/cgi-bin/$2

Comment 2 Donny Davies (RETIRED) gentoo-dev 2003-01-21 23:00:25 UTC
added to commonapache2.conf