I host a webapp on TomEE and can access it from a front-end IIS server, using httpPlatformHandler module.
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 https://myserver.mydomain.tld/myapp/
- Application with alias "myapp", and physical path "C:\tomee\iis_virtual_directory"
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="myapp/*" 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">
My question is : what is the best/cleanest way to shutdown or restart the TomEE server, without restarting whole IIS server if possible ? I want to deploy new version of the app by pasting the WAR file in webapps folder, but app pool recycle doesn't seem to work, I had to delete app folder in order to really deploy it.

main_poolandmyapp_poolmanually. And use them for your 2 virtual applications. If you want to restart themyapp, you can recyle themyapp_pool.