green
2003-12-26, 04:19 PM
Apache2048測試CGI的環境
於Win2kSP4中進行動態IP架站測試CGI的環境。
No-IP DUC(動態IP轉網域)。
Apache2048。
ActivePerl580806
可以看到Apache預設首頁。
ActivePerl5808060 安裝於C:\usr中。
遂進行修改Apache之httpd.conf修改以利執行。
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"
<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
亦增設
AddHandler cgi-script .cgi.pl
執行Apache2048之cgi-bin內原有的printenv.pl,有修改其內描述Perl所在路徑為
!/usr/bin/perl或是!c:/usr/bin/perl.exe。
於瀏覽器中輸入 http://localhost/cgi-bin/printenv.pl。
但卻出現500 Internal Server Error錯誤。
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
描述Perl所在路徑的兩種方式都試過,均出現錯誤訊息。
遍尋網路資源仍不得其門而入,請能者釋疑。再次感謝!
=====================================================
printenv.pl之內容
!c:/usr/bin/perl.exe
#!c:/Perl/bin/Perl.exe
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}
贊助商連結
於Win2kSP4中進行動態IP架站測試CGI的環境。
No-IP DUC(動態IP轉網域)。
Apache2048。
ActivePerl580806
可以看到Apache預設首頁。
ActivePerl5808060 安裝於C:\usr中。
遂進行修改Apache之httpd.conf修改以利執行。
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"
<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
亦增設
AddHandler cgi-script .cgi.pl
執行Apache2048之cgi-bin內原有的printenv.pl,有修改其內描述Perl所在路徑為
!/usr/bin/perl或是!c:/usr/bin/perl.exe。
於瀏覽器中輸入 http://localhost/cgi-bin/printenv.pl。
但卻出現500 Internal Server Error錯誤。
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
描述Perl所在路徑的兩種方式都試過,均出現錯誤訊息。
遍尋網路資源仍不得其門而入,請能者釋疑。再次感謝!
=====================================================
printenv.pl之內容
!c:/usr/bin/perl.exe
#!c:/Perl/bin/Perl.exe
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}
贊助商連結