You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Barnet Wagman <b....@comcast.net> on 2004/06/08 02:27:22 UTC

How do I associate a web app with a specific IP (connector)?

I'm going to be running Tomcat with two IP addresses (each has its own 
domain name).  How do I associate some web apps with one and some with 
the other?

 From my reading of the /Server Configuration Reference/ (but no 
experience yet), I gather that I should create a connector for each IP 
address.  But I don't see how to associate a web app with a particular 
connector.  Do I need to create separate Host elements and use separate 
appBases? Or is there another way altogether?

Thanks,

bw

Re: How do I associate a web app with a specific IP (connector)?

Posted by Tim Funk <fu...@joedog.org>.
http://jakarta.apache.org/tomcat/faq/connectors.html#bind

-Tim

Barnet Wagman wrote:
> I'm going to be running Tomcat with two IP addresses (each has its own 
> domain name).  How do I associate some web apps with one and some with 
> the other?
> 
>  From my reading of the /Server Configuration Reference/ (but no 
> experience yet), I gather that I should create a connector for each IP 
> address.  But I don't see how to associate a web app with a particular 
> connector.  Do I need to create separate Host elements and use separate 
> appBases? Or is there another way altogether?
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I associate a web app with a specific IP (connector)?

Posted by David Smith <dn...@cornell.edu>.
I did this with two <service>...</service> sections each with their own 
<connector/> tags and appBase values in their respective <Host>..</Host> 
tags.  It's probably over the top, but I wanted to be absolutely sure my 
high security apps were only talking through a SSH encrypted tunnel to 
the Apache server (different machine). 

I'm sure there's simpler stuff like valves to do the job as well.   I 
just haven't ever had the time to look into using them yet.

--David

Barnet Wagman wrote:

> I'm going to be running Tomcat with two IP addresses (each has its own 
> domain name).  How do I associate some web apps with one and some with 
> the other?
>
> From my reading of the /Server Configuration Reference/ (but no 
> experience yet), I gather that I should create a connector for each IP 
> address.  But I don't see how to associate a web app with a particular 
> connector.  Do I need to create separate Host elements and use 
> separate appBases? Or is there another way altogether?
>
> Thanks,
>
> bw
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: can't start tomcat4

Posted by Toms <to...@diena.lv>.
*Maybe this is the problem? :)


ContextConfig[]: Missing application web.xml, using defaults only
*
stella luna wrote:

> This is the error i am getting. Anyone have any ideas? The xml.users  
> file exists and permissions are set properly.
>
>
> Starting service Tomcat-Apache13
> Apache Tomcat/4.1.30
> WebappLoader[]: Deploying class repositories to work directory  
> /var/tomcat4/work/Apache - Tomcat4/defaulthost/_
> ContextConfig[]: Missing application web.xml, using defaults only
> StandardManager[]: Seeding random number generator class  
> java.security.SecureRandom
> StandardManager[]: Seeding of random number generator has been completed
> StandardWrapper[:default]: Loading container servlet default
> StandardWrapper[:invoker]: Loading container servlet invoker
> Catalina.start: LifecycleException:  Memory database file  
> /var/tomcat4/conf/sites.xml.d/site6.xml.users cannot be read
> LifecycleException:  Memory database file  
> /var/tomcat4/conf/sites.xml.d/site6.xml.users cannot be read
>     at org.apache.catalina.realm.MemoryRealm.start(MemoryRealm.java:340)
>     at  
> org.apache.catalina.core.StandardContext.start(StandardContext.java: 
> 3563)
>     at  
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>     at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
>     at  
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>     at  
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
>     at  
> org.apache.catalina.core.StandardService.start(StandardService.java: 497)
>     at  
> org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
>     at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
>     at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>     at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
> a:39)
>     at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
> Impl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:324)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> Stopping service Tomcat-Apache13
> Catalina.stop: LifecycleException:  Ajp13 connector has not yet been  
> started
> LifecycleException:  Ajp13 connector has not yet been started
>     at 
> org.apache.ajp.tomcat4.Ajp13Connector.stop(Ajp13Connector.java:1101)
>     at  
> org.apache.catalina.core.StandardService.stop(StandardService.java:546)
>     at  
> org.apache.catalina.core.StandardServer.stop(StandardServer.java:2225)
>     at org.apache.catalina.startup.Catalina.start(Catalina.java:543)
>     at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>     at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
> a:39)
>     at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
> Impl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:324)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


can't start tomcat4

Posted by stella luna <st...@mac.com>.
This is the error i am getting. Anyone have any ideas? The xml.users  
file exists and permissions are set properly.


Starting service Tomcat-Apache13
Apache Tomcat/4.1.30
WebappLoader[]: Deploying class repositories to work directory  
/var/tomcat4/work/Apache - Tomcat4/defaulthost/_
ContextConfig[]: Missing application web.xml, using defaults only
StandardManager[]: Seeding random number generator class  
java.security.SecureRandom
StandardManager[]: Seeding of random number generator has been completed
StandardWrapper[:default]: Loading container servlet default
StandardWrapper[:invoker]: Loading container servlet invoker
Catalina.start: LifecycleException:  Memory database file  
/var/tomcat4/conf/sites.xml.d/site6.xml.users cannot be read
LifecycleException:  Memory database file  
/var/tomcat4/conf/sites.xml.d/site6.xml.users cannot be read
	at org.apache.catalina.realm.MemoryRealm.start(MemoryRealm.java:340)
	at  
org.apache.catalina.core.StandardContext.start(StandardContext.java: 
3563)
	at  
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
	at  
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
	at  
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
	at  
org.apache.catalina.core.StandardService.start(StandardService.java: 
497)
	at  
org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
a:39)
	at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Stopping service Tomcat-Apache13
Catalina.stop: LifecycleException:  Ajp13 connector has not yet been  
started
LifecycleException:  Ajp13 connector has not yet been started
	at org.apache.ajp.tomcat4.Ajp13Connector.stop(Ajp13Connector.java:1101)
	at  
org.apache.catalina.core.StandardService.stop(StandardService.java:546)
	at  
org.apache.catalina.core.StandardServer.stop(StandardServer.java:2225)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:543)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav 
a:39)
	at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: How do I associate a web app with a specific IP (connector)?

Posted by Patrick Willart <pa...@aptitudexchange.com>.
Nope, you don't. There are different ways to do this, but with this
technique you don't need extra connectors.

grts,

Patrick

-----Original Message-----
From: Barnet Wagman [mailto:b.wagman@comcast.net]
Sent: Monday, June 07, 2004 9:30 PM
To: Tomcat Users List
Subject: Re: How do I associate a web app with a specific IP
(connector)?


Thanks. That looks simple enough.  Does this mean that I don't need an
extra connector for the IP?

Patrick Willart wrote:

>There is probably more than one way to do this, but one is by defining
>multiple hosts and using an alias to bind the host to an IP.
>
>You could end up with something like this:
>
><Host name="yourdomain1" debug="0" appBase="webapps1" unpackWARs="true"
>autoDeploy="true" xmlValidation="true" xmlNamespaceAware="true">
>
>     <Alias>127.0.0.1</Alias>
>     <Alias>yourdomain1.com</Alias>
>
>     ....
></Host>
>
><Host name="yourdomain2" debug="0" appBase="webapps2" unpackWARs="true"
>autoDeploy="true" xmlValidation="true" xmlNamespaceAware="true">
>
>     <Alias>127.0.0.2</Alias>
>     <Alias>yourdomain2.com</Alias>
>
>     ....
></Host>
>
>grts,
>
>Patrick
>
>-----Original Message-----
>From: Barnet Wagman [mailto:b.wagman@comcast.net]
>Sent: Monday, June 07, 2004 5:27 PM
>To: Tomcat Users List
>Subject: How do I associate a web app with a specific IP (connector)?
>
>
>I'm going to be running Tomcat with two IP addresses (each has its own
>domain name).  How do I associate some web apps with one and some with
>the other?
>
> From my reading of the /Server Configuration Reference/ (but no
>experience yet), I gather that I should create a connector for each IP
>address.  But I don't see how to associate a web app with a particular
>connector.  Do I need to create separate Host elements and use separate
>appBases? Or is there another way altogether?
>
>Thanks,
>
>bw
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How do I associate a web app with a specific IP (connector)?

Posted by Barnet Wagman <b....@comcast.net>.
Thanks. That looks simple enough.  Does this mean that I don't need an 
extra connector for the IP?

Patrick Willart wrote:

>There is probably more than one way to do this, but one is by defining
>multiple hosts and using an alias to bind the host to an IP.
>
>You could end up with something like this:
>
><Host name="yourdomain1" debug="0" appBase="webapps1" unpackWARs="true"
>autoDeploy="true" xmlValidation="true" xmlNamespaceAware="true">
>
>     <Alias>127.0.0.1</Alias>
>     <Alias>yourdomain1.com</Alias>
>
>     ....
></Host>
>
><Host name="yourdomain2" debug="0" appBase="webapps2" unpackWARs="true"
>autoDeploy="true" xmlValidation="true" xmlNamespaceAware="true">
>
>     <Alias>127.0.0.2</Alias>
>     <Alias>yourdomain2.com</Alias>
>
>     ....
></Host>
>
>grts,
>
>Patrick
>
>-----Original Message-----
>From: Barnet Wagman [mailto:b.wagman@comcast.net]
>Sent: Monday, June 07, 2004 5:27 PM
>To: Tomcat Users List
>Subject: How do I associate a web app with a specific IP (connector)?
>
>
>I'm going to be running Tomcat with two IP addresses (each has its own
>domain name).  How do I associate some web apps with one and some with
>the other?
>
> From my reading of the /Server Configuration Reference/ (but no
>experience yet), I gather that I should create a connector for each IP
>address.  But I don't see how to associate a web app with a particular
>connector.  Do I need to create separate Host elements and use separate
>appBases? Or is there another way altogether?
>
>Thanks,
>
>bw
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: How do I associate a web app with a specific IP (connector)?

Posted by Patrick Willart <pa...@aptitudexchange.com>.
There is probably more than one way to do this, but one is by defining
multiple hosts and using an alias to bind the host to an IP.

You could end up with something like this:

<Host name="yourdomain1" debug="0" appBase="webapps1" unpackWARs="true"
autoDeploy="true" xmlValidation="true" xmlNamespaceAware="true">

     <Alias>127.0.0.1</Alias>
     <Alias>yourdomain1.com</Alias>

     ....
</Host>

<Host name="yourdomain2" debug="0" appBase="webapps2" unpackWARs="true"
autoDeploy="true" xmlValidation="true" xmlNamespaceAware="true">

     <Alias>127.0.0.2</Alias>
     <Alias>yourdomain2.com</Alias>

     ....
</Host>

grts,

Patrick

-----Original Message-----
From: Barnet Wagman [mailto:b.wagman@comcast.net]
Sent: Monday, June 07, 2004 5:27 PM
To: Tomcat Users List
Subject: How do I associate a web app with a specific IP (connector)?


I'm going to be running Tomcat with two IP addresses (each has its own
domain name).  How do I associate some web apps with one and some with
the other?

 From my reading of the /Server Configuration Reference/ (but no
experience yet), I gather that I should create a connector for each IP
address.  But I don't see how to associate a web app with a particular
connector.  Do I need to create separate Host elements and use separate
appBases? Or is there another way altogether?

Thanks,

bw


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org