How do I connect Apache to Tomcat using a proxy?
Author: Deron Eriksson
Description: This tutorial describes how to connect the Apache Web Server to Tomcat using a proxy.
Tutorial created using:
Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 1.5.4 || Tomcat 5.5.20 || Apache HTTP Server 2.2.4
Perhaps the easiest way to connect ApacheSW to TomcatSW is to use a proxy. This dinky little tutorial will show you how. In some other tutorials, we used a 'tomcat-demo' project that we created in EclipseSW to demonstrate various aspects of JavaSW web development. This project features a TestServlet class that's mapped to 'test' on the URL string. I'll go ahead and fire up my 'tomcat-demo' project in Eclipse. I'll verify that 'tomcat-demo' is running by hitting the tomcat-demo test servletW in a browser (http://localhost:8080/tomcat-demo/test). Next, I'll go into my Tomcat server.xml file and uncomment the 8082 proxy Connector. <Connector port="8082" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" acceptCount="100" connectionTimeout="20000" proxyPort="80" disableUploadTimeout="true" /> I'll stop and restart 'tomcat-demo' in Eclipse. After that, I'll try hitting the test servlet in a browser. However, this time I'll hit it on port 8082 (http://localhost:8082/tomcat-demo/test): (Continued on page 2) |