A document has been updated:
http://cocoon.zones.apache.org/daisy/legacydocs/713.html
Document ID: 713
Branch: main
Language: default
Name: Environment Configuration FAQs (unchanged)
Document Type: Document (unchanged)
Updated on: 9/22/05 1:44:34 PM
Updated by: Helma van der Linden
A new version has been created, state: publish
Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 7998 bytes (previous version: 7415 bytes)
Content diff:
(30 equal lines skipped)
<li>Edit the server.xml file which is located under $TOMCAT_HOME/conf</li>
<li>Go to the line containing "Tomcat Root Context". (This should be a
comment).
</li>
--- <li>Add following line after that comment: <context path=""
docBase="/cocoon"
--- debug="0"/></li>
+++ <li>Add following line after that comment: <tt> <context path=""
+++ docBase="/cocoon" debug="0"/> </tt></li>
<li>Re-start Tomcat.</li>
<li>Try: http://www.foo.com:8080/ and the Cocoon welcome page should appear
</li>
(16 equal lines skipped)
<p>First of all, you should instruct Apache to load the mod_rewrite. Add
(on a
Windows system) to httpd.conf the following line:</p>
--- <p>LoadModule rewrite_module modules/ApacheModuleRewrite.dll</p>
+++ <pre> LoadModule rewrite_module modules/ApacheModuleRewrite.dll
+++ </pre>
<p>(By the way it's quite likely that this line is already on the
httpd.conf.
You just have to uncomment it).</p>
<p>Add this line to httpd.conf in order to activate mod_rewrite:</p>
--- <p>RewriteEngine On</p>
+++ <pre> RewriteEngine On
+++ </pre>
<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 these lines to the
httpd.conf:</p>
--- <p>RewriteLog "C:/logs/rewrite.log" RewriteLogLevel 9</p>
+++ <pre> RewriteLog "C:/logs/rewrite.log"
+++ RewriteLogLevel 9
+++ </pre>
<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).
(2 equal lines skipped)
<p>Now, it's time to do the URI rewriting trick.</p>
--- <p>RewriteRule bar/(.*) /cocoon/bar/$1 [PT]</p>
+++ <pre> RewriteRule bar/(.*) /cocoon/bar/$1 [PT]
+++ </pre>
<p>This line instructs Apache to redirect everything under "bar" to
"cocoon/bar"
and to pass it on for other processing ("[PT]" option), like mod_alias.</p>
<p>Just restart Apache and point your browser to:</p>
--- <p><your-server>:8080/bar/<something></p>
+++ <pre> <your-server>:8080/bar/<something>
+++ </pre>
<p>It should work just fine.</p>
(28 equal lines skipped)
<p>Here's the sitemap.xmap fragment used to do this.</p>
+++ <pre><map:pipeline>
+++ <map:match pattern="foo/**">
+++ <map:mount uri-prefix="foo" src="file:///c:/foo/"/>
+++ </map:match>
+++ </map:pipeline>
+++
+++ </pre>
+++
<p>The "file:" type of source instructs Cocoon to search the sub-sitemap
under
the specified directory (which happens to be "c:\foo", since this is a
Windows
--- system). See explanation of file: URLs</p>
+++ system). See explanation of <a href="daisy:580">file: URLs</a></p>
<p>Now, you just need to copy everything which was under the
%TOMCAT_HOME%\webapps\cocoon\foo directory to the c:\foo directory, and it
should work graciously.</p>
<h2>How do I integrate Apache Server and Cocoon?</h2>
--- <p>See the Wiki page ApacheModProxy for a thorough discussion of this topic.
--- </p>
+++ <p>See the Wiki page
+++ <a href="http://wiki.apache.org/cocoon/ApacheModProxy">ApacheModProxy</a>
for a
+++ thorough discussion of this topic.</p>
<p>Another method is to use mod_jk. Add the following line to
--- %APACHE_HOME%\conf\httpd.conf</p>
+++ <tt>%APACHE_HOME%\conf\httpd.conf</tt></p>
--- <p>JkMount /cocoon/* ajp12</p>
+++ <pre> JkMount /cocoon/* ajp12
+++ </pre>
<p>along with other directives that are already listed in mod_jk.conf-auto
in
the tomcat/conf directory. The above directives can be added at the end of
(25 equal lines skipped)
options depending on your environment.</p>
<p>If you are using the Sun JDK 1.4 then you can use the 'headless'
environment.
--- For more information about this see Headless UNIX and PJA.</p>
+++ For more information about this see <a href="daisy:637">Headless UNIX and
+++ PJA</a>.</p>
<p>Otherwise, an XServer is needed because of the Batik library that FOP
uses.
Batik uses Java's graphics code, which in turn requires the XServer. If you
(4 equal lines skipped)
<pre>$> Xvfb :1 -screen 0 800x600x8 &
$> export DISPLAY=:1
$> $TOMCAT_HOME/bin/startup.sh -f server.xml
--- ]]>
+++
</pre>
--- <p>See also UNIX with X server</p>
+++ <p>See also <a href="daisy:637">UNIX with X server</a>.</p>
<h2>How can I access Cocoon's status page in a mixed servlet environment
where
"/" is not mapped to Cocoon (only *.xml, *.xsp)?</h2>
<p>Just change the status pipeline so it matches a request with a ".xml"
extension:</p>
--- <pre>
---
---
---
---
+++ <pre> <map:match pattern="status.xml">
+++ <map:generate src="status" type="status"/>
+++ <map:transform src="welcome/status2html.xsl"/>
+++ <map:serialize/>
+++ </map:match>
</pre>
<p>Then you can access the status page with "status.xml".</p>
(3 equal lines skipped)
Fields
======
no changes
Links
=====
no changes
Custom Fields
=============
no changes
Collections
===========
no changes