Larry
It worked perfectly!!!
I made the changes as suggested - ie apps-sota.xml changed to:
<Server>
<Host name="sota">
<Context path="" docBase="webapps/Sota" />
</Host>
<Host name="sota.silly.domain.net">
<Context path="" docBase="webapps/Sota" />
</Host>
</Server>
and changed
noRoot="false"
in server.xml.
This gave a mod_jk.conf like:
########## Auto generated on Fri Sep 07 08:37:28 BST 2001##########
<IfModule !mod_jk.c>
LoadModule jk_module /usr/lib/apache/mod_jk.so
</IfModule>
JkWorkersFile "/opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties"
JkLogFile "/opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log"
JkLogLevel emerg
JkMount /examples ajp13
JkMount /examples/* ajp13
JkMount /admin ajp13
JkMount /admin/* ajp13
JkMount /Sota ajp13
JkMount /Sota/* ajp13
JkMount / ajp13
JkMount /* ajp13
# To avoid Apache serving root welcome files from htdocs, update
DocumentRoot
# to point to: "/opt/jakarta-tomcat-3.3-b2/webapps/ROOT"
NameVirtualHost *
<VirtualHost *>
ServerName sota
JkMount / ajp13
JkMount /* ajp13
DocumentRoot "/opt/jakarta-tomcat-3.3-b2/webapps/Sota"
</VirtualHost>
<VirtualHost *>
ServerName sota.silly.domain.net
JkMount / ajp13
JkMount /* ajp13
DocumentRoot "/opt/jakarta-tomcat-3.3-b2/webapps/Sota"
</VirtualHost>
(which was much more like what I expected) and it worked completely with no
further changes.
Many thanks
Mark Muffett
PS One bug I have found: running startup.sh jkconf while tomcat is running
removes the ajp12.id file from the conf directory, so shutdown.sh doesn't
work.
----- Original Message -----
From: "Larry Isaacs" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 5:56 PM
Subject: RE: Tomcat 3.3b2 and mod_jk
> Mark,
>
> Sorry I overlooked a detail. Out of habbit, I included a
> context path for both contexts, "/Sota". This meant that
> the correct URL would have been http://sota/Sota/index0.jsp.
>
> Instead, you want the "Sota" web application served as the
> root context for the two virtual hosts. For this, change
> the contexts in the apps-sota.xml file to have:
>
> path=""
>
> and in the server.xml change the ApacheConfig module to have
>
> noRoot="false"
>
> The default behavior for Tomcat 3.3 is for Tomcat not to try
> to take control of Apache's "root" context.
>
> The setup I have available for testing doesn't allow me to test
> multiple virtual hosts fully. Your feedback will help me
> determine if it is able to work correctly in a real situation.
>
> Thanks,
> Larry
>
> > -----Original Message-----
> > From: Mark Muffett [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 06, 2001 12:11 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Tomcat 3.3b2 and mod_jk
> >
> >
> > Larry
> >
> > Thanks your your comments, but it gets worse and worse...
> >
> > I've tried to leave everything as auto-generated as possible. With an
> > apps-sota.xml file like:
> >
> > <Server>
> > <Host name="sota">
> > <Context path="/Sota" docBase="webapps/Sota" />
> > </Host>
> > <Host name="sota.silly.domain.net">
> > <Context path="" docBase="webapps/Sota" />
> > </Host>
> > </Server>
> >
> > I can access http://sota.silly.domain.net:8080/index0.jsp but not
> > http://sota:8080/index0.jsp (I don't understand why).
> >
> >
> > If I run startup with the jkconf option I get mod_jk.conf as follows:
> >
> > ########## Auto generated on Thu Sep 06 16:52:13 BST 2001##########
> >
> > <IfModule !mod_jk.c>
> > LoadModule jk_module /usr/lib/apache/mod_jk.so
> > </IfModule>
> >
> > JkWorkersFile "/opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties"
> > JkLogFile "/opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log"
> >
> > JkLogLevel emerg
> >
> >
> >
> > JkMount /examples ajp13
> > JkMount /examples/* ajp13
> >
> > JkMount /admin ajp13
> > JkMount /admin/* ajp13
> >
> > JkMount /Sota ajp13
> > JkMount /Sota/* ajp13
> >
> > NameVirtualHost *
> > <VirtualHost *>
> > ServerName sota
> >
> > JkMount /Sota ajp13
> > JkMount /Sota/* ajp13
> > </VirtualHost>
> >
> > <VirtualHost *>
> > ServerName sota.silly.domain.net
> > </VirtualHost>
> >
> >
> > Now I can't get either http://sota/index0.jsp or
> > http://sota.silly.domain.net/index0.jsp
> >
> > I know the auto-generated mod_jk.conf was a lot bigger with
> > Tomcat 3.3m4
> > (which I managed to get to work). (And I've tried copying
> > that across, but
> > it doesn't work either). Is there a bug here, or am I
> > missing something?
> >
> >
> > Thanks in advance for any help.
> >
> > Mark Muffett
> >
> >
> >
> > ----- Original Message -----
> > From: "Larry Isaacs" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, September 06, 2001 2:37 PM
> > Subject: RE: Tomcat 3.3b2 and mod_jk
> >
> >
> > > Hi Mark,
> > >
> > > I think things are misconfigured. For the URL
> > http://sota/index0.jsp,
> > > note that "sota" is all lowercase. I assume that Apache will use
> > > your "<VirtualHost sota>" to serve it. This virtual host is not
> > > "connected" to Tomat in any way. Thus, the JSP pages are coming
> > > straight out of DocumentRoot as static files.
> > >
> > > Also, this looks like an auto-generated config file, yet the
> > > "Sota" web application is missing. I'm not sure why. I'll assume
> > > that this a copy of the config file made before Sota was present.
> > >
> > > I would recommend taking advantage of auto-genaration as much
> > > as possible. To do this, I would add to the "conf" directory:
> > >
> > > ===== apps-sota.xml =====
> > > <Server>
> > > </Host name="sota">
> > > <Context path="/Sota" docBase="webapps/Sota" />
> > > </Host>
> > > </Host name="sota.silly.domain.net">
> > > <Context path="/Sota" docBase="webapps/Sota" />
> > > </Host>
> > > </Server>
> > > =========================
> > >
> > > Generate the "conf/auto/mod_jk.conf" file and see how close
> > > it is to what you want. It should have the basic structure
> > > you need. Rename it if you need to add some manual edits.
> > >
> > > Note that there will be three *separate* "Sota" contexts.
> > > Tomcat 3.3 will create a "Sota" context for the default host,
> > > virtual host "sota", and virtual host "sota.silly.domain.net".
> > >
> > > Hope this helps.
> > >
> > > Larry
> > >
> > > > -----Original Message-----
> > > > From: Mark Muffett [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, September 06, 2001 8:01 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Tomcat 3.3b2 and mod_jk
> > > >
> > > >
> > > > I'm trying to get Apache to work with Tomcat 3.3b2.
> > > >
> > > > Apache is working and Tomcat works on its own (so a request
> > > > through 8080
> > > > always works). My problem is that jsp pages requested
> > through port 80
> > > > always come straight from Apache (so the jsp code is not
> > > > processed) - so a
> > > > request for http://sota:8080/index0.jsp is fine, but
> > > > http://sota/index0.jsp
> > > > is returned without the jsp code processed.
> > > >
> > > > My mod_jk.conf is slightly modified from the auto (maybe I
> > > > shouldn't have
> > > > done this, but Apache wouldn't serve the files without
> > putting in the
> > > > Document Root):
> > > >
> > > >
> > > > <IfModule !mod_jk.c>
> > > > LoadModule jk_module /usr/lib/apache/mod_jk.so
> > > > </IfModule>
> > > >
> > > > JkWorkersFile
> > "/opt/jakarta-tomcat-3.3-b2/conf/jk/workers.properties"
> > > > JkLogFile "/opt/jakarta-tomcat-3.3-b2/logs/mod_jk.log"
> > > >
> > > > JkLogLevel debug
> > > >
> > > >
> > > > JkMount /examples ajp13
> > > > JkMount /examples/* ajp13
> > > >
> > > > JkMount /admin ajp13
> > > > JkMount /admin/* ajp13
> > > >
> > > > ###
> > > > # conf for Sota
> > > > ###
> > > >
> > > > JkMount /Sota ajp13
> > > > JkMount /Sota/* ajp13
> > > >
> > > > Alias /Sota "/opt/jakarta-tomcat-3.3-b2/webapps/Sota"
> > > > <Directory "/opt/jakarta-tomcat-3.3-b2/webapps/Sota">
> > > > Options FollowSymLinks
> > > > </Directory>
> > > >
> > > > <VirtualHost sota>
> > > > ServerName sota
> > > > DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota
> > > > CustomLog /var/log/httpd/access/sota combined
> > > > ErrorLog /var/log/httpd/error/sota
> > > > DirectoryIndex index.jsp index.htm index.html
> > > > </VirtualHost>
> > > >
> > > > <VirtualHost sota.silly.domain.net>
> > > > ServerName sota.silly.domain.net
> > > > DocumentRoot /opt/jakarta-tomcat-3.3-b2/webapps/Sota
> > > > CustomLog /var/log/httpd/access/sota combined
> > > > ErrorLog /var/log/httpd/error/sota
> > > > DirectoryIndex index.jsp index.htm index.html
> > > > </VirtualHost>
> > > >
> > > >
> > > >
> > > > The (I think) relevant part of the mod_jk.log is:
> > > >
> > > > [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (285)]: Into
> > > > jk_uri_worker_map_t::uri_worker_map_open, exact rule
> > > > /examples=ajp13 was
> > > > added
> > > > [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (267)]: Into
> > > > jk_uri_worker_map_t::uri_worker_map_open, match rule
> > > > /examples/=ajp13 was
> > > > added
> > > > [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (285)]: Into
> > > > jk_uri_worker_map_t::uri_worker_map_open, exact rule
> > > > /admin=ajp13 was added
> > > > [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (267)]: Into
> > > > jk_uri_worker_map_t::uri_worker_map_open, match rule
> > > > /admin/=ajp13 was added
> > > > [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (285)]: Into
> > > > jk_uri_worker_map_t::uri_worker_map_open, exact rule
> > > > /Sota=ajp13 was added
> > > > [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (267)]: Into
> > > > jk_uri_worker_map_t::uri_worker_map_open, match rule
> > > > /Sota/=ajp13 was added
> > > > [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (296)]: Into
> > > > jk_uri_worker_map_t::uri_worker_map_open, there are 6 rules
> > > > [Thu Sep 06 11:08:11 2001] [jk_uri_worker_map.c (317)]:
> > > > jk_uri_worker_map_t::uri_worker_map_open, done
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (82)]: Into wc_open
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (207)]: Into
> > > > build_worker_map,
> > > > creating 2 workers
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (213)]:
> > > > build_worker_map, creating
> > > > worker ajp12
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (138)]: Into
> > wc_create_worker
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (152)]:
> > > > wc_create_worker, about to
> > > > create instance ajp12 of ajp12
> > > > [Thu Sep 06 11:08:11 2001] [jk_ajp12_worker.c (264)]: Into
> > > > ajp12_worker_factory
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (161)]:
> > > > wc_create_worker, about to
> > > > validate and init ajp12
> > > > [Thu Sep 06 11:08:11 2001] [jk_ajp12_worker.c (182)]: Into
> > > > jk_worker_t::validate
> > > > [Thu Sep 06 11:08:11 2001] [jk_ajp12_worker.c (194)]: In
> > > > jk_worker_t::validate for worker ajp12 contact is localhost:8007
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (177)]:
> > > > wc_create_worker, done
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (223)]:
> > > > build_worker_map, removing
> > > > old ajp12 worker
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (213)]:
> > > > build_worker_map, creating
> > > > worker ajp13
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (138)]: Into
> > wc_create_worker
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (152)]:
> > > > wc_create_worker, about to
> > > > create instance ajp13 of ajp13
> > > > [Thu Sep 06 11:08:11 2001] [jk_ajp13_worker.c (911)]: Into
> > > > ajp13_worker_factory
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (161)]:
> > > > wc_create_worker, about to
> > > > validate and init ajp13
> > > > [Thu Sep 06 11:08:11 2001] [jk_ajp13_worker.c (432)]: Into
> > > > jk_worker_t::validate
> > > > [Thu Sep 06 11:08:11 2001] [jk_ajp13_worker.c (445)]: In
> > > > jk_worker_t::validate for worker ajp13 contact is localhost:8009
> > > > [Thu Sep 06 11:08:11 2001] [jk_ajp13_worker.c (471)]: Into
> > > > jk_worker_t::init
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (177)]:
> > > > wc_create_worker, done
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (223)]:
> > > > build_worker_map, removing
> > > > old ajp13 worker
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (235)]:
> > > > build_worker_map, done
> > > > [Thu Sep 06 11:08:11 2001] [jk_worker.c (102)]: wc_open, done
> > > > [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (343)]: Into
> > > > jk_uri_worker_map_t::map_uri_to_worker
> > > > [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (360)]:
> > > > Attempting to map
> > > > URI '/index0.jsp'
> > > > [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (445)]:
> > > > jk_uri_worker_map_t::map_uri_to_worker, done without a match
> > > > [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (343)]: Into
> > > > jk_uri_worker_map_t::map_uri_to_worker
> > > > [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (360)]:
> > > > Attempting to map
> > > > URI '/sota.css'
> > > > [Thu Sep 06 11:08:58 2001] [jk_uri_worker_map.c (445)]:
> > > > jk_uri_worker_map_t::map_uri_to_worker, done without a match
> > > >
> > > >
> > > >
> > > > Any help would be very much appreciated.
> > > >
> > > > Thanks
> > > >
> > > > Mark Muffett
> > > >
> > > >
> > > >
> > >
> >
>