tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lahiru Gunathilake <>
Subject Re: How to get Tomcat HTTP port during startup of the server
Date Thu, 06 Oct 2011 19:00:39 GMT
HI Christopher,

That is what I have already done ! I thought its not nice users to put the
same configuration in to another properties file !

Somehow currently I have a solution but I am trying to find a better

I appreciate your responses ! Tomcat user list seems awesome !


On Thu, Oct 6, 2011 at 2:57 PM, Christopher Schultz <> wrote:

> Hash: SHA1
> Lahiru,
> On 10/6/2011 2:21 PM, Lahiru Gunathilake wrote:
> > This is my usecase, I want to register my application URL to a
> > repository and there is another remote application who reads that
> > URL somewhere and invoke my application. So during the startup I
> > need to register them before I get any request.
> Can you solve this with configuration? It seems like simply adding
> something like "URLBackToMe" could be configured in a properties file,
> web.xml init-param, or even in the JNDI context for the webapp. That
> will almost certainly be easier and less error-prone than trying to
> sniff the HTTP port from one of Tomcat's connectors.
> In production, we have two connectors: one HTTP and one AJP. The AJP
> connector accepts connections from the load-balancer for "regular"
> traffic. The HTTP connector accepts localhost-only loopback
> connections for operations that do not need to be encrypted. We have
> both the "public" and "private" URLs to our webapp in configuration
> files so that they can be used as appropriate depending upon the
> situation.
> If you had a setup like the above (particularly if you were using two
> HTTP connectors instead of one AJP and one HTTP), you might not be
> able to tell which connector was the "right" one. Also, you might have
> connectors bound to different interfaces to support multi-hostname
> SSL, etc. In those cases, how do you determine what the "right" port is?
> I think it's better to solve this with configuration instead of trying
> to determine the environment from the inside.
> - -chris
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla -
> aE4AniuyPfiQ9/tx3dN9a0wZsExA12Wz
> =Gd3G
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

System Analyst Programmer
Indiana University

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message