View Single Post

  #1 (permalink)  
Old 01-10-2005
bipède
 
Posts: n/a
Default apache 2.0.52 (Fedora core 3) wont run CGI script...

Hi,

Can't execute cgi script (no script simce to work) with apache 2.0.52 on
Fedora 3.

Anyone already met this problem ?


-----------------------------------------------------
* about the scripts :

[... cgi-bin]# ll
total 16
-rwxr-xr-x 1 apache apache 99 Jan 5 14:34 test2.cgi
-rwxr-xr-x 1 apache apache 435 Jan 5 14:31 test.cgi

[... cgi-bin]# cat test2.cgi
#! /bin/bash

echo "ContentType: text/html"
echo ""
echo "<html><body><h1>test</h1></body></html>"

[... cgi-bin]# cat test.cgi
#!/usr/bin/perl -w

print "Content-Type: text/html\n\n";
print <<HTML;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Test</h1>
</body>
</html>
HTML

[... cgi-bin]# pwd
/var/www/cgi-bin

[... cgi-bin]# ./test.cgi
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h1>Test</h1>
</body>
</html>
[... cgi-bin]# ./test2.cgi
ContentType: text/html

<html><body><h1>test</h1></body></html>


(working with "su -s /bin/bash - apache" apache is the apache deamon user)

-----------------------------------------------------
* apache conf:

[...]
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
[...]

et même :

[...]
AddHandler cgi-script .cgi

<Directory "/var/www/html">

Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all

</Directory>

(cgi scripts dont work in cgi-bin, nor in
DocumentRoot)

-----------------------------------------------------
* server send error :

Internal Server Error

in the log :

[Fri Jan 07 10:24:32 2005] [error] [client xxx.xxx.xxx.xxx]
(13)Permission denied: exec of '/var/www/cgi-bin/test.cgi' failed
[Fri Jan 07 10:24:32 2005] [error] [client xxx.xxx.xxx.xxx] Premature
end of script headers: test.cgi

-----------------------------------------------------

any ideas are welcome !