Thanks Luca. Thanks John.
-- dims
--- "Morrison, John" <[EMAIL PROTECTED]> wrote:
> Here's the same content as a patch.
>
> > -----Original Message-----
> > From: Davanum Srinivas [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, 18 July 2001 9:46 pm
> > To: [EMAIL PROTECTED]
> > Subject: Fwd: Two Cocoon FAQ entries (version 0.0.1)
> >
> >
> > FYI. Here are two entries from Luca.
> >
> > Note: forwarded message attached.
> >
> >
> > =====
> > Davanum Srinivas, JNI-FAQ Manager
> > http://www.jGuru.com/faq/JNI
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/
> >
>
>
>
> =======================================================================
> Information in this email and any attachments are confidential, and may
> not be copied or used by anyone other than the addressee, nor disclosed
> to any third party without our permission. There is no intention to
> create any legally binding contract or other commitment through the use
> of this email.
>
> Experian Limited (registration number 653331).
> Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
> > Index: faq.xml
> ===================================================================
> RCS file: /home/cvspublic/xml-cocoon2/xdocs/faq.xml,v
> retrieving revision 1.5
> diff -u -r1.5 faq.xml
> --- faq.xml 2001/07/18 11:11:38 1.5
> +++ faq.xml 2001/07/19 09:20:58
> @@ -199,4 +199,111 @@
> </source>
> </answer>
> </faq>
> +<faq>
> + <question>How could I have my Cocoon app in an URI other than
> + <you-server>/cocoon/<my-app>?
> + </question>
> + <answer>
> + <p>Note: This entry refers only to an Apache + Tomcat + Cocoon configuration,
> + and was tested under: Windows NT 4.0 + Apache 1.3.14 + Tomcat 3.2 + Cocoon
> + 2.0b1.
> + </p>
> + <p>Test whether Tomcat passes everything under the /cocoon context to
> + Cocoon. This may be tested by pointing your browser at
> + <your-server>:8080/cocoon/xsp/simple, if a text page named
> + "A simple XSP page", everything's fine.
> + </p>
> + <p>Now, suppose:</p>
> + <ol>
> + <li>you have a Cocoon application named "foo" which works fine when
> + called with <your-server>:8080/cocoon/foo
> + </li>
> + <li>you want the "foo" app to be called from
> + <your-server>:8080/foo instead.
> + </li>
> + </ol>
> + <p>The idea is just to redirect the desidered URI (foo) to the one within
> + the cocoon context (cocoon/foo).
> + </p>
> + <p>Since this has to be done before the URI is processed by Tomcat, it is
> + just natural to use Apache for this. And, of course the user should not
> + notice the redirection.
> + </p>
> + <p>Apache has an handy feature called mod_rewrite which does just this: URI
> + rewriting (see the "URL Rewriting Guide" in the Apache user's guide for
> + details).
> + </p>
> + <p>First of all, you should instruct Apache to load the mod_rewrite, hence,
> + you should add (on a Windows system) this line to the httpf.conf:
> + </p>
> + <source>LoadModule rewrite_module modules/ApacheModuleRewrite.dll</source>
> + <p>(by the way, most probably, this line is already on the httpd.conf, you
> + just have to un-comment it).
> + </p>
> + <p>Add this line to httpd.conf in order to activate mod_rewrite:</p>
> + <source>RewriteEngine On</source>
> + <p>It is highly recommended to use the logging option of mod_rewrite, in
> + order to check the correctness of the URI rewriting; just add this lines
> + to the httpd.conf:</p>
> + <source>
> +RewriteLog "C:/logs/rewrite.log"
> +RewriteLogLevel 9
> + </source>
> + <p>The first line tells Apache to put the URI rewriting log in the
> + c:\logs\rewrite.log file (which happens to be on a Windows system, of
> + course). The second one tells Apache to record everything mod_rewrite
> + does, if you don't want to log anything, just set the RewriteLogLevel to
> + 0.
> + </p>
> + <p>Now, it's time to do the URI rewriting trick:</p>
> + <source>RewriteRule foo/(.*) /cocoon/foo/$1 [PT]</source>
> + <p>This line instructs Apache to redirect everything under "foo" to
> + "cocoon/foo" and passes it on to other processing ("[PT]" option),
> + like mod_alias.
> + </p>
> + <p>Now, just restart Apache and point your browser to:</p>
> + <source><your-server>:8080/foo/<something>...</source>
> + <p>it should work just fine.</p>
> + </answer>
> +</faq>
> +<faq>
> + <question>How could I have my Cocoon app in a directory other than
> + $TOMCAT_HOME/webapps/cocoon/<my-app>?
> + </question>
> + <answer>
> + <p>Note: This entry refers only to an Apache + Tomcat + Cocoon configuration,
> + and was tested under: Windows NT 4.0 + Apache 1.3.14 + Tomcat 3.2 + Cocoon
> + 2.0b1.
> + </p>
> + <p>Let's suppose the following:</p>
> + <ol>
> + <li>you have an application called "foo" which works perfectly when
> + located under the %TOMCAT_HOME%\webapps\cocoon\foo directory.
> + </li>
> + <li>you want it to be located under the "c:\foo" directory instead</li>
> + </ol>
> + <p>This could be done pretty easily twisting a little bit the sitemap. The
> + idea is to mount the sub-sitemap of the "foo" application on a specific
> + location on the file system, rather than under the deafult cocoon context.
> + </p>
> + <p>Here's the sitemap.xmap fragment used to do this:</p>
> + <source>
> + <![CDATA[
> +<map:pipeline>
> + <map:match pattern="foo/**">
> + <map:mount uri-prefix="foo" src="file:///c:/foo/"/>
> + </map:match>
> +</map:pipeline>
> + ]]>
> + </source>
> + <p>The "file:" type of source forces Cocoon to search the sub-sitemap under
> + the specified directory (which happens to be "c:\foo", since this is a
> + Windows system).
> + </p>
> + <p>Now, you just need to copy everything which was under the
> + webapps/cocoon/foo directory to the /foo directory, and it should work
> + graciously.
> + </p>
> + </answer>
> +</faq>
> </faqs>
>
> > ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]