Quick Questions on some Tomcat settings

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Quick Questions on some Tomcat settings

Josh Gooding
Hey guys and gals, it's been a while, but I have a question for you.  I am
setting up a new Tomcat 6.0.29 installation that is for project management
software.

Here's the scenario.  On this server we are currently running Apache 2.2 for
our companies wiki on port 80.  This is bound to a specific IP address and
we can navigate to 'Wiki' in the address of the web browser and viola, it
appears.

With that in mind, can I:

Have tomcat serve on port 80 (bound to a different IP address than the
Apache 2.2 installation) on the same machine, and when 'this-name' is
entered into the web browser, it will serve it?  I am aware that I can
forward the tomcat serving through the httpd server, but I am not willing to
(unless it's the only way to do so.)

Would this be in the virtual hosting section of the documentation by chance?

Thanks in advance for any and all information!

Josh
Reply | Threaded
Open this post in threaded view
|

Re: Quick Questions on some Tomcat settings

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Josh,

On 1/5/2011 4:08 PM, Josh Gooding wrote:
> Here's the scenario.  On this server we are currently running Apache 2.2 for
> our companies wiki on port 80.  This is bound to a specific IP address and
> we can navigate to 'Wiki' in the address of the web browser and viola, it
> appears.
>
> With that in mind, can I:
>
> Have tomcat serve on port 80 (bound to a different IP address than the
> Apache 2.2 installation)

Yes. Use the "address" attribute of the <Connector> element:
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html

> on the same machine, and when 'this-name' is
> entered into the web browser, it will serve it?

If foo.bar.com points to the Apache ip address and foo2.bar.com points
to the "other" ip address and you bind Tomcat to the "other" ip address
then everything will work.

> I am aware that I can
> forward the tomcat serving through the httpd server, but I am not willing to
> (unless it's the only way to do so.)

Tomcat is perfectly willing to serve HTTP requests directly.

> Would this be in the virtual hosting section of the documentation by chance?

Virtual hosting is not necessary in this case: just use a single <Host>
and make it the default (which is the default configuration for Tomcat
anyway).

Good luck,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0k370ACgkQ9CaO5/Lv0PBysgCgnVTuDuIl2+dBuP9wx9R7tqOo
K0YAnj1rYBB616UrolaO6/AWS+Dif4WZ
=ytyB
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Quick Questions on some Tomcat settings

Caldarale, Charles R
In reply to this post by Josh Gooding
> From: Josh Gooding [mailto:[hidden email]]
> Subject: Quick Questions on some Tomcat settings

> With that in mind, can I:

> Have tomcat serve on port 80 (bound to a different IP address than the
> Apache 2.2 installation) on the same machine, and when 'this-name' is
> entered into the web browser, it will serve it?

Yes.

> Would this be in the virtual hosting section of the documentation
> by chance?

Probably not.  All you need to do is set the address attribute of the <Connector> elements(s) in conf/server.xml.  By default, each <Connector> listens on 0.0.0.0 (or IPv6 equivalent), and you don't want that in your case.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Quick Questions on some Tomcat settings

André Warnier (tomcat)
In reply to this post by Josh Gooding
Josh Gooding wrote:

> Hey guys and gals, it's been a while, but I have a question for you.  I am
> setting up a new Tomcat 6.0.29 installation that is for project management
> software.
>
> Here's the scenario.  On this server we are currently running Apache 2.2 for
> our companies wiki on port 80.  This is bound to a specific IP address and
> we can navigate to 'Wiki' in the address of the web browser and viola, it
> appears.
>
> With that in mind, can I:
>
> Have tomcat serve on port 80 (bound to a different IP address than the
> Apache 2.2 installation) on the same machine, and when 'this-name' is
> entered into the web browser, it will serve it?

Yes, provided :
- the browser, through a query for "this-name" to its name resolution mechanism (usually
DNS), obtains an IP address which actually corresponds to an interface on the server
- and the tomcat on that server is actually listening on that IP address

As a general proviso, you cannot have two processes on the same host which open the same
listening port on the same IP address.

   I am aware that I can
> forward the tomcat serving through the httpd server, but I am not willing to
> (unless it's the only way to do so.)
>
> Would this be in the virtual hosting section of the documentation by chance?
>

No, because it has essentially nothing to do with "virtual" hosts in the HTTP sense.
But explaining that would take us much further than needed to answer your question above
and would be quite Off-Topic for this list.(*)

The scheme you propose above is more similar to the case where you would actually have two
separate physical hosts, one running httpd and the other running tomcat.
Each would have its own separate IP address, and name.
You are just bringing them together into one machine, and setting up two network
interfaces on that one machine.



(*) read here for more details :
http://httpd.apache.org/docs/2.2/vhosts/
(The "name-based" part)


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Quick Questions on some Tomcat settings

Josh Gooding
EXCELLENT!  Almost there now!  Just one more thing.  I have it serving to
http://proj-name and it is coming up with the tomcat default page.  I have
to be missing something.

I have:

<Engine name="Catalina" defaultHost="proj-name"/>

and a <Host> defined as:

<Host name="proj-name" appBase="webapps"
          unpackWARs="true" autoDeploy="true"
          xmlValidation="false" xmlNamespaceAware="false">
<Alias>proj-name</Alias>
</Host>

should the appBase be defined as: /webapps/proj-name folder?

- Thank you all for partially jump starting my brain.




On Wed, Jan 5, 2011 at 4:27 PM, André Warnier <[hidden email]> wrote:

> Josh Gooding wrote:
>
>> Hey guys and gals, it's been a while, but I have a question for you.  I am
>> setting up a new Tomcat 6.0.29 installation that is for project management
>> software.
>>
>> Here's the scenario.  On this server we are currently running Apache 2.2
>> for
>> our companies wiki on port 80.  This is bound to a specific IP address and
>> we can navigate to 'Wiki' in the address of the web browser and viola, it
>> appears.
>>
>> With that in mind, can I:
>>
>> Have tomcat serve on port 80 (bound to a different IP address than the
>> Apache 2.2 installation) on the same machine, and when 'this-name' is
>> entered into the web browser, it will serve it?
>>
>
> Yes, provided :
> - the browser, through a query for "this-name" to its name resolution
> mechanism (usually DNS), obtains an IP address which actually corresponds to
> an interface on the server
> - and the tomcat on that server is actually listening on that IP address
>
> As a general proviso, you cannot have two processes on the same host which
> open the same listening port on the same IP address.
>
>
>  I am aware that I can
>
>> forward the tomcat serving through the httpd server, but I am not willing
>> to
>> (unless it's the only way to do so.)
>>
>> Would this be in the virtual hosting section of the documentation by
>> chance?
>>
>>
> No, because it has essentially nothing to do with "virtual" hosts in the
> HTTP sense.
> But explaining that would take us much further than needed to answer your
> question above and would be quite Off-Topic for this list.(*)
>
> The scheme you propose above is more similar to the case where you would
> actually have two separate physical hosts, one running httpd and the other
> running tomcat.
> Each would have its own separate IP address, and name.
> You are just bringing them together into one machine, and setting up two
> network interfaces on that one machine.
>
>
>
> (*) read here for more details :
> http://httpd.apache.org/docs/2.2/vhosts/
> (The "name-based" part)
>
>
EXCELLENT!  Almost there now!  Just one more thing.  I have it serving to
http://proj-name and it is coming up with the tomcat default page.  I have
to be missing something.

I have:

<Engine name="Catalina" defaultHost="proj-name"/>

and a <Host> defined as:

<Host name="proj-name" appBase="webapps"
          unpackWARs="true" autoDeploy="true"
          xmlValidation="false" xmlNamespaceAware="false">
<Alias>proj-name</Alias>
</Host>

should the appBase be defined as: /webapps/proj-name folder?

- Thank you all for partially jump starting my brain.
Reply | Threaded
Open this post in threaded view
|

Re: Quick Questions on some Tomcat settings

Josh Gooding
and sorry for the double posting... I have no idea what happened there.


On Wed, Jan 5, 2011 at 8:43 PM, Josh Gooding <[hidden email]> wrote:

> EXCELLENT!  Almost there now!  Just one more thing.  I have it serving to
> http://proj-name and it is coming up with the tomcat default page.  I have
> to be missing something.
>
> I have:
>
> <Engine name="Catalina" defaultHost="proj-name"/>
>
> and a <Host> defined as:
>
> <Host name="proj-name" appBase="webapps"
>           unpackWARs="true" autoDeploy="true"
>           xmlValidation="false" xmlNamespaceAware="false">
> <Alias>proj-name</Alias>
> </Host>
>
> should the appBase be defined as: /webapps/proj-name folder?
>
> - Thank you all for partially jump starting my brain.
>
>
>
>
> On Wed, Jan 5, 2011 at 4:27 PM, André Warnier <[hidden email]> wrote:
>
>> Josh Gooding wrote:
>>
>>> Hey guys and gals, it's been a while, but I have a question for you.  I
>>> am
>>> setting up a new Tomcat 6.0.29 installation that is for project
>>> management
>>> software.
>>>
>>> Here's the scenario.  On this server we are currently running Apache 2.2
>>> for
>>> our companies wiki on port 80.  This is bound to a specific IP address
>>> and
>>> we can navigate to 'Wiki' in the address of the web browser and viola, it
>>> appears.
>>>
>>> With that in mind, can I:
>>>
>>> Have tomcat serve on port 80 (bound to a different IP address than the
>>> Apache 2.2 installation) on the same machine, and when 'this-name' is
>>> entered into the web browser, it will serve it?
>>>
>>
>> Yes, provided :
>> - the browser, through a query for "this-name" to its name resolution
>> mechanism (usually DNS), obtains an IP address which actually corresponds to
>> an interface on the server
>> - and the tomcat on that server is actually listening on that IP address
>>
>> As a general proviso, you cannot have two processes on the same host which
>> open the same listening port on the same IP address.
>>
>>
>>  I am aware that I can
>>
>>> forward the tomcat serving through the httpd server, but I am not willing
>>> to
>>> (unless it's the only way to do so.)
>>>
>>> Would this be in the virtual hosting section of the documentation by
>>> chance?
>>>
>>>
>> No, because it has essentially nothing to do with "virtual" hosts in the
>> HTTP sense.
>> But explaining that would take us much further than needed to answer your
>> question above and would be quite Off-Topic for this list.(*)
>>
>> The scheme you propose above is more similar to the case where you would
>> actually have two separate physical hosts, one running httpd and the other
>> running tomcat.
>> Each would have its own separate IP address, and name.
>> You are just bringing them together into one machine, and setting up two
>> network interfaces on that one machine.
>>
>>
>>
>> (*) read here for more details :
>> http://httpd.apache.org/docs/2.2/vhosts/
>> (The "name-based" part)
>>
>>
> EXCELLENT!  Almost there now!  Just one more thing.  I have it serving to
> http://proj-name and it is coming up with the tomcat default page.  I have
> to be missing something.
>
> I have:
>
> <Engine name="Catalina" defaultHost="proj-name"/>
>
> and a <Host> defined as:
>
> <Host name="proj-name" appBase="webapps"
>           unpackWARs="true" autoDeploy="true"
>           xmlValidation="false" xmlNamespaceAware="false">
> <Alias>proj-name</Alias>
> </Host>
>
> should the appBase be defined as: /webapps/proj-name folder?
>
> - Thank you all for partially jump starting my brain.
>
>
>
Reply | Threaded
Open this post in threaded view
|

RE: Quick Questions on some Tomcat settings

Caldarale, Charles R
In reply to this post by Josh Gooding
> From: Josh Gooding [mailto:[hidden email]]
> Subject: Re: Quick Questions on some Tomcat settings

> I have:
> <Engine name="Catalina" defaultHost="proj-name"/>
> and a <Host> defined as:
> <Host name="proj-name" appBase="webapps"
>           unpackWARs="true" autoDeploy="true"
>           xmlValidation="false" xmlNamespaceAware="false">
> <Alias>proj-name</Alias>
> </Host>

I suggest you undo all that, and put server.xml back the way it was.  What you've done is not really useful.

> should the appBase be defined as: /webapps/proj-name folder?

Absolutely not.  What you actually need to do is stop Tomcat, restore server.xml, delete Tomcat's ROOT directory, rename webapps/proj-name to webapps/ROOT (case matters), and restart Tomcat.  That will make your webapp the default one.  (If you want to keep Tomcat's home page for some reason, just rename the original ROOT directory to something else rather than deleting it.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Quick Questions on some Tomcat settings

Josh Gooding
thank you thank  you thank you!  I cannot thank you all enough!

On Wed, Jan 5, 2011 at 9:53 PM, Caldarale, Charles R <
[hidden email]> wrote:

> > From: Josh Gooding [mailto:[hidden email]]
> > Subject: Re: Quick Questions on some Tomcat settings
>
> > I have:
> > <Engine name="Catalina" defaultHost="proj-name"/>
> > and a <Host> defined as:
> > <Host name="proj-name" appBase="webapps"
> >           unpackWARs="true" autoDeploy="true"
> >           xmlValidation="false" xmlNamespaceAware="false">
> > <Alias>proj-name</Alias>
> > </Host>
>
> I suggest you undo all that, and put server.xml back the way it was.  What
> you've done is not really useful.
>
> > should the appBase be defined as: /webapps/proj-name folder?
>
> Absolutely not.  What you actually need to do is stop Tomcat, restore
> server.xml, delete Tomcat's ROOT directory, rename webapps/proj-name to
> webapps/ROOT (case matters), and restart Tomcat.  That will make your webapp
> the default one.  (If you want to keep Tomcat's home page for some reason,
> just rename the original ROOT directory to something else rather than
> deleting it.)
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Quick Questions on some Tomcat settings

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Josh,

On 1/6/2011 7:56 AM, Josh Gooding wrote:
> thank you thank  you thank you!  I cannot thank you all enough!

Beer is always acceptable, though sometimes tough to ship.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0l9XEACgkQ9CaO5/Lv0PAMxACgtdYCkTTFTKXzT6pzqkYsdA+3
vXgAoKa9N6HgIz5/VDGRVeBqyJs/pwvY
=k8mP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]