|
|
|
|
Salut,
# permet le lancement de script cgi par apache si ils ont extension .cgi AddHandler cgi-script .cgi # pour un dossier particulier (et les sous-dossiers) autoriser le lancement # des cgi seul le +ExecCGI est important Alias /test/ "/le_dossier_en_question/" <Directory "/le_dossier_en_question"> Options -Indexes FollowSymLinks MultiViews +ExecCGI AllowOverride None Order allow,deny Allow from all </Directory> Si ton cgi s'appelle premier.cgi, et est localisé dans /le_dossier_en_question l'url à mettre dans ton navigateur (sur la même machine) : http://localhost/test/premier.cgi A+, crabs ..., I think Slackware sounds better than 'Microsoft,' -- Patrick Volkerding - founder and maintainer of Slackware |
Salut,
#! /usr/bin/perl -wT use strict; print "Content-Type: text/html\n\n"; # en-tête print <<HTML; <html> <head> <title>Bonjour</title> </head> <body> <p>Paragraphe 1</p> </body> </html> HTML Dans l'explications de crabs tu as la configuration de httpd.conf pour accepter les scripts cgi avec l'extension .cgi. Une autre possibilité c'est d'utilser la directive ScriptAlias # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the realname directory are treated as applications and # run by the server when requested rather than as documents sent to the client. # The same rules about trailing "/" apply to ScriptAlias directives as to # Alias. # #ScriptAlias /cgi-bin/ "/usr/local/httpd/cgi-bin/" ScriptAlias /cgi-bin/ "/home/usercgi/cgi-bin/" # # # # # "/usr/local/httpd/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # #<Directory "/usr/local/httpd/cgi-bin"> <Directory "/home/usercgi/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> Les options d'origine je les ai mis en commentaires. Exemple: <form action=/cgi-bin/script.pl .........> ou dans le navigateur http://localhost/cgi-bin/script.pl Tu n'est pas obligé de mettre une extension. <form action=/cgi-bin/script .........> ou dans le navigateur http://localhost/cgi-bin/script lami20j |