请教高手tomcat里面如何执行cgi-bin的程序,服务器该怎么配置

chrade 2006-03-20 11:06:40
在线等,我很急的,哪位高手解答,即给分!!
...全文
108 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
slash5437 2006-04-05
  • 打赏
  • 举报
回复
我就是按照楼上 ibiswang(神鸟)写的做的
运行报错404
这个是怎么回事啊?
ibiswang 2006-03-20
  • 打赏
  • 举报
回复
To enable Tomcat's CGI servlet, you must do the following:

1.Rename the file servlets-cgi.renametojar (found in CATALINA_HOME/server/lib/) to servlets-cgi.jar, so that the servlet that processes CGI scripts will be on Tomcat's CLASSPATH.

2. In Tomcat's web.xml file, uncomment the definition of the servlet named cgi (this is around line 235 in the distribution).

3. Also in Tomcat's web.xml, uncomment the servlet mapping for the cgi servlet (around line 290 in the distributed file). Remember, this specifies the HTML links to the CGI script.

Either place the CGI scripts under the WEB-INF/cgi directory (remember that WEB-INF is a safe place to hide things that you don't want the user to be able to view for security reasons), or place them in some other directory within your context and adjust the cgiPathPrefix parameter to identify the directory containing the files. This specifies the actual location of the CGI scripts, which typically will not be the same as the URL in the previous step.

Restart Tomcat, and your CGI processing should now be operational.

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧