配置Tomcat在Tomcat 7上运行Python脚本

0 投票
1 回答
6210 浏览
提问于 2025-04-30 14:05

我有一个Python脚本,需要在Tomcat上运行。我已经修改了Tomcat的web.xml文件,把CGI的servlet和servlet映射的注释去掉了。但是当我访问 http://localhost:8080/cgi-bin/ 时,还是出现了“Servlet Cgi不可用”的错误。现在该怎么办呢?

暂无标签

1 个回答

0

我按照网上的指导,修改了conf/context.xml文件,在Context标签中添加了privileged="true",这样就成功了。

<Context privileged="true">

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->

</Context>

撰写回答