For Apache 1.3, mod_jk 1.2, and Tomcat 4.1 I use the following generic config on a per virtual host basis. In my case I set the server.xml Host appBase for each virtual host to their Apache Document root.
<VirtualHost xxx.xxx.xxx.xxx:80> DocumentRoot /path/to/apache/document/root/for/host DirectoryIndex index.html index.htm index.shtml index.jsp # ... other config directives # Automatically mounts web applications found in document root JkAutoAlias /path/to/apache/document/root/for/host # Log tomcat requests processed by mod_jk with request latency JkRequestLogFormat "%w %v \"%r\" %U %s %T" # For JSP JkMount /*.jsp ajp13 # For Struts JkMount /*.do ajp13 # For servlets JkMount /*/servlet/ ajp13 # For the manager app JkMount /manager/* ajp13 </VirtualHost> Turner, John wrote: > Agreed. In my book, "/servlet/*" is equal to > "/whatever-name-you-want-to-put-here-it-doesn't-have-to-be-servlet/*". ;) > > I'd rather only send particular requests to Tomcat. Seems to make more > sense to me that way...sending everything to Tomcat but setting up some > convoluted mod_rewrite rules to get Apache to behave seems like more work, > but that's me. Messing with Apache also means that you have to hurt > everything else that Apache is doing to see your config changes. I haven't > had much luck with "apachectl graceful". At least by mapping requests to > Tomcat, you can take Tomcat up and down without affecting Apache. > > Tastes great, less filling. :) > > John > > >>-----Original Message----- >>From: Milt Epstein [mailto:[EMAIL PROTECTED]] >>Sent: Tuesday, October 15, 2002 2:50 PM >>To: Tomcat Users List >>Subject: RE: static rules for jk/ajp13 >> >> >> >>Well, I don't want to argue either :-), but I'm not sure it's really >>the conventional way. It used to be -- i.e. using URLs with >>"/servlet/" in them was the original way to invoke servlets, IIRC. >>But nowadays, with all the changes to the servlet spec and how >>servlets are defined and invoked, I believe it's out of favor, and >>even discouraged. >> >>And I'm not sure it's the easiest way either (of course, the question >>is, "easiest for whom"? This may be easier for the sysadmin, but then >>it's not necessarily easier for the developer. I'm a developer >>myself, and I've had some conflict with my sysadmin about things like >>this :-). Now, with the way things are separated with Tomcat when >>used in conjunction with Apache, some conflicts naturally arise. >>Maybe some of the future directions in how this is set up in Tomcat >>will ease these conflicts. >> >>And of course, "easiest" shouldn't necessarily be the main/only >>criterion to use to decide these things. Other considerations like >>security and user-friendliness should probably be more important. We >>all saw the security problem that popped up recently related to using >>URL's with "/servlet/". Yes, I know there are ways to avoid that >>problem while still making use of URL's with "/servlet/", but it may >>just be better to avoid them totally. >> >>Anyway, there's my $.02 on it :-). >> > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>