You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Larry Isaacs <La...@sas.com> on 2001/12/03 14:57:31 UTC

RE: Tricky configuration problem of Tomcat 3.3 - Cocoon 1.8.1 - A pache 1.3.19

Hi Andi,

You don't mention below what directives you added to inform
Apache how to find the "/siteos" resources.  You can try adding:

    forwardAll="false"

to the <ApacheConfig ...> entry to have a conf/auto/mod_jk.conf
file written that tries to allow Apache to serve static resources.
You can use this file as a starting point if it doesn't quite
generate the file you need.

If you want the "root" context included, set:

    noRoot="false"

as well.  Since Apache has its own idea about where the "root"
resources are, i.e. DocumentRoot, and Tomcat thinks they are
in "webapps/ROOT", you will need to update your configuration
to choose one or the other.  You can either point Apache's
DocumentRoot to "webapps/ROOT" or convert Apache's "htdocs"
into a web application and point Tomcat's "root" context
to Apache's converted "htdocs".

Hope this helps.

Cheers,
Larry


> -----Original Message-----
> From: Andreas Germeroth [mailto:ag@siteos.de]
> Sent: Saturday, December 01, 2001 7:56 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Tricky configuration problem of Tomcat 3.3 - Cocoon 1.8.1 -
> Apache 1.3.19
> 
> 
> Hello everybody,
> 
> 
> 
> My System environment: 
> 
> 
> 
> Tomcat 3.3  / mod_jk
> 
> Cocoon 1.8.1  
> 
> Apache 1.3.19 
> 
> 
> 
> on Linux 2.4.4 . (mod_jk.conf and apps-context.xml are appended)
> 
> 
> 
> I have to migrate an existing Cocoon - WebApplication from JServ to
> 
> Tomcat. 
> 
> 
> 
> First I had set up a context path "/siteos" which directs all requests
> 
> to Tomcat, just for
> 
> testing if Cocoon works and all classpathes are correct. This worked
> 
> fine ( *.xml files are processed by Cocoon), but this is not 
> what I want
> 
> in a production environment, because all requests behind "/siteos" are
> 
> directed to Tomcat, static html- files, images and so on... Tomcat
> 
> should get only the "/*.xml" and "/servlet" requests, alle the other
> 
> request should be handled by Apache. 
> 
> The first step I tried was to change mod_jk.conf :
> 
> 
> 
> JkMount /siteos/servlet/* ajp13
> 
> JkMount /siteos/*.xml ajp13
> 
> 
> 
> The procseesing of xml and servlets worked correctly, but the other
> 
> ressources of the application (images, javascripts,..) could not be
> 
> found by apache. To solve this Problem
> 
> one has to adjust the directory structure of the application and thats
> 
> not what I want :-)
> 
> 
> 
> Without changing the directory structure *.xml Files should 
> be processed
> 
> by cocoon without a context path.
> 
> Then I set up the default context path "" with points to the document
> 
> root of the Apache Web server (see apps-context.xm) and configured
> 
> mod_jk to direct "*.xml" files and "/servlet" to Tomcat (see
> 
> mod_jk.conf). Servlets are still working. Unfortunately "*.xml" files
> are not
> 
> processed by Coocon and trigger a simple file download in the browser.
> 
> Just for testing I tried a *.jsp and put it in the same 
> directory as the
> xmls, the jsp was compiled and executed by tomcat, so that works also
> 
> 
> 
> All log levels are set to DEBUG to find out what happens. In 
> the jk.log
> 
> the *.xml files are recognized correct.
> 
> jk.log
> 
> -------
> 
> [Sat Dec 01 13:09:26 2001]  [jk_uri_worker_map.c (351)]: Into
> 
> jk_uri_worker_map_t::map_uri_to_worker
> 
> [Sat Dec 01 13:09:26 2001]  [jk_uri_worker_map.c (368)]: Attempting to
> 
> map URI '/standard.xml'
> 
> [Sat Dec 01 13:09:26 2001]  [jk_uri_worker_map.c (416)]:
> 
> jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match ajp13 ->
> 
> *.xml
> 
> ------
> 
> There is no print out in the servlet.log and in the tc.log. In the
> Apache access_log there is a 200 - OK entry, due to the "normal" file
> download.
> 
> In my opinion the problem is somewhere in Tomcat, as the requests are
> directed to Tomcat by mod_jk.
> 
> 
> Thanks for your help,
> 
> best regards
> 
> Andi
> 
> 
> 
> mod_jk.conf 
> 
> -----------------------------------------
> 
> LoadModule    jk_module  /sostest/tomcat/modules/mod_jk.so
> 
> AddModule     mod_jk.c
> 
> 
> 
> <IfModule mod_jk.c>
> 
> JkWorkersFile /sostest/tomcat/conf/jk/workers.properties
> 
> JkLogFile  /sostest/tomcat/logs/jk.log
> 
> JkLogLevel debug
> 
> 
> 
> AddType text/xml .xml
> 
> 
> 
> JkMount /siteos ajp13
> 
> JkMount /siteos/* ajp13
> 
> 
> 
> JKMount /*.jsp ajp13
> 
> JKMount /*.xml ajp13
> 
> JKMount /servlet/* ajp13
> 
> </IfModule>
> 
> ------------------------------------------
> 
> 
> 
> apps-context.xml
> 
> ------------------------------------------
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <webapps>
> 
>     <!-- Setting special properties for /examples 
> 
>          ( as an example of overriding the defaults )
> 
>       -->
> 
> 
> 
>    <Context path="/siteos" 
> 
>             docBase="/sostest/siteos/www/htdocs" 
> 
>             debug="1" 
> 
>             reloadable="true" > 
> 
>               <SimpleRealm filename="conf/users/example-users.xml" />
> 
>               <LogSetter name="siteos_tc.log" 
> path="logs/siteos.log" />
> 
>               <LogSetter name="siteos_servlet_log" 
> 
>                          path="logs/servlet_siteos.log" 
> 
>                          servletLogger="true"/>
> 
>   </Context>
> 
>  <Context path=""
> 
>             docBase="/sostest/siteos/www/htdocs"
> 
>             debug="1"
> 
>             reloadable="true" >
> 
>               <SimpleRealm filename="conf/users/example-users.xml" />
> 
>               <LogSetter name="siteos_tc.log" 
> path="logs/siteos.log" />
> 
>               <LogSetter name="siteos_servlet_log"
> 
>                          path="logs/servlet_siteos.log"
> 
>                          servletLogger="true"/>
> 
>   </Context>
> 
> </webapps>
> 
> ------------------------------------------
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Tricky configuration problem of Tomcat 3.3 - Cocoon 1.8.1 - Apache 1.3.19

Posted by Andi Germeroth <an...@SiteOS.de>.
Just for Information :

The problem was a "simple" Apache , Mime-Type Problem.
The stupid entry

AddType text/html .xml

in "mod_jk.conf" solved my Problem. (we generate HTML from XML)

The problem only occurs if the XML is accessed by the ROOT - Context

http://servername/standard.xml

not by anotherone.

http://servername/contextname/standard.xml

Best regards

Andi

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Tricky configuration problem of Tomcat 3.3 - Cocoon 1.8.1 - Apache 1.3.19

Posted by Andi Germeroth <an...@SiteOS.de>.
Hello Larry, hello all

> You don't mention below what directives you added to inform
> Apache how to find the "/siteos" resources.  You can try adding:

I do a simple "Include" in the httpd.conf

Include /sostest/tomcat/conf/jk/mod_jk.conf

I don't use the autogenerated mod_jk.conf. My mod_jk.conf was at the
bottom of the first message.
Here again :

-------------
LoadModule    jk_module  /sostest/tomcat/modules/mod_jk.so
AddModule     mod_jk.c

<IfModule mod_jk.c>
JkWorkersFile /sostest/tomcat/conf/jk/workers.properties
JkLogFile  /sostest/tomcat/logs/jk.log
JkLogLevel debug
JkMount /examples/* ajp12
# AddType text/xml .xml

JkMount /siteos ajp13
JkMount /siteos/* ajp13
#JkMount /siteos/*.xml ajp13
#JKMount /siteos/servlet/* ajp13
JKMount /*.xml ajp13
JKMount /*.jsp ajp13

JKMount /servlet/* ajp13
</IfModule>
-------------


> 
>     forwardAll="false"
> 
> 
>     noRoot="false"
> 

I think this configurations you describe have the same output in the
auto generated
"mod_jk.conf" that in my "mod_jk.conf".
The entries

JKMount /*.jsp ajp13
JKMount /*.xml ajp13

instruct apache only to forward *.xml / *.jsp  files to Tomcat. 
The problem is, thar the JSP files work (i.e.
http://servername/test.jsp) and the XML Files do not work (i.e.
http://servername/test.xml) , so in my opinion the
mod_jk.conf is ok.

The entry in the jk.log 
------------------
[Sat Dec 01 13:09:26 2001]  [jk_uri_worker_map.c (416)]:
jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match ajp13
->*.xml
-------------------
proves that mod_jk handles the request correct.

I noticed a very strange effect:

When I first access 

http://servername/siteos/standard.xml

and after that access

http://servername/standard.xml

it works also, this means when the document is in the Cocoon Cache (due
to the first access)  and has not to be processed but, printed out from
Memory... 

Perhaps something in Cocoon ?

For info the web.xml :
----------------------
<web-app>
 <servlet>
  <servlet-name>org.apache.cocoon.Cocoon</servlet-name>
  <servlet-class>org.apache.cocoon.Cocoon</servlet-class>
  <init-param>
   <param-name>properties</param-name>
   <param-value>cocoon.properties</param-value>
  </init-param>
 </servlet>

 <servlet-mapping>
  <servlet-name>org.apache.cocoon.Cocoon</servlet-name>
  <url-pattern>*.xml</url-pattern>
 </servlet-mapping>
----------------------

Any ideas ?

Best Regards

Andi

> > -----Original Message-----
> > From: Andreas Germeroth [mailto:ag@siteos.de]
> > Sent: Saturday, December 01, 2001 7:56 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Tricky configuration problem of Tomcat 3.3 - Cocoon 1.8.1 -
> > Apache 1.3.19
> >
> >
> > Hello everybody,
> >
> >
> >
> > My System environment:
> >
> >
> >
> > Tomcat 3.3  / mod_jk
> >
> > Cocoon 1.8.1
> >
> > Apache 1.3.19
> >
> >
> >
> > on Linux 2.4.4 . (mod_jk.conf and apps-context.xml are appended)
> >
> >
> >
> > I have to migrate an existing Cocoon - WebApplication from JServ to
> >
> > Tomcat.
> >
> >
> >
> > First I had set up a context path "/siteos" which directs all requests
> >
> > to Tomcat, just for
> >
> > testing if Cocoon works and all classpathes are correct. This worked
> >
> > fine ( *.xml files are processed by Cocoon), but this is not
> > what I want
> >
> > in a production environment, because all requests behind "/siteos" are
> >
> > directed to Tomcat, static html- files, images and so on... Tomcat
> >
> > should get only the "/*.xml" and "/servlet" requests, alle the other
> >
> > request should be handled by Apache.
> >
> > The first step I tried was to change mod_jk.conf :
> >
> >
> >
> > JkMount /siteos/servlet/* ajp13
> >
> > JkMount /siteos/*.xml ajp13
> >
> >
> >
> > The procseesing of xml and servlets worked correctly, but the other
> >
> > ressources of the application (images, javascripts,..) could not be
> >
> > found by apache. To solve this Problem
> >
> > one has to adjust the directory structure of the application and thats
> >
> > not what I want :-)
> >
> >
> >
> > Without changing the directory structure *.xml Files should
> > be processed
> >
> > by cocoon without a context path.
> >
> > Then I set up the default context path "" with points to the document
> >
> > root of the Apache Web server (see apps-context.xm) and configured
> >
> > mod_jk to direct "*.xml" files and "/servlet" to Tomcat (see
> >
> > mod_jk.conf). Servlets are still working. Unfortunately "*.xml" files
> > are not
> >
> > processed by Coocon and trigger a simple file download in the browser.
> >
> > Just for testing I tried a *.jsp and put it in the same
> > directory as the
> > xmls, the jsp was compiled and executed by tomcat, so that works also
> >
> >
> >
> > All log levels are set to DEBUG to find out what happens. In
> > the jk.log
> >
> > the *.xml files are recognized correct.
> >
> > jk.log
> >
> > -------
> >
> > [Sat Dec 01 13:09:26 2001]  [jk_uri_worker_map.c (351)]: Into
> >
> > jk_uri_worker_map_t::map_uri_to_worker
> >
> > [Sat Dec 01 13:09:26 2001]  [jk_uri_worker_map.c (368)]: Attempting to
> >
> > map URI '/standard.xml'
> >
> > [Sat Dec 01 13:09:26 2001]  [jk_uri_worker_map.c (416)]:
> >
> > jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match ajp13 ->
> >
> > *.xml
> >
> > ------
> >
> > There is no print out in the servlet.log and in the tc.log. In the
> > Apache access_log there is a 200 - OK entry, due to the "normal" file
> > download.
> >
> > In my opinion the problem is somewhere in Tomcat, as the requests are
> > directed to Tomcat by mod_jk.
> >
> >
> > Thanks for your help,
> >
> > best regards
> >
> > Andi
> >
> >
> >
> > mod_jk.conf
> >
> > -----------------------------------------
> >
> > LoadModule    jk_module  /sostest/tomcat/modules/mod_jk.so
> >
> > AddModule     mod_jk.c
> >
> >
> >
> > <IfModule mod_jk.c>
> >
> > JkWorkersFile /sostest/tomcat/conf/jk/workers.properties
> >
> > JkLogFile  /sostest/tomcat/logs/jk.log
> >
> > JkLogLevel debug
> >
> >
> >
> > AddType text/xml .xml
> >
> >
> >
> > JkMount /siteos ajp13
> >
> > JkMount /siteos/* ajp13
> >
> >
> >
> > JKMount /*.jsp ajp13
> >
> > JKMount /*.xml ajp13
> >
> > JKMount /servlet/* ajp13
> >
> > </IfModule>
> >
> > ------------------------------------------
> >
> >
> >
> > apps-context.xml
> >
> > ------------------------------------------
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <webapps>
> >
> >     <!-- Setting special properties for /examples
> >
> >          ( as an example of overriding the defaults )
> >
> >       -->
> >
> >
> >
> >    <Context path="/siteos"
> >
> >             docBase="/sostest/siteos/www/htdocs"
> >
> >             debug="1"
> >
> >             reloadable="true" >
> >
> >               <SimpleRealm filename="conf/users/example-users.xml" />
> >
> >               <LogSetter name="siteos_tc.log"
> > path="logs/siteos.log" />
> >
> >               <LogSetter name="siteos_servlet_log"
> >
> >                          path="logs/servlet_siteos.log"
> >
> >                          servletLogger="true"/>
> >
> >   </Context>
> >
> >  <Context path=""
> >
> >             docBase="/sostest/siteos/www/htdocs"
> >
> >             debug="1"
> >
> >             reloadable="true" >
> >
> >               <SimpleRealm filename="conf/users/example-users.xml" />
> >
> >               <LogSetter name="siteos_tc.log"
> > path="logs/siteos.log" />
> >
> >               <LogSetter name="siteos_servlet_log"
> >
> >                          path="logs/servlet_siteos.log"
> >
> >                          servletLogger="true"/>
> >
> >   </Context>
> >
> > </webapps>
> >


--
Andreas Germeroth

SiteOS AG
Weissenfelderstr. 3
85551 Heimstetten (München)

Tel.    +49 (0)89 90 77 66 - 00
Mobil   +49 (0)172 833 83 77
mailto:andi.germeroth@siteos.de

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>