admin管理员组文章数量:1295066
I host a webapp on TomEE and want it available from a front-end IIS Server (same server).
My server is built this way :
- Windows Server 2016
- IIS 10 with httpPlatformHandler module v1.2 installed
- TomEE 9.1.1 microprofile in "C:\tomee\apache-tomee-9.1.1-microprofile"
- JDK 11.0.18 in "C:\tomee\jdk-11.0.18+10"
- Main IIS ASP.Net app available at /main/
- MyApp.war deployed and available at http://localhost:8080/myapp/ (before further change to the port number)
- Virtual Directory named "myapp", with physical path "C:\tomee\iis_virtual_directory"
I need to access to MyApp with an URL like /myapp/, but that doesn't work right now, Tomcat isn't even starting, I get a 502.3 Bad Gateway error.
I put this web.config file under "C:\tomee\iis_virtual_directory" :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="C:\tomee\apache-tomee-9.1.1-microprofile\\bin\startup.bat" arguments="start" stdoutLogEnabled="true" stdoutLogFile="C:\tomee\iis_virtual_directory\log.txt">
<environmentVariables>
<environmentVariable name="JRE_HOME" value="C:\tomee\jdk-11.0.18+10" />
<environmentVariable name="CATALINA_HOME" value="C:\tomee\apache-tomee-9.1.1-microprofile" />
<environmentVariable name="CATALINA_OPTS" value="-Dport.http=%HTTP_PLATFORM_PORT%" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
I also updated below attribute in TomEE server.xml
<Server port="-1" shutdown="SHUTDOWN">
<Connector port="${port.http}" protocol="HTTP/1.1">
I managed to get it working only when I put these web.config parameters inside the main web.config file in c:\inetpub\wwwroot, but then the main ASP.Net app wasn't available anymore.
Then i changed path attribute this way :
<add name="httpplatformhandler" path="myapp/*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
And both apps are available. But I wonder : what am I missing ? why can't i use a web.config file inside Virtual Directory ? At this point the Virtual Directory is useless and I can delete it without breaking access to MyApp.
I host a webapp on TomEE and want it available from a front-end IIS Server (same server).
My server is built this way :
- Windows Server 2016
- IIS 10 with httpPlatformHandler module v1.2 installed
- TomEE 9.1.1 microprofile in "C:\tomee\apache-tomee-9.1.1-microprofile"
- JDK 11.0.18 in "C:\tomee\jdk-11.0.18+10"
- Main IIS ASP.Net app available at https://myserver.mydomain.tld/main/
- MyApp.war deployed and available at http://localhost:8080/myapp/ (before further change to the port number)
- Virtual Directory named "myapp", with physical path "C:\tomee\iis_virtual_directory"
I need to access to MyApp with an URL like https://myserver.mydomain.tld/myapp/, but that doesn't work right now, Tomcat isn't even starting, I get a 502.3 Bad Gateway error.
I put this web.config file under "C:\tomee\iis_virtual_directory" :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="C:\tomee\apache-tomee-9.1.1-microprofile\\bin\startup.bat" arguments="start" stdoutLogEnabled="true" stdoutLogFile="C:\tomee\iis_virtual_directory\log.txt">
<environmentVariables>
<environmentVariable name="JRE_HOME" value="C:\tomee\jdk-11.0.18+10" />
<environmentVariable name="CATALINA_HOME" value="C:\tomee\apache-tomee-9.1.1-microprofile" />
<environmentVariable name="CATALINA_OPTS" value="-Dport.http=%HTTP_PLATFORM_PORT%" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
I also updated below attribute in TomEE server.xml
<Server port="-1" shutdown="SHUTDOWN">
<Connector port="${port.http}" protocol="HTTP/1.1">
I managed to get it working only when I put these web.config parameters inside the main web.config file in c:\inetpub\wwwroot, but then the main ASP.Net app wasn't available anymore.
Then i changed path attribute this way :
<add name="httpplatformhandler" path="myapp/*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
And both apps are available. But I wonder : what am I missing ? why can't i use a web.config file inside Virtual Directory ? At this point the Virtual Directory is useless and I can delete it without breaking access to MyApp.
Share Improve this question asked Jan 23 at 14:39 CyrilCyril 311 silver badge6 bronze badges 4 |1 Answer
Reset to default 0Thanks to Jalpa Panchal comment, i made it work as intended. I converted virtual directory to application in IIS Manager, and voila. Not sure why that didn't work before though.
本文标签: iishow to use httpPlatformHandler with Tomcat on Virtual Directory onlyStack Overflow
版权声明:本文标题:iis - how to use httpPlatformHandler with Tomcat on Virtual Directory only - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738488014a2089536.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
<location path="." inheritInChildApplications="false">
– Jalpa Panchal Commented Jan 24 at 7:55