URL: https://linuxfr.org/forums/linux-debian-ubuntu/posts/faire-marcher-les-cgi Title: Faire marcher les CGI Authors: carlo Date: 2008年02月07日T11:44:47+01:00 Tags: cgi et debian Score: 0 Bonjour, depuis hier, je me rends fou à essayer de faire tourner les CGI sur ma machine avec Apache2 sur Debian Etch. J'ai d'abord essayer de le faire dans le public_html de mon utilisateur, mais en vain, je me suis donc rabattu vers le virtual host par défaut qui permet logiquement de faire tourner les CGI si ils sont situés dans /usr/lib/cgi-bin. Pour info, mon CGI python est tiré du bouquin Programmin Python 3rd edition et contient #!/usr/bin/python text = """Content-type: text/html CGI 101 A Second CGI script Hello, CGI World! """ print text , est appelé tutor1.cgi, a les droits qu'il faut (je pense) # ls -la /usr/lib/cgi-bin drwxr-xr-x 2 www-data www-data 4096 2008年02月07日 10:07 . drwxr-xr-x 176 root root 77824 2008年02月07日 10:25 .. -rwxr-xr-x 1 www-data www-data 179 2008年02月06日 17:19 tutor1.cgi Pour autant, j'ai toujours dans /var/log/apache2/error.log [Thu Feb 07 10:29:53 2008] [error] [client 127.0.0.1] (2)No such file or directory: exec of '/usr/lib/cgi-bin/tutor1.cgi' failed [Thu Feb 07 10:29:53 2008] [error] [client 127.0.0.1] Premature end of script headers: tutor1.cgi Que faire ? Qu'ai-je oublié ? au cas ou # dpkg -l |grep apache ii apache2-mpm-prefork 2.2.3-4+etch3 Traditional model for Apache HTTPD 2.1 ii apache2-utils 2.2.3-4+etch3 utility programs for webservers ii apache2.2-common 2.2.3-4+etch3 Next generation, scalable, extendable web server ii libapache2-mod-perl2 2.0.2-2.4 Integration of perl with the Apache2 web server ii libapache2-mod-php5 5.2.0-8+etch10 server-side, HTML-embedded scripting language (apache 2 module) ii libapache2-mod-python 3.2.10-4 Apache 2 module that embeds Python within the server