LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-28-2012, 07:34 AM   #1
sanjay87
Member
 
Registered: Oct 2011
Posts: 164

Rep: Reputation: Disabled
How to run apache and tomcat on two different physical machine


Hi
Currently im tryingto host apache web server on host
Physical server1: public address: 1.2.3.x -Hosting apache
i had nated the interface ipaddress 1.2.3.x --to my local network 192.168.1.1
so that from public ipaddress 1.2.3.x to could able to access my local network

Quote:
Physical server 1.2.3.X :apache configuration


#yum install httpd*
#vi /etc/httpd/conf/httpd.conf

Listen 1.2.3.x:80


Include /etc/httpd/conf/httpd1.conf


#apache tomcat connector propertise file location
JkWorkersFile "/etc/httpd/conf/workers.properties"
JkLogFile "logs/mod_jk.log"
JkLogLevel debug,error,info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

#vi /etc/httpd/conf/workers.properties

worker.list=worker1,worker2

worker.worker1.port=8081
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1

worker.worker2.port=9092
worker.worker2.host=localhost
worker.worker2.type=ajp13
worker.worker2.lbfactor=1


Tomcat

Local machine Behind Firewall

Ipaddress:192.168.1.1

cd /tomcat/apache-tomcat-6.0.26# ls
bin lib logs RELEASE-NOTES temp work
conf LICENSE NOTICE RUNNING.txt webapps STATIC

# cd static/ibe-setting-common-properties


Placed mysql server on local machine 192.168.1.2
cat ibe-settings-common.properties
dojo.build.mode=dev
db.url=jdbc\:mysql\://192.16.1.2/produc?useUnicode=yes&characterEncoding=UTF-8
db.user=root
db.password=password
cms.url=http://1.2.3.x:8080/cms/html/en_US


Can anyone help me How can i forward the apache request from ipaddress 1.2.3.x to my local machine behind firewall which i had nated to local ipaddress 192.168.1.1 .But i could able to connect the mysql server on 192.168.1.2 from 192.168.1.1.

Last edited by sanjay87; 03-28-2012 at 07:38 AM.
 
Old 03-28-2012, 12:47 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Depending on your Apache version you will want to use something like mod_jk or if you are on something greater than 2.0 something like mod_proxy with mod_proxy_ajp. You would need to set some variables in your httpd.conf file for forwarding the requests. mod_jk works great if Tomcat and Apache are running on the same server if you are on different servers I would suggest upgrading httpd to 2.2 and then using mod_proxy and mod_proxy_ajp. (Both come with httpd 2.2 you simply need to uncomment the load module lines in the httpd.conf) Apaches site has good reference for configuration of both of these modules.

---------- Post added 03-28-12 at 10:48 AM ----------

Also, you will want to make sure your firewall config is set up for the proper port forwarding of the tomcat requests.
 
  


Reply



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 03:18 AM
Two physical apache hosts served by one machine sagaciouskjb Linux - Server 1 10-19-2009 09:06 AM
Which distro for an old machine to run tomcat spudtheimpaler Linux - Server 4 03-05-2007 02:58 AM
Run tomcat on a local machine through apache indika Linux - Software 0 01-11-2005 02:48 AM
user under which apache tomcat run?? Sridhar Guntur Linux - Security 2 08-28-2003 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:50 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
Open Source Consulting | Domain Registration