关于配置Apache对CGI支持的问题?

由 marengen 在 06-11-2004 13:41 发表:

关于配置Apache对CGI支持的问题?

关于配置Apache对CGI支持的问题?

系统用的是RedHat9,Apache用的是系统自带的Apache/2.0.40.

我现在想要配置个WEB服务器,并且实现支持CGI程序.

HTTP服务已经配置好了,也已经能够访问了.

可是在配置对CGI支持的时候碰上问题了.

不知道问题出在那里,特来求助,各位帮忙看下啊,谢谢@

我已经编辑了/etc/httpd/conf/httpd.conf

其中关于CGI部分我作的修改是这样的:

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#这个是默认的,目录没有作修改.CGI就放在这个目录下面.

AddHandler cgi-script .cgi .pl

 1<directory "="" cgi-bin"="" var="" www="">   
 2  
 3AllowOverride All   
 4  
 5Options All   
 6  
 7Allow from all   
 8  
 9Order allow,deny   
10  
11</directory>

好像就是对以上三个地方作修改啊.

可是现在我并不能访问CGI目录啊,访问CGI目录的时候( http://192.168.1.110/cgi-bin/

出来以下提示:

Forbidden

You don't have permission to access /cgi-bin/ on this server.

Apache/2.0.40 Server at XiaoMa Port 80

-----------------------------------

访问这个目录下面的网页的时候就会出来500错误( http://192.168.1.110/cgi-bin/info.cgi

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.0.40 Server at XiaoMa Port 80

-----------------------------------

日志里面的记录是这样的:

[error] [client 192.168.1.110] attempt to invoke directory as script: /var/www/cgi-bin/

[error] [client 192.168.1.110] Premature end of script headers: help.cgi

[error] [client 192.168.1.110] attempt to invoke directory as script: /var/www/cgi-bin/

[warn] child process 3161 still did not exit, sending a SIGTERM

[warn] child process 3164 still did not exit, sending a SIGTERM

[otice] caught SIGTERM, shutting down

[notice] Digest: generating secret for digest authentication ...

[notice] Digest: done

[notice] Apache/2.0.4

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus