Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running two web applications on same port?

We have two different Java web apps named foo.war and bar.war and we want to deploy these on Jetty server

Jetty is running on 8080 port on the machine

Is it possible simultaneously run two apps on same port ? If no what are the alternatives to run multiple web apps on same jetty server

Thanks

like image 636
Rams Avatar asked Nov 20 '25 21:11

Rams


1 Answers

You can run as many web applications as you want in a servlet container. They just need different context roots.

Let's say you have abc.war and def.war. If you deploy both, by default you can access them through http://localhost:8080/abc and http://localhost:8080/def.

Since this usually looks ugly, it's a good idea to put a reverse proxy in front of your Servlet container. This will allow you to have for example 2 different domains foobar.com and xipbaz.com that will then be routed to different applications, even if they're all on the same server.

like image 165
Kayaman Avatar answered Nov 23 '25 10:11

Kayaman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!