LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to run Apache on one server and connect to Tomcat on another? (http://www.linuxquestions.org/questions/linux-software-2/how-to-run-apache-on-one-server-and-connect-to-tomcat-on-another-853944/)

Subject16 01-03-2011 12: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 workers.properties)sets what appears to be parameters such as the location of tomcat and Java. For example, here is the current output of workers.properties:

Quote:

workers.tomcat_home=/usr/share/tomcat6/
workers.java_home=/usr/lib/jvm/default-java

ps=/
worker.list=worker1,worker2

worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1

worker.worker2.port=8109
worker.worker2.host=localhost
worker.worker2.type=ajp13
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 01:12 PM

workers.properties 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 01: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 workers.properties file is only important to Tomcat and not Apache at all? I have a line in httpd.conf, JkWorkersFile, pointing to /etc/apache2/workers.properties. Since workers.properties 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 01: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 11:36 PM.