+ -
当前位置:首页 → 问答吧 → 请教CGI 和HTML 的一个问题

请教CGI 和HTML 的一个问题

时间:2011-07-26

来源:互联网

#!c:\perl\bin\perl
# Send this output to the brovser
print "Content-type: text/plain\n\n";
print "Hello, world!\n";

我把这个脚本放在C:\template\new,文件名为test.pl. 怎样在浏览器中调用这个脚本。是这样么 http://localhost/template/new/test.pl?
请指点!

test.zip (251 Bytes)

下载次数:0

2011-07-26 16:54

作者: Crystalyyin7   发布时间: 2011-07-26

需要配置http,配置如下
<VirtualHost *:80>
    ServerName devel.release.com
    DocumentRoot "/html/"

    <Directory /html/>
      Options FollowSymLinks
      AllowOverride None
      Order deny,allow
      Allow from all
    </Directory>

    <IfModule dir_module>
      DirectoryIndex login.html
    </IfModule>

    HostnameLookups off
    <Files ~ "\.(html|cgi)$">
      HostnameLookups on
    </Files>

    ScriptAlias /cgi-bin/ C:\template\new
    <Directory C:\template\new>
      Options +ExecCGI
      AddHandler cgi-script .cgi
      AllowOverride None
      Order Deny,Allow
      Allow from all
    </Directory>
    ErrorLog "logs/www.com-error_log"
    CustomLog "logs/www.com-access_log" common

</VirtualHost>

访问
http://localhost/cgi-bin/test.pl

作者: mitmax   发布时间: 2011-07-26