Setting up httpd as a proxy for Tomcat

5 09 2006

Content moved to http://awesomeful.net/posts/25-setting-up-httpd-as-a-proxy-for-tomcat

Advertisements

Actions

Information

5 responses

18 10 2007
Markus

Hello, I’m looking to use Apache 2.2 as a proxy for Tomcat 5. Really what I want is to direct all traffic to Tomcat through Apache’s 80 port so I can hide the port number 8080 from showing up in the url. I’ve tried to get Tomcat to bind to port 80 but I keep getting ‘Permission Denied’ even with Apache turned off. Thanks.

20 05 2009
Indiver Nehru

Steps for Setting up httpd as a proxy for Tomcat:

Step 1:

edit /etc/httpd/conf/httpd.conf file
and append the following lines.

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

##The above modules comes default with apache.

ProxyRequests Off
ProxyPreserveHost On

Order deny,allow
Allow from all

ProxyVia On
NameVirtualHost *:80

ServerAdmin webmaster@dummy-host.example.com
ServerName example.com
ProxyPass / http://192.xxx.x.x/
ProxyPassReverse / http://192.xxx.x.x/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
ErrorLog logs/dummy-host.example.comerror_log
CustomLog logs/dummy-host.example.com-access_log common

Step 2:

Changes to be made in Tomcat file:

Add the proxyName tag in the server.xml of the tomcat file.

path of server.xml: /tomcat/conf/server.xml.

20 05 2009
Indiver Nehru

Steps for Setting up httpd as a proxy for Tomcat:

Step 1:

edit /etc/httpd/conf/httpd.conf file
and append the following lines.

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

##The above modules comes default with apache.

ProxyRequests Off
ProxyPreserveHost On

Order deny,allow
Allow from all

ProxyVia On
NameVirtualHost *:80

ServerAdmin webmaster@dummy-host.example.com
ServerName example.com
ProxyPass / http://192.xxx.x.x/
ProxyPassReverse / http://192.xxx.x.x/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
ErrorLog logs/dummy-host.example.comerror_log
CustomLog logs/dummy-host.example.com-access_log common

Step 2:

Changes to be made in Tomcat file:

Add the proxyName tag in the server.xml of the tomcat file.

path of server.xml: /tomcat/conf/server.xml.

Reply

20 05 2009
Indiver Nehru

I copied the code twice but in vain. Here is the code to be appended in the above server.xml file.

20 05 2009
Indiver Nehru

proxyName=”example.com” proxyPort=”80″. The tag lne to be added in the tomcat server.xml connector = tag.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: