You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alexander Schulz <al...@solutionary.de> on 2002/09/27 15:10:51 UTC

Howto configure mod_jk2/apache2/virtual Hosts/mod_rewrite

Hi

I switched my servlet environment from apache 1.3.24/tomcat 4.0.4/mod_jk
to apache 2.0.42/tomcat4.1.10/mod_jk2.

Everything ist working fine except the kombination of URL rewriting with
mod_rewrite and mod_jk2.

This configuration ist working fine with the old environment:
...
<VirtualHost xxx.xxx.xxx.xxx>
    ServerName www.xxx.de
    DocumentRoot /usr/shared/sebp/data
    Alias /images /usr/shared/sebp/data/images/
    Alias /css /usr/shared/sebp/data/css/
    Alias /statistics /usr/shared/xxx/data/statistics
    ErrorLog /usr/shared/xxx/logs/error.log
    CustomLog /usr/shared/xxx/logs/access.log combined
    RewriteEngine on
    RewriteRule ^/index.html /universal/servlet [R,L]
    RewriteRule ^/$ /universal/servlet [R,L]
    RewriteRule ^/images/(.*) /images/$1 [L]
    RewriteRule ^/css/(.*) /css/$1 [L]
    RewriteRule ^/static/(.*) /static/$1 [L]
    RewriteRule ^/universal/(.*) /universal/$1 [L]
    RewriteRule ^/eba http://www.xxx.de/ [R,L]
    RewriteRule ^/eba/ http://www.xxx.de/ [R,L]
    RewriteRule ^/(.*) http://www2.xxx.de/$1 [R,L]
    JkMount /universal/* ajp13
</VirtualHost>
...

I changed it to:
...
<VirtualHost xxx.xxx.xxx.xxx>
    ServerName www.xxx.de
    DocumentRoot /usr/shared/sebp/data
    Alias /images /usr/shared/sebp/data/images/
    Alias /css /usr/shared/sebp/data/css/
    Alias /statistics /usr/shared/xxx/data/statistics
    ErrorLog /usr/shared/xxx/logs/error.log
    CustomLog /usr/shared/xxx/logs/access.log combined
    RewriteEngine on
    RewriteRule ^/index.html /universal/servlet [R,L]
    RewriteRule ^/$ /universal/servlet [R,L]
    RewriteRule ^/images/(.*) /images/$1 [L]
    RewriteRule ^/css/(.*) /css/$1 [L]
    RewriteRule ^/static/(.*) /static/$1 [L]
    RewriteRule ^/universal/(.*) /universal/$1 [L]
    RewriteRule ^/eba http://www.xxx.de/ [R,L]
    RewriteRule ^/eba/ http://www.xxx.de/ [R,L]
    RewriteRule ^/(.*) http://www2.xxx.de/$1 [R,L]
    <Location /universal/*>
		SetHandler jakarta-servlet2
		JkUriSet worker ajp13
    </Location>
</VirtualHost>
...

Without rewriting it works well.

Please, can someone tell me whats wrong and how to fix it?

Thank you.
Alexander Schulz


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>