apache 2.0.52 (Fedora core 3) wont run CGI script...

This is a discussion on apache 2.0.52 (Fedora core 3) wont run CGI script... within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi, Can't execute cgi script (no script simce to work) with apache 2.0.52 on Fedora 3. Anyone ...


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 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 !
  #2 (permalink)  
Old 01-10-2005
bingster
 
Posts: n/a
Default Re: apache 2.0.52 (Fedora core 3) wont run CGI script...

In your test.cgi script, try to add an extra blank line so it's like this:

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

Bing

bipède wrote:

> 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 !

  #3 (permalink)  
Old 01-13-2005
bob
 
Posts: n/a
Default Re: apache 2.0.52 (Fedora core 3) wont run CGI script...

bingster wrote:

> In your test.cgi script, try to add an extra blank line so it's like this:
>
> print "Content-Type: text/html\n\n";
> print "\n";
>
> Bing
>


The same. thanks for your answer anyway.
  #4 (permalink)  
Old 01-18-2005
Rich
 
Posts: n/a
Default Re: apache 2.0.52 (Fedora core 3) wont run CGI script...

Under Fedora Core 3, SELinux is enabled in its "enforcinfg" mode which
basically means that it is completely turned on with all security
features enabled.

Now, I haven't dealt with this myself since I am still at FC2, but I
have read a couple of posts on a mailing list that I am on for a
particular software package where others have had CGI-ish problems
under FC3.

If you are not familiar with SELinux, that's ok.. SELinux is a security
layer that, when used properly, futher secures that linux box of yours
down in a very good way. It does block file access (execute and write)
to all files from the web server, despite what the local file
permission settings are. I'm guessing this is the cause of your
problem..

The solution that was presented on the mailing list (and, again, I have
not been in the situation to try this) was to change the setting of
SELinux from it's fully-enforce mode to it's warn-only mode. Changing
this does require a reboot of the machine.

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

Rich wrote:
> Under Fedora Core 3, SELinux is enabled in its "enforcinfg" mode which
> basically means that it is completely turned on with all security
> features enabled.
>
> Now, I haven't dealt with this myself since I am still at FC2, but I
> have read a couple of posts on a mailing list that I am on for a
> particular software package where others have had CGI-ish problems
> under FC3.
>
> If you are not familiar with SELinux, that's ok.. SELinux is a security
> layer that, when used properly, futher secures that linux box of yours
> down in a very good way. It does block file access (execute and write)
> to all files from the web server, despite what the local file
> permission settings are. I'm guessing this is the cause of your
> problem..
>
> The solution that was presented on the mailing list (and, again, I have
> not been in the situation to try this) was to change the setting of
> SELinux from it's fully-enforce mode to it's warn-only mode. Changing
> this does require a reboot of the machine.
>


Yes thanks, that's it I turn it off and now it works...
Dont have time to understand the policy configuration, I'm very tired of
this kind of changes. Maybe Linux Fedora crew is very pleased with there
new game, but that's not my case. :(
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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 05:47 AM.


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