I think that you must adress this question to the tomcat mailing list because the answer is not specific to struts AFAIK.
Sorry per advance for my (poor) english.
I use Apache 1.3.27 with JK 1.2.2 on Windows 2000 with virtual hosts.
I have 3 tomcat contexts accessible on my server :
- admin and manager on the principal webserver
- toto on a dns based virtual host (it's only an exemple name, the real name is different)
Admin and manager tomcat contexts are located on a folder specific to tomcat, i.e. is not under the documentroot (d:/www) of my apache webserver. toto is loaded from a context file referencing a war file.
My webapps always reside in a context different from ROOT context in Tomcat (each webapps is accessible under www.myserver.com/webappname/ ).
For having multiple webapps located just under the root (accessible from www.myserver.com/, you must configure virtual hosts in tomcat, which is not convered by my answer (and i not use this)
I think that if you reference a directory under apache documentroot who contain the static and the dynamic files (jsp and co) you just have to adjust the following settings :
in my httpd .conf i have the following configuration (note the mount of the admin context for remote management in the intranet) :
### Section DSO
...
# Load mod_jk module
LoadModule jk_module "D:\$httpd-root\modules\mod_jk-1.3.dll" # adjust with the DSO module on unix (tested ok on MacOS X)
# Apache Modules compiled into the standard Windows build
ClearModuleList ... # Declare the JK module for <IfModule directive> AddModule mod_jk.c ...
### Section Global mod_jk configuration
# Where to find workers.properties
JkWorkersFile conf/jk/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info #Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " #JkOptions indicate to send SSL KEY SIZE, JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories #JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T"
### Section 3: Virtual Hosts
# Please see the documentation at <URL:http://www.apache.org/docs/vhosts/> # for further details before you try to setup virtual hosts.
# # VirtualHost bas�s sur le nom #
# on ecoute les requetes adressees a toutes les adresses IP
NameVirtualHost 192.168.253.50
<VirtualHost 192.168.253.50> ServerName web DocumentRoot "d:/www/"
....
Order Deny,Allow Deny from all Allow from 192.168.253.*
# Send servlet for context /admin to worker named worker1 JkMount /admin/* worker1 # Send servlet for context /manager to worker named worker1 JkMount /manager/* worker1
</VirtualHost>
and :
<VirtualHost 192.168.253.50>
ServerName www.toto.com
DocumentRoot "d:/www/toto" <!-- here reside the static website for toto.com, perhaps you can place your expanded webapps under this folder is you want to use
ErrorLog logs/www.toto.com/error_log CustomLog logs/www.toto.com/access_log combined
# Send servlet for context /toto to worker named worker2
JkMount /toto/* worker2 <!-- try to use : JkMount /toto/*.jsp worker2 and /toto/*.do worker2 or JkMount /*.jsp worker2...
<Directory "d:/www/toto">
Options FollowSymLinks
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory></VirtualHost>
i have the following workers.property file in $httpd_root/conf/jk : # Workers configuration worker.list=worker1 worker.list=worker2
# Set properties for worker1 (ajp13) worker.worker1.type=ajp13
# Use the tomcat installed on toto worker.worker1.host=192.168.253.50 worker.worker1.port=8007
# Use the tomcat installed on buggs #worker.worker1.host=192.168.253.52 #worker.worker1.port=8009
worker.worker1.lbfactor=50 worker.worker1.cachesize=10 worker.worker1.cache_timeout=600 worker.worker1.socket_keepalive=1 worker.worker1.socket_timeout=300
# Set properties for worker2 (ajp13) worker.worker2.type=ajp13
# Use the tomcat installed on toto worker.worker2.host=192.168.253.50 worker.worker2.port=8009
# Use the tomcat installed on buggs #worker.worker2.host=192.168.253.52 #worker.worker2.port=8009
worker.worker2.lbfactor=50 worker.worker2.cachesize=10 worker.worker2.cache_timeout=600 worker.worker2.socket_keepalive=1 worker.worker2.socket_timeout=300
For tomcat i have the following conf in $tomcat_root/conf/workers.properties :
# Workers configuration for Toto
workers.tomcat_home=d:/$httpd_root/tools/tomcat
workers.java_home=$(JAVA_HOME)
ps=\
worker.list=worker1 worker.ajp13.port=8007 worker.ajp13.host=192.168.253.50 worker.ajp13.type=ajp13 worker.ajp13.lbfactor=1
worker.list=worker2 worker.ajp13.port=8009 worker.ajp13.host=192.168.253.50 worker.ajp13.type=ajp13 worker.ajp13.lbfactor=1
worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=worker1,worker2
And in server.xml :
<Service...>
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector" acceptCount="10" bufferSize="2048" connectionTimeout="20000" debug="5" disableUploadTimeout="false" enableLookups="false" maxProcessors="75" minProcessors="5" port="8007" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" proxyPort="0" redirectPort="443" scheme="http" secure="false" tcpNoDelay="true" useURIValidationHack="false">
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector" acceptCount="10" bufferSize="2048" connectionTimeout="20000" debug="5" disableUploadTimeout="false" enableLookups="false" maxProcessors="75" minProcessors="5" port="8009" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" proxyPort="0" redirectPort="443" scheme="http" secure="false" tcpNoDelay="true" useURIValidationHack="false">
...
(classic host and contexts declarations here, toto is declared here in the production server or is loaded dynamically on the development server - i think that you must define your virtual hosts here if you want to use multiple webapps at )
<Engine className="org.apache.catalina.core.StandardEngine" debug="3" defaultHost="192.168.253.50" mapperClass="org.apache.catalina.core.StandardEngineMapper" name="Standalone">
<Host className="org.apache.catalina.core.StandardHost" appBase="D:\\$http_root\\tools\\tomcat\\repository" autoDeploy="true" configClass="org.apache.catalina.startup.ContextConfig" contextClass="org.apache.catalina.core.StandardContext" debug="3" deployXML="true" errorReportValveClass="org.apache.catalina.valves.ErrorReportValve" liveDeploy="false" mapperClass="org.apache.catalina.core.StandardHostMapper" name="192.168.253.50" unpackWARs="true">
<Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="false" debug="2" displayName="Tomcat Administration Application" docBase="../server/webapps/admin" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/admin" privileged="true" reloadable="false" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper">
<Logger className="org.apache.catalina.logger.FileLogger" debug="0" directory="logs" prefix="admin" suffix=".log" timestamp="false" verbosity="1"/>
</Context>
<Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="false" debug="0" displayName="Tomcat Manager Application" docBase="../server/webapps/manager" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/manager" privileged="true" reloadable="false" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper">
<Logger className="org.apache.catalina.logger.FileLogger" debug="0" directory="logs" prefix="manager" suffix=".log" timestamp="false" verbosity="1"/>
<ResourceLink global="UserDatabase" name="users" type="org.apache.catalina.UserDatabase"/>
<!-- you can restrict access to the webapp here : -->
</Context>
<Logger className="org.apache.catalina.logger.FileLogger" debug="3" directory="logs" prefix="localhost_" suffix=".log" timestamp="true" verbosity="3"/>
</Host>
<Logger className="org.apache.catalina.logger.FileLogger" debug="3" directory="logs" prefix="catalina" suffix=".log" timestamp="true" verbosity="3"/>
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" debug="0" resourceName="UserDatabase" validate="true"/>
</Engine>
...
</Service>
I think that it is all. I will greatly appreciate any comment about these settings.
Sasha Bilton wrote:
Hi,
I'm running an Apache (1.3) webserver on linux (Suse 8) that has multiple virtual hosts. I'm using JkMount (AJP 13) to get Tomcat to handle my Struts .jsp files. At the moment JkMount only looks in ROOT for jsp files, so even though I have the doc root set to /home/bob/jakarta/webapps/bob and happily serves .html from that directory, if I try and point to a .jsp file it looks in webapps/ROOT.
That would be fine if I where just running one site, but I need to be able to look in multiple directories under webapps for my Struts files.
Also, should I do anything special to handle the .do extension in my JkMount settings?
Many, many thanks in advance!
Sasha
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Ludovic Ma�tre
Factory Productions | T�l: (33) 04 93 07 08 00 149, avenue des mimosas | Fax: (33) 04 93 07 04 02 06700 Saint-Laurent-du-Var (France) | Web: http://www.factory.fr
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

