Exec format error

Exec format error

am 05.06.2007 17:31:17 von vivekian

Hi,

After setting up Fedora Core 7 on my machine, ran apache with its
default configuration.
Somehow can't get the cgi scripts to run. The error_log file indicates
the following error :

Tue Jun 05 10:02:36 2007] [error] [client 127.0.0.1] (8)Exec format
error: exec of '/var/www/cgi-bin/route.cgi' failed
[Tue Jun 05 10:02:36 2007] [error] [client 127.0.0.1] Premature end of
script headers: route.cgi

This script runs fine on the command interpreter and has worked fine
previously with other . The permissions seem to be okay. Read and
Execute access is granted to Group and Others for files within the cgi-
bin directory. Is there anything else i should be looking out for ?
The script is given below :

#!/usr/bin/perl -w

use strict;
use CGI;

my $ROUTE = 'cat /proc/net/route';
my $q = new CGI;
local *PIPE ;
open PIPE, "$ROUTE |" ;
print "Content-type: text/plain\n\n";
print while ;
close PIPE;

These are the relavant portions of the httpd.conf file

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#

AllowOverride None
Options None
Order allow,deny
Allow from all

Re: Exec format error

am 05.06.2007 18:01:33 von Mark Taylor

vivekian wrote in news:1181057477.564127.17180
@g4g2000hsf.googlegroups.com:

> Hi,
>
> After setting up Fedora Core 7 on my machine, ran apache with its
> default configuration.
> Somehow can't get the cgi scripts to run. The error_log file indicates
> the following error :
>
> Tue Jun 05 10:02:36 2007] [error] [client 127.0.0.1] (8)Exec format
> error: exec of '/var/www/cgi-bin/route.cgi' failed
> [Tue Jun 05 10:02:36 2007] [error] [client 127.0.0.1] Premature end of
> script headers: route.cgi
>
> This script runs fine on the command interpreter and has worked fine
> previously with other . The permissions seem to be okay. Read and
> Execute access is granted to Group and Others for files within the cgi-
> bin directory. Is there anything else i should be looking out for ?
> The script is given below :
>
> #!/usr/bin/perl -w
>
> use strict;
> use CGI;
>
> my $ROUTE = 'cat /proc/net/route';
> my $q = new CGI;
> local *PIPE ;
> open PIPE, "$ROUTE |" ;
> print "Content-type: text/plain\n\n";
> print while ;
> close PIPE;
>
> These are the relavant portions of the httpd.conf file
>
> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
>
> #
> # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
> # CGI directory exists, if you have that configured.
> #
>
> AllowOverride None
> Options None
> Order allow,deny
> Allow from all
>

>
>

Somewhere there needs to be an:

Options ExecCgi


Have you tried that, or even a simple "hello world" script instead a
complex script?



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Re: Exec format error

am 05.06.2007 22:58:08 von vivekian

On Jun 5, 11:01 am, Mark Taylor wrote:
> vivekian wrote in news:1181057477.564127.17180
> @g4g2000hsf.googlegroups.com:
>
>
>
> > Hi,
>
> > After setting up Fedora Core 7 on my machine, ran apache with its
> > default configuration.
> > Somehow can't get the cgi scripts to run. The error_log file indicates
> > the following error :
>
> > Tue Jun 05 10:02:36 2007] [error] [client 127.0.0.1] (8)Exec format
> > error: exec of '/var/www/cgi-bin/route.cgi' failed
> > [Tue Jun 05 10:02:36 2007] [error] [client 127.0.0.1] Premature end of
> > script headers: route.cgi
>
> > This script runs fine on the command interpreter and has worked fine
> > previously with other . The permissions seem to be okay. Read and
> > Execute access is granted to Group and Others for files within the cgi-
> > bin directory. Is there anything else i should be looking out for ?
> > The script is given below :
>
> > #!/usr/bin/perl -w
>
> > use strict;
> > use CGI;
>
> > my $ROUTE = 'cat /proc/net/route';
> > my $q = new CGI;
> > local *PIPE ;
> > open PIPE, "$ROUTE |" ;
> > print "Content-type: text/plain\n\n";
> > print while ;
> > close PIPE;
>
> > These are the relavant portions of the httpd.conf file
>
> > ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
>
> > #
> > # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
> > # CGI directory exists, if you have that configured.
> > #
> >
> > AllowOverride None
> > Options None
> > Order allow,deny
> > Allow from all
> >

>
> Somewhere there needs to be an:
>
> Options ExecCgi
>
> Have you tried that, or even a simple "hello world" script instead a
> complex script?
>

It worked with a simpler script. Don't think the server had
permissions to execute to read the route file.