LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 01-03-2011, 01:49 PM   #1
Subject16
Member
 
Registered: Nov 2009
Posts: 46

Rep: Reputation: 1
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.
 
Old 01-03-2011, 02:12 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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.
 
Old 01-03-2011, 02:42 PM   #3
Subject16
Member
 
Registered: Nov 2009
Posts: 46

Original Poster
Rep: Reputation: 1
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"

Last edited by Subject16; 01-03-2011 at 02:44 PM. Reason: Config info
 
Old 01-03-2011, 02:53 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot run tomcat apache 5.5 on fedora 14 linuxwhacko Fedora 19 12-21-2010 04:18 AM
mod_jk or mod_proxy to connect apache to tomcat exceed1 Linux - Server 1 05-30-2009 04:27 PM
How to connect Tomcat 5 and Apache 2.0.48 using mod_jk2 zhangwf Linux - Networking 1 03-20-2004 09:42 AM
How to connect Tomcat 5 and Apache 2.0.48 using mod_jk2 zhangwf Linux - Newbie 0 03-19-2004 09:21 PM
user under which apache tomcat run?? Sridhar Guntur Linux - Security 2 08-28-2003 02:06 PM


All times are GMT -5. The time now is 09:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration