Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Tomcat redirection in Plesk  (Read 2573 times)

0 Members and 1 Guest are viewing this topic.

vinodt

  • Guest
Tomcat redirection in Plesk
« on: December 01, 2013, 12:13:50 am »
We can redirect apache request to tomcat by enabling the mod_proxy module in  httpd.conf.

Uncomment the modules in httpd.conf

=========================
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
========================================

Add following lines in /etc/httpd.conf under virtual host:
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://domain.tld:8080/  retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse / http://domain.tld:8080/

ProxyBadHeader Ignore

# Configuring the timeout
Timeout 2400
ProxyTimeout 2400

<Location />
Order allow,deny
Allow from all
</Location>
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
==================================
Add following changes in  : /etc/tomcat6/server.xml
<Connector port="8080" protocol="HTTP/1.1" URIEncoding="UTF-8"
connectionUploadTimeout="36000000" disableUploadTimeout="false"
connectionTimeout="60000" redirectPort="8443" />
=====================================

Please note that the option "disableUploadTimeout="false". The default option is disableUploadTimeout="true" which might give 502 gateway timeout error.
======================================
/etc/init.d/tomcatx restart
/etc/init.d/httpd restart
===================================
Done.

Regards,

Vinod T K