-   Linux - Software (
-   -   How to run Apache on one server and connect to Tomcat on another? (

Subject16 01-03-2011 01:49 PM

How to run Apache on one server and connect to Tomcat on another?
Right now I have Apache and Tomcat running on the same server. For reasons I won't go into I'm experimenting with putting Apache on a separate server, and installing Tomcat on multiple back-end servers. This isn't a load-balancing scenario as each Tomcat container on the back-end servers will be providing a separate application/responding to a different url.

In a typical setup (everything on one box) the configuration file (we use what appears to be parameters such as the location of tomcat and Java. For example, here is the current output of





Do I need the content in red? If so, can I point those values to installations on another server, or do I need to actually install Tomcat and Java on the Apache server still? That seems silly since I'm trying to separate them, but I'm just not sure.

acid_kewpie 01-03-2011 02:12 PM is solely a config file for tomcat, it has nothing to do with apache at all. to contact the to, you'd generally just use mod_proxy, or mod_jk.

Subject16 01-03-2011 02:42 PM

I'm a little confused. I know you have to use mod_jk or mod_proxy to allow Apache to use the AJP protocol that Tomcat uses, and I'm actually using mod_jk in my setup. Are you saying that what's in the file is only important to Tomcat and not Apache at all? I have a line in httpd.conf, JkWorkersFile, pointing to /etc/apache2/ Since is the file that plots out the location of Java and Tomcat, and is not important to Apache, does this mean I can actually relocate this file to the Tomcat server and change the JkWorkersFile directive to point to this remote location?

My apologies...I forgot my basics:
Server1: Apache/2.2.14, "Ubuntu 10.04.1 LTS" x64
Server2: Apache Tomcat/6.0.24, Ubuntu 10.04.1 LTS x64, java version "1.6.0_20"

acid_kewpie 01-03-2011 02:53 PM

Sometimes I find it a lot better to admit I'm wrong than backtrack... probably not as often as I should :-) I just use proxypass, so don't have much exposure to jk.

OK, so the workers config file on apache is for mod_jk directly, so no you don't need tomcat itself on the apache side. As for the need for all options, if you don't it'll be harmless, if you and do remove them, you'll know pretty quickly when it doesn't work any more.

All times are GMT -5. The time now is 05:10 AM.