java - 如何在 IIS 上使用 Http Plataform Handler 启动 Java Web 应用程序?

标签 java asp.net tomcat iis

基于这篇文章https://azure.microsoft.com/en-us/blog/announcing-the-release-of-the-httpplatformhandler-module-for-iis-8/我一步一步地按照说明操作,但没有成功。我已经有一个 ISS 10.0 服务器,我尝试过:

  • 已下载并安装 HttpPlataformHandler x64 - https://www.iis.net/downloads/microsoft/httpplatformhandler
  • Tomcat 8 相同 - http://tomcat.apache.org/download-80.cgi
  • 更新的 server.xml 文件 - HTTP 连接器端口=${port.http}
  • http://prdownloads.sourceforge.net/pebble/pebble-2.6.4.zip?download 获得了一个 .war 项目并放入 Tomcat webapps。
  • 在 ISS Manage 上,我添加了一个新网站,告知名称和我的项目所在的物理路径(tomcat、.war、web.config...)
  • Web.config:

    <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
        <system.webServer>
          <handlers accessPolicy="Read, Write, Execute, Script">
            <add name="httpplatformhandler" path="*" verb="*" 
                 modules="httpPlatformHandler" resourceType="Unspecified" />
          </handlers>
         <httpPlatform processPath="C:\dev\javasites\bin\apache-tomcat-8.0.39\bin\startup.bat" 
                       arguments="" stdoutLogEnabled="true"
                       stdoutLogFile="\\?c:\dev\javasites\log.txt">
         <environmentVariables> 
           <environmentVariable name="JRE_HOME" value="C:\Program Files\Java\jdk1.8.0_111" />
           <environmentVariable name="CATALINA_HOME" value="c:\dev\javasites\bin\apache-tomcat-8.0.39" />
         </environmentVariables>
        </httpPlatform>
       </system.webServer>
      </configuration>
    
  • 最后,当我尝试访问 localhost/或 localhost/pebble 时,选项卡上的消息显示“正在等待本地主机”,并且请求永远不会结束。

我已经试过了:

  • 关闭防火墙。
  • 授予 ISS_ISRS 和 IUSR 完全权限。
  • 授予对项目文件夹的完全权限。
  • 具有读取、写入、执行、脚本权限的 AccessPolicy (system.webServer/handlers)。

没有来自请求的任何错误代码,我看不出哪里做错了。

最佳答案

根据您的描述,根据我的理解,听起来您想使用 IIS HttpPlatform 处理程序来启动 Tomcat 实例,但我不知道环境是托管在 Azure App Service 上还是仅托管在 Windows 上.

如果您的需求是在 Azure 应用服务的控制范围内手动配置和使用 Tomcat,我认为文档 Upload a custom Java web app to Azure对你上传一个Tomcat实例和Java WebApp到wwwroot路径并配置web.config让它随IIS启动是很有帮助的。

但如果你只是想用IIS配置Tomcat启动和工作,你需要引用文档The Apache Tomcat Connectors - Web Server HowTo让 IIS 尝试执行此操作。

希望对您有所帮助。

关于java - 如何在 IIS 上使用 Http Plataform Handler 启动 Java Web 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41830922/

相关文章:

java - 当 Android 看不到证书时,如何在 Android 中调用安全 (SSL) 网络服务?

c# - jQuery 没有在 asp.net MVC 中缩小

javascript - Tomcat servlet,将所有网址重定向到单个网页

http - Tomcat 中的 WebDAV 服务器端实现

java - 如何在Spring中使用Tomcat 7提供的JNDI DataSource?

java - JSF @ViewScope,PrimeFaces <p :dialog and <ui:include

java - 按名称搜索类(class)

java - Leetcode220错误: incomparable types: int and <null>

c# - 多服务器部署的 ASP.net 解决方案注意事项

c# - ASP.NET 在单击按钮时显示 div