You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Akber Choudhry <ak...@dyanet.com> on 2002/03/01 22:45:12 UTC

mod_rewrite mod_webapp config contribl

On Fri, 1 Mar 2002, Stefano Mazzocchi wrote:

>
> Can you donate your mod_rewrite configurations? that would make it a
> good example in the docs, at least.
Here it is -


NameVirtualHost domain.com
<VirtualHost domain.com:80>
ServerAdmin webmaster@domain.com
ServerName www.domain.com
ServerAlias domain.com
ErrorDocument 404 /cgi-bin/errors/monitor.cgi
ErrorDocument 500 /cgi-bin/errors/monitor.cgi

# Rewrite module has to be the last module in the Apache AddModule list
RewriteEngine On

# let apache handle

RewriteRule \.(gif|jpg|png|css|txt|html|js|pdf|cab|jar|php|xml)$ - [L]
RewriteRule ^/cgi-bin - [L]
# my apache site monitor
RewriteRule ^/watch-info - [L]
RewriteRule ^/$	/cocoon/index [L,PT]
# other servlet applications - passed through
RewriteRule ^/main - [L]
# everything  else to cocoon
RewriteRule ^/(.*)$ /cocooon/$1 [L,PT]

DocumentRoot /home/domain.com/public
ScriptAlias /cgi-bin/ /home/domain.com/cgi-bin/
DirectoryIndex	index.html index.jsp index.php

# make sure tomcat  config webapp connector  only binds to 127.0.0.1 for security - and here we access it through the same loopback interface
WebAppConnection warpcocoon warp localhost:9999
WebAppDeploy cocoon warpcocoon /cocoon
# no need for different connection of other tomcat webapp
WebAppDeploy main warpcocoon /main
</VirtualHost>
>
> different builds --
> Please, elaborate more on this.
>
>
will do, probably over the weekend

-- 
Akber Choudhry
Dyanet Inc.
http://www.dyanet.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: mod_rewrite mod_webapp config contribl

Posted by Greg Weinger <gw...@itmedicine.net>.
After some experiment, I wanted to add the following (and we might want
to put this in the FAQ, because I didn't see an entry there for setting
up mod_webapp):

This rewrite configuration assumes you've set up the Warp connector
correctly, (and order is VERY important) which means that your
LoadModules block ends with: 

   LoadModule webapp_module modules/mod_webapp.so
   LoadModule rewrite_module modules/mod_rewrite.so

Your AddModues block ends like so:

   AddModule mod_webapp.c
   AddModule mod_rewrite.c

And these configs are at the bottom of httpd.conf:

   WebAppConnection warpConnection warp localhost:8008
   WebAppDeploy cocoon warpConnection /cocoon


Best,
Greg

> -----Original Message-----
> From: Akber Choudhry [mailto:akber@dyanet.com]
> Sent: Friday, March 01, 2002 1:45 PM
> To: cocoon-dev@xml.apache.org
> Subject: mod_rewrite mod_webapp config contribl
> 
> On Fri, 1 Mar 2002, Stefano Mazzocchi wrote:
> 
> >
> > Can you donate your mod_rewrite configurations? that would make it a
> > good example in the docs, at least.
> Here it is -
> 
> 
> NameVirtualHost domain.com
> <VirtualHost domain.com:80>
> ServerAdmin webmaster@domain.com
> ServerName www.domain.com
> ServerAlias domain.com
> ErrorDocument 404 /cgi-bin/errors/monitor.cgi
> ErrorDocument 500 /cgi-bin/errors/monitor.cgi
> 
> # Rewrite module has to be the last module in the Apache AddModule
list
> RewriteEngine On
> 
> # let apache handle
> 
> RewriteRule \.(gif|jpg|png|css|txt|html|js|pdf|cab|jar|php|xml)$ - [L]
> RewriteRule ^/cgi-bin - [L]
> # my apache site monitor
> RewriteRule ^/watch-info - [L]
> RewriteRule ^/$	/cocoon/index [L,PT]
> # other servlet applications - passed through
> RewriteRule ^/main - [L]
> # everything  else to cocoon
> RewriteRule ^/(.*)$ /cocooon/$1 [L,PT]
> 
> DocumentRoot /home/domain.com/public
> ScriptAlias /cgi-bin/ /home/domain.com/cgi-bin/
> DirectoryIndex	index.html index.jsp index.php
> 
> # make sure tomcat  config webapp connector  only binds to 127.0.0.1
for
> security - and here we access it through the same loopback interface
> WebAppConnection warpcocoon warp localhost:9999
> WebAppDeploy cocoon warpcocoon /cocoon
> # no need for different connection of other tomcat webapp
> WebAppDeploy main warpcocoon /main
> </VirtualHost>
> >
> > different builds --
> > Please, elaborate more on this.
> >
> >
> will do, probably over the weekend
> 
> --
> Akber Choudhry
> Dyanet Inc.
> http://www.dyanet.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: mod_rewrite mod_webapp config contribl

Posted by giacomo <gi...@apache.org>.
On Fri, 1 Mar 2002, Akber Choudhry wrote:

> On Fri, 1 Mar 2002, Stefano Mazzocchi wrote:
>
> >
> > Can you donate your mod_rewrite configurations? that would make it a
> > good example in the docs, at least.
> Here it is -
>
>
> NameVirtualHost domain.com
> <VirtualHost domain.com:80>
> ServerAdmin webmaster@domain.com
> ServerName www.domain.com
> ServerAlias domain.com
> ErrorDocument 404 /cgi-bin/errors/monitor.cgi
> ErrorDocument 500 /cgi-bin/errors/monitor.cgi
>
> # Rewrite module has to be the last module in the Apache AddModule list
> RewriteEngine On
>
> # let apache handle
>
> RewriteRule \.(gif|jpg|png|css|txt|html|js|pdf|cab|jar|php|xml)$ - [L]

This works as long as the URI from the browsers' view can be mapped onto
a filesystem path from the Apaches' view. And you have to deploy your
cocoon webapp on the machine running Apache if you have dedicated
machines for your tomcats (we do have this scenario).

> RewriteRule ^/cgi-bin - [L]
> # my apache site monitor
> RewriteRule ^/watch-info - [L]
> RewriteRule ^/$	/cocoon/index [L,PT]
> # other servlet applications - passed through
> RewriteRule ^/main - [L]
> # everything  else to cocoon
> RewriteRule ^/(.*)$ /cocooon/$1 [L,PT]
>
> DocumentRoot /home/domain.com/public
> ScriptAlias /cgi-bin/ /home/domain.com/cgi-bin/
> DirectoryIndex	index.html index.jsp index.php
>
> # make sure tomcat  config webapp connector  only binds to 127.0.0.1 for security - and here we access it through the same loopback interface

if it runs on the same machine

> WebAppConnection warpcocoon warp localhost:9999
> WebAppDeploy cocoon warpcocoon /cocoon
> # no need for different connection of other tomcat webapp
> WebAppDeploy main warpcocoon /main
> </VirtualHost>

Giacomo


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org