Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
20.9.2014 - We have just updated our course layouts and descriptions and added our 2015 schedule.

URL rewriting with front and back servers

ProxyPass ProxyPassReverse and the Tomcat ConnectorIf you ask someone to double a number, they'll come back to you and tell you twice the number you gave them - give the "3" and they'll say "6". But if you tell them to double the number every time they handle it, but refer it to someone else for them to validate it, you'll get "12" back. Since they will double it each time they pass it on. And if the person they validated it with also doubles it, you'll get "24".

If you're calling up a web page from a Tomcat Server that's running an application behind an Httpd server, you need to make sure that your URLs don't get rewritten two or three times in this fashion - but rather they get processed each step along the way in such a fashion that the report back to the browser is the correct one. Using httpd's mod_proxy it is especially easy to get the rewriting wrong, though.

The diagram here shows each of the three steps where URL re-writing may happen with mod_proxy:
1. On the way in through httpd, as set up by the ProxyPass directive
2. At Tomcat, as defined by the proxyName and proxyPort attributes of the <Connector>
3. On the way back through httpd, as per the ProxyPassReverse directive

My own suggestion is to KISS ("Keep is Simple, Stupid!"). Leave off proxyName and proxyPort attributes on the Tomcat Connector, and have the ProxyPass and ProxyPassReverse set to be equal but opposite.

(written 2008-12-14)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
A655 - Web Application Deployment - Using Tomcat and Apache httpd Together
  [3999] Handling failures / absences of your backend server nicely - (2013-02-08)
  [3018] Tuning Apache httpd and Tomcat to work well together - (2010-10-27)
  [2482] Load balancing with sticky sessions (httpd / Tomcat) - (2009-10-29)
  [1944] Forwarding session and cookie requests from httpd to Tomcat - (2008-12-14)
  [1938] Predictive Load Balancing - PHP and / or Java - (2008-12-13)
  [1771] More HowTo diagrams - MySQL, Tomcat and Java - (2008-08-24)
  [1552] Extra public classes in deploying Apache httpd and Tomcat - (2008-02-24)
  [1549] http, https and ajp - comparison and choice - (2008-02-22)
  [1383] Monitoring mod_jk and how it is load balancing - (2007-10-07)
  [1376] Choosing between mod_proxy and mod_rewrite - (2007-10-02)
  [631] Apache httpd to Tomcat - jk v proxy - (2006-03-03)
  [576] Why run two different web servers - (2006-01-25)
  [436] Linking Apache httpd to Apache Tomcat - (2005-09-05)

A657 - Web Application Deployment - Using httpd to front Tomcat
  [2483] Clustering on Tomcat - (2009-10-30)
  [1939] mod_proxy_ajp and mod_proxy_balancer examples - (2008-12-13)
  [1566] Strange behaviour of web directory requests without a trailing slash - (2008-03-06)
  [1377] Load Balancing with Apache mod_jk (httpd/Tomcat) - (2007-10-02)


Back to
mod_proxy_ajp and mod_proxy_balancer examples
Previous and next
or
Horse's mouth home
Forward to
Server - Service - Engine - Host, Tomcat
Some other Articles
Port and Glasses
Christmas scenes and events
Server - Service - Engine - Host, Tomcat
URL rewriting with front and back servers
Getting hold of the wrong end of the stick
Quick Summary - PHP installation
Summary of MySQL installation on a Linux system
4289 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/1940_URL ... rvers.html • PAGE BUILT: Thu Sep 18 15:30:25 2014 • BUILD SYSTEM: WomanWithCat