Welcome to my Tomcat tutorials website!

sabato 10 maggio 2014

Tomcat mod_proxy configuration

Configuring Tomcat with mod_proxy 

mod_proxy configuration is the simplest way to integrate Apache tomcat with Apache server. In order to do that,we need to add the module and redirect the URL to a virtual host.
Open the httpd.conf:
1. Place the following lines of code after the other LoadModule directives:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

2. Place the following lines of code with your other VirtualHost, or at the bottom of the file:

NameVirtualHost *
<VirtualHost *>
ServerName abc.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
<Location />
Order allow,deny
Allow from all
Save the configuration file and restart Apache Web server in order to test the integration using mod_proxy.
[root@localhost bin]# ./apachectl stop
[root@root@localhost bin]# ./apachectl start