• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How to deploy different war on different port?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

we have two WAR packaged into single EAR file now I want this WAR to be deployed on different port
for example
we have two application - app1 and app2 with different root context
http://10.22.22.34:8080/app1
and
http://10.22.22.34:8080/app2

Now due to security constrains we want to run one application on different port instead of 8080.
http://10.22.22.34:8088/app2

Is it possible to consigure WAR to run on different port?
How can we achive this?
Will this require changes only in packaging war or its dependent of Application server also?

Please help.


 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ports the server uses is something you define in the server, not the application. So you can't do this by changing the WAR file.

Normally, servers only listen on one port (or range of ports). There are some (such as WebSphere) that allow you to define distinct virtual hosts which use differernt ports, but you can't deploy one EAR into two virtual hosts in the way you would like.

One way to do it is to put some sort of proxy in front of your web servers that redirects based on the context in the URL. Soemthing fairly basic like Apache HTTP server will do this.
 
Mehta Mohit
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul Thanks for reply

I have Glassfish server to deploy my application EAR

Two WAR what we have is web services expossed with different context to control its accessiblity.
In Glassfish I have seen that we can create Virtual server and can deploy application to that virtual server
Is it possible to configure such virtual server for each WAR inside EAR?

Or Can anyone suggest any other way to package 2 WAR in signle EAR still having different Port configured?

 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm no Glassfish expert but I'd expect this can't be done. You certainly can't do it in any of the server I do know (so if a solution exists for Glassfish its not going to be portable). Configuration of the server itself is not normally something you can do from the JEE artifact.
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic