Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 20417 invoked by uid 500); 18 Jul 2001 20:46:01 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 20406 invoked from network); 18 Jul 2001 20:46:01 -0000 Message-ID: <20010718204604.98956.qmail@web12801.mail.yahoo.com> Date: Wed, 18 Jul 2001 13:46:04 -0700 (PDT) From: Davanum Srinivas Reply-To: dims@yahoo.com Subject: Fwd: Two Cocoon FAQ entries (version 0.0.1) To: cocoon-dev@xml.apache.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1035230614-995489164=:94100" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N --0-1035230614-995489164=:94100 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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/ --0-1035230614-995489164=:94100 Content-Type: message/rfc822 X-Apparently-To: dims@yahoo.com via web12806.mail.yahoo.com; 18 Jul 2001 13:06:37 -0700 (PDT) X-Track: 1: 40 Received: from mta43-acc.tin.it (EHLO fep43-svc.tin.it) (212.216.176.239) by mta523.mail.yahoo.com with SMTP; 18 Jul 2001 13:06:37 -0700 (PDT) Received: from bruegel ([62.211.33.167]) by fep43-svc.tin.it (InterMail vM.4.01.03.13 201-229-121-113) with SMTP id <20010718200419.HLJF17477.fep43-svc.tin.it@bruegel> for ; Wed, 18 Jul 2001 22:04:19 +0200 Reply-To: From: "Luca Morandini" To: Subject: Two Cocoon FAQ entries (version 0.0.1) Date: Wed, 18 Jul 2001 22:06:40 +0200 Message-ID: <000d01c10fc5$28dc1350$0100000a@bruegel.lmoran.it> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000E_01C10FD5.EC64E350" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <20010718170756.39072.qmail@web12805.mail.yahoo.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Content-Length: 5128 This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C10FD5.EC64E350 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Davanum, I've made this two FAQ entries related to Cocoon. I'd like you to assess them for later insertion under the Cocoon2 site. Best regards, P.S. I've put a version number on this document (0.0.1), in order to have a little configuration control over it. --------------------------------------------- �������������� Luca Morandini �������������� GIS Consultant ����������� lmorandini@ieee.org ��������� +39 0744 59� 85� 1 Office ��������� +39�0335 681 02 12 Mobile http://utenti.tripod.it/lmorandini/index.html --------------------------------------------- ------=_NextPart_000_000E_01C10FD5.EC64E350 Content-Type: text/plain; name="lm-faq.0.0.1.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="lm-faq.0.0.1.txt" -------------------------------------------------------------------------= ------ FAQ's entris by Luca MOrandini lmorandini@ieee.org Version 0.0.1 18/07/01 -------------------------------------------------------------------------= ------ -------------------------------------------------------------------------= ------ How could I have my Cocoon app in an URI other than /cocoon/ ? -------------------------------------------------------------------------= ------ 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. Test whether Tomcat passes everything under the /cocoon context to Cocoon. This may be tested by pointing your browser at :8080/cocoon/xsp/simple , if a text page named "A simple = XSP page", everything's fine. Now, suppose: 1) you have a Cocoon application named "foo" which works fine when = called with :8080/cocoon/foo 2) you want the "foo" app to be called from :8080/foo instead. The idea is just to redirect the desidered URI (foo) to the one within = the cocoon context (cocoon/foo). 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. 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). 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: LoadModule rewrite_module modules/ApacheModuleRewrite.dll (by the way, most probably, this line is already on the httpd.conf, you = just have to un-comment it). Add this line to httpd.conf in order to activate mod_rewrite: RewriteEngine On It is highly reccommended 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: RewriteLog "C:/logs/rewrite.log" RewriteLogLevel 9 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. Now, it's time to do the URI rewriting trick: RewriteRule foo/(.*) /cocoon/foo/$1 [PT] This line instructs Apache to redirect everything under "foo" to = "cocoon/foo" and passes it on to other processing ("[PT]" option), like mod_alias. Now, just restart Apache and point your browser to: :8080/foo/... it should work just fine. -------------------------------------------------------------------------= ------ How could I have my Cocoon app in a directory other than $TOMCAT_HOME/webapps/cocoon/ ? -------------------------------------------------------------------------= ------ 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. Let's suppose the following: 1) you have an application called "foo" which works perfectly when located under the %TOMCAT_HOME%\webapps\cocoon\foo directory. 2) you want it to be located under the "c:\foo" directory instead 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. Here's the sitemap.xmap fragment used to do this: 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). Now, you just need to copy everything which was under the = webapps/cocoon/foo directory to the /foo directory, and it should work graciously. ------=_NextPart_000_000E_01C10FD5.EC64E350-- --0-1035230614-995489164=:94100 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org --0-1035230614-995489164=:94100--