aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes How to deploy different war on different port? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to deploy different war on different port?" Watch "How to deploy different war on different port?" New topic
Author

How to deploy different war on different port?

Mehta Mohit
Greenhorn

Joined: Dec 09, 2005
Posts: 4
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.



Mohit Mehta
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mehta Mohit
Greenhorn

Joined: Dec 09, 2005
Posts: 4
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

Joined: Apr 14, 2004
Posts: 10336

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: How to deploy different war on different port?