apache執行CGI程式的配置?

Tags: 作者, 程式,

apache執行CGI程式的配置

工具/原料

apache軟體

方法/步驟

下載安裝apache,下面以2.0.63為例介紹執行CGI程式的配置。

下載Windows下的Perl直譯器ActivePerl最新版本ActivePerl- 5.10.0.1003,假設安裝路徑為c:\Perl

修改apache的配置檔案httpd.conf: AllowOverride None Options None Order allow,deny Allow from all #AddHandler cgi-script .cgi改為: AllowOverride None Options ExecCGI Order allow,deny Allow from all AddHandler cgi-script .cgi .pl

編寫perl指令碼程式hello.pl#!C:\Perl\bin\perl.exeprint "content-type: text/html","\n\n";print "","\n";print "","\n";print "Perl","\n";print "","\n";print "","\n";print "

Hello World

","\n";print "","\n";print "","\n";

將程式拷貝到apache安裝目錄下cgi-bin資料夾下.

啟動apache伺服器,開啟瀏覽器,輸入結果如圖:

apache執行CGI程式的配置

相關問題答案