Erreur script cgi avec Apache

Adrael Messages postés 19 Statut Membre -  
 goji -
Bonjour,

j'utilise Apache avec Ubuntu. (Apache/2.2.3 (Ubuntu) PHP/5.2.1)

Je voudrais tester l'exécution du script cgi suivant : salut.cgi, qui est dans /usr/lib/cgi-bin

#!/bin/sh

cat << EndFile
Content-type: text/html

<HTML>
<HEAD><TITLE>Mon premier script CGI</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF">
<BR><BR><BR><BR>
<CENTER>
<H1>Salut &agrave; tous<p>voici mon premier script CGI</H1>
</CENTER>
</BODY>
</HTML>

EndFile


Hors, lorsque je tape dans firefox : http://localhost/cgi-bin/salut.cgi

J'obtiens :

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 webmaster@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.3 (Ubuntu) PHP/5.2.1 Server at localhost Port 80</address>
</body></html>


Et je ne comprens pas pourquoi il y a cette erreur...Je précise que dans mon fichier de conf dans sites-enabled, j'ai :

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

Pourquoi mon script n'est pas bien lu par le navigateur ?
A voir également:

1 réponse

goji
 
Salut,

si ton pb n'est pas résolu, il faut probablement modifier les droits d'execution de ton script.
Un sudo chmod 755 salut.cgi devrait le faire fonctionner.
-2