How to run different apps on single tomcat instance behind different ports?



How to run different apps on single tomcat instance behind different ports?..

Answer / Praveen Kumar Upadhyay

To run different web applications on a single Tomcat instance behind different ports, you can use the `Host` element in the `server.xml` configuration file. Create separate `Host` elements for each application and specify a unique port number under the `Ajp13` or `Http11` connector. For example:

<Host appBase="webapps"
name="localhost"
unpackWARs="true"
autoDeploy="false">
<!-- Single application configuration -->
<Context path="/">
<!-- Context attributes for the single application -->
</Context>
</Host>
<Host appBase="webapps"
name="localhost-app2"
unpackWARs="true"
autoDeploy="false">
<!-- Configuration for the second application, specify a different port under the connector -->
<Context path="/">
<!-- Context attributes for the second application -->
</Context>
</Host>

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Tomcat Interview Questions

What language is tomcat written in?

1 Answers  


what is tomcat valve?

1 Answers  


1)What is the output of select * from tab 2)MAC stands for 3)Purpose of NAT Protocal

8 Answers   Atos Origin, Avaya,


How many valves is tomcat configured with?

1 Answers  


What are the vital benefits of running tomcat as service?

1 Answers  


What is the default thread pool count in tomcat server?

1 Answers  


How to know your apache tomcat version?

1 Answers  


What is a tomcat application?

1 Answers  


How can we configure apache tomcat in java eclipse ide or explain the setup of apache tomcat server?

1 Answers  


What is ajp protocol in tomcat?

1 Answers  


with how many valves does tomcat configured with?

1 Answers  


Explain how you can configure tomcat to work with iis and ntlm?

1 Answers  


Categories