PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > cgi-bin script errors (8)Exec format error:
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

cgi-bin script errors (8)Exec format error:

Réponse
 
LinkBack Outils de la discussion
Vieux 15/02/2007, 17h56   #1
dj.brainstorm@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut cgi-bin script errors (8)Exec format error:

Hi,

I am trying to setup a cgi-bin for a virtual host... the cgi-bin is
below the public_html folder and i have followed various instructions
re. file permissions, etc but running a simple .pl of .cgi script
causes the following error:

[Thu Feb 15 17:43:38 2007] [error] [client 81.149.XX.XX] (8)Exec
format error: exec of '/var/www/html/www.vegasradio.co.uk/cgi-bin/
first.cgi' failed
[Thu Feb 15 17:43:38 2007] [error] [client 81.149.XX.XX] Premature end
of script headers: first.cgi

The permissions on the cgi-bin folder are 777 and on the first.cgi
file are 755

I have uncommented this line from my httpd.conf file

AddHandler cgi-script .cgi


and this section is contained in the <VirtualHost> container

<Directory /var/www/html/www.vegasradio.co.uk/cgi-bin/>
Order allow,deny
Allow from all
Options ExecCGI Indexes
AddHandler cgi-script .cgi
</Directory>
ScriptAlias /cgi-bin/ /var/www/html/www.vegasradio.co.uk/cgi-bin/


I have tried adding all this manually and via webmin...it still
doesn't work. When I try to run the cgi program at the command line I
get the following error message

../first.cgi: line 3: print: command not found

The location of perl (referred to in first.cgi) is correct


I am now at the point where I have found 2 different pieces of
information and am not sure what to do.... the first relates to
OpenBSD (I'm on Centos4) and mentions apache as being chroot(2) ed...
the second is in the webmin book and mentions suexec


Can anyone advise me as to how I might get my virtual host cgi-bin up
& running?

Thanks!


Brian

  Réponse avec citation
Vieux 15/02/2007, 18h32   #2
dj.brainstorm@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: cgi-bin script errors (8)Exec format error:

ok, i went down the suexec route (using the webmin guide) and i now
have the situation where I get the Internal Server Error 500...upon
examing the suexec_log where the messages are

2007-02-15 18:30:45]: uid: (501/vegasradio) gid: (502/502) cmd:
first.cgi

this happens once for each click...


any ideas?

thanks

  Réponse avec citation
Vieux 15/02/2007, 18h53   #3
dj.brainstorm@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: cgi-bin script errors (8)Exec format error:

i've also tried creating a folder under the default cgi-bin, with
owner and group set accordingly for the folder and file with the same
result as the previous post... i still can't execute at the command
line

  Réponse avec citation
Vieux 16/02/2007, 11h56   #4
dj.brainstorm@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: cgi-bin script errors (8)Exec format error:

problem solved (finally)... the suexec route was working fine...

I also had my first.cgi program in ascii mode but unfortunately the
website where i copied my perl "hello worl" program from had an error
in it (ARGGHHHH!!) no ";" at the end of the 2nd line!!!!

I discovered this by using the vi editor and adding -w to #!/usr/bin/
perl which presumably makes it a bit more verbose in error
reporting... the log files then showed a syntax error at the end of
line 2...

I'm sure all this would have been obvious if I knew any perl but i
didn't so wasted a lot of time... but then again, i have learned a
thing or two....


  Réponse avec citation
Vieux 16/02/2007, 13h43   #5
HansH
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: cgi-bin script errors (8)Exec format error:

<dj.brainstorm@gmail.com> schreef in bericht
news:1171626987.085270.179140@m58g2000cwm.googlegr oups.com...
> problem solved (finally)... the suexec route was working fine...
>
> I also had my first.cgi program in ascii mode but unfortunately the
> website where i copied my perl "hello worl" program from had an error
> in it (ARGGHHHH!!) no ";" at the end of the 2nd line!!!!

If the second line was the last line too, it should not have bothered ...

> I discovered this by using the vi editor and adding -w to #!/usr/bin/

.... your -w reminded me to an issue :
Looks to me you've been bitten by a DOSsie line-end:
DOS uses a two character sequence is <CR><LF> to end aline.
Unix|Linux only recognizes the <LF>, leaving <CR> at the tail of line one.
While processing this shebang line the OS tried to locate
perl<cr>. Adding the param gave the OS a valid delimiter: space.

> perl which presumably makes it a bit more verbose in error
> reporting... the log files then showed a syntax error at the end of
> line 2...

More likely a trailing<cr> removed while adding the ; did teh tric.

>
> I'm sure all this would have been obvious if I knew any perl but i
> didn't so wasted a lot of time... but then again, i have learned a
> thing or two....

Keep counting ;-)


HansH


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h23.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10919 seconds with 13 queries