> This is more of an Apache question than a Cocoon question, but > hopefully someone will know what I'm doing wrong here. > > Setup: SPARC Solaris 2.7, Apache 1.3.24 w/mod_webapp (Warp), and Tomcat 4.0.1 > > Goal: Eliminate cocoon from the URL > Constraints: Want all my custom content (XML, stylesheets, etc.) to be removed > from the Cocoon tree so I can upgrade Cocoon separately. Must use Apache to > receive request. URL mapping has to be done per virtual host. > > I looked at the FAQ, and followed the instructions. I rebuilt Apache with mod_rewrite > enabled, then added the followed code to my httpd.conf: > > <VirtualHost myhost.mydomain:80> > ServerName myhost.mydomain > DocumentRoot /myhost.mydomain/htmls > > <IfModule mod_rewrite.c> > RewriteEngine on > RewriteLog /var/adm/www/rewrite.log > RewriteLogLevel 9 > RewriteRule ^/xml /cocoon/xml/ [R] > RewriteRule ^/xml(.*) /cocoon/xml$1 [R] > </IfModule> > > WebAppConnection conn warp myhost.mydomain:8008 > WebAppDeploy cocoon conn /cocoon > </VirtualHost> > > I also modified the Cocoon sitemap.xmap to forward the processing to a sitemap > outside of the Cocoon tree. > > This URL works: > > http://myhost.mydomain/cocoon/xml/foo > * Apache correctly passes the /cocoon/xml/foo address to > Tomcat which then passes it to Cocoon. Output is correct > > This URL > http://myhost.mydomain/xml/foo > is redirected to http://myhost.mydomain/cocoon/xml/foo > and the user sees it in the browser. Not what I wanted. > I tried the single line [PT] variation shown in the FAQ, and > as indicated there, this does not work at all.
This is what I use (apache 1.3.24, Tomcat 4.0.4): <VirtualHost www.mydomain> DocumentRoot /home/sites/www.mydomain RewriteEngine On RewriteRule ^/(.*)\.jsp$ /jsp/$1.jsp [R] RewriteRule ^/(.*)\.xml$ /xml/$1.xml [R] <IfModule mod_webapp.c> WebAppConnection netConnection warp www.mydomain:8008 WebAppDeploy Servlets netConnection /Servlet WebAppDeploy cocoon netConnection /xml WebAppDeploy jsp netConnection /jsp </IfModule> </VirtualHost> (I have similar entries, with different WebAppConnections, for the other virtual hosts). This way http://www.mydomain/test.xml gets redirected to http://www.mydomain/xml/test.xml which gets passed on to cocoon (Servlets and jsp references get passed on directly to Tomcat). Make sure that the tomcat server.xml entry has a connector for each virutal host in the Tomcat-Apache Service section, e.g.: <Connector className="org.apache.catalina.connector.warp.WarpConnector" port="8008" address="10.9.8.7" minProcessors="5" maxProcessors="75" enableLookups="true" appBase="www.mydomain_apps" acceptCount="10" debug="0"/> -- Dr. Everett (Skip) Carter Phone: 831-641-0645 FAX: 831-641-0647 Taygeta Scientific Inc. INTERNET: [EMAIL PROTECTED] 1340 Munras Ave., Suite 314 WWW: http://www.taygeta.com Monterey, CA. 93940 --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>