How Apache and Tomcat Work Together
Top : Tomcat (JSP & Servlet Container)
| Article ID: |
 |
000007 |
| Rating: |
 |
5.0 / 5.0 (8 votes)
|
| Views: |
 |
4704 |
|
|
Which requests are handled by Apache, and which are handled by Tomcat?
|
We run Apache as a front-end for Tomcat, using mod_jk. In this configuration, Apache sees all Web requests. It processes some itself, and hands others off to Tomcat for processing.
By default, we configure Apache to pass the following URL patterns to Tomcat:
*.do
*.jsp
/servlet/*
/servlets/*
If you would like Tomcat to handle other URL patterns, you need to request us to set that up for you. For example, if you have a servlet-based online store at http://www.yourdomain.com/store, then you probably want Apache to send all URL's of the form /store/* to Tomcat. Note that the default setup will work fine if all URL's in your store end in *.do or *.jsp.
Here are some additional considerations to keep in mind:
- You cannot specify a welcome file in web.xml. The welcome file for a directory is determined by normal Apache mechanisms (e.g., the .htaccess file).
- You can password-protect directories using normal Apache mechanisms (e.g., the icon in cPanel will work fine whether your site uses Apache, Tomcat, or some mix of the two).
- If you have an SSL-based site, your certificate is installed for Apache in the usual way, and any Tomcat requests can be done over SSL with no additional effort.
|