When Tomcat starts up, the log file shows the server status. We can understand how Tomcat works. Due to different configuration, Tomcat may starts twice and runs two instances.
Why is that?
Let’s take a look at server.xml
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"> <Context docBase="webabc" path="" reloadable="true" source="org.eclipse.jst.jee.server:webabc"/></Host> </Host>
The
Further, the
That is why Tomcat has two instances.
To solve it, change the “appBase” in <Host> and “docBase” in <Context>.
<Host appBase="" autoDeploy="true" name="localhost" unpackWARs="true"> <Context docBase="webapps/webabc" path="" reloadable="true" source="org.eclipse.jst.jee.server:webabc"/></Host> </Host>
Start Tomcat, it will only starts one instance.