[ale] problem with mod_rewrite (Apache 2.0 + mod_jk / tomcat5)

Jerry Yu jjj863 at gmail.com
Fri Jan 26 12:21:32 EST 2007


hi,
I wanted to redirect everything to a static outage page on an Apache
2.0server on Linux with mod_jk connecting to a tomcat5 instance.  The
rewrite
rules worked, per mod_rewrite.log. However, for anything *.jsp, I got 500
internal error and mod_jk.log shows failed attempts to connect to Tomcat,
which I stopped on purpose. For others, I got my static HTML page as
intended.  I thought it wouldn't go to Tomcat/mod_jk at all, if rewriting
happens before the jkMount mapping to .jsp files.
Per some tips found by Google, I shuffled LoadModule statement for mod_jk
and mod_rewrite back & forth, to no avail. Any one ran into this before?

-------------------------httpd.conf-------------------------------
LoadModule    jk_module  modules/mod_jk.so
LoadModule rewrite_module modules/mod_rewrite.so

JkWorkersFile /etc/httpd/conf/tomcat_workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
<VirtualHost *:80>
   DocumentRoot "/var/www/html/blahWEB"
   JkMount /*.jsp blah
   JkMount /*.m blah
   JkMount /*.jws blah
   JkMount /servlet/sendfile/* blah
   JkMount /probe*/* blah

       ProxyRequests off

        RewriteEngine on
        RewriteLog      logs/mod_rewrite.log
        RewriteLogLevel  4
        # redirect all request to a static page except gif/html
        RewriteCond %{THE_REQUEST} (HTTP/1.1) [NC]
        RewriteRule ^/(.*gif)$ /$1 [L]
        RewriteRule ^/(.*html)$ /$1 [L]
        RewriteRule ^/(.*)$ /msg/outage.html [L]

</VirtualHost>
-------------------------httpd.conf-------------------------------

------------------- mod_rewrite_log-------------------------
10.8.8.8 - - [site1.mydomain.com/sid#88261d0][rid#88a2ba8/initial] (2) init
rewrite engine with requested uri /kkdkblah1.jsp
10.8.8.8 - - [site1.mydomain.com/sid#88261d0][rid#88a2ba8/initial] (3)
applying pattern '^/(.*gif)$' to uri '/kkdkblah1.jsp'
10.8.8.8 - - [site1.mydomain.com/sid#88261d0][rid#88a2ba8/initial] (3)
applying pattern '^/(.*html)$' to uri '/kkdkblah1.jsp'
10.8.8.8 - - [site1.mydomain.com/sid#88261d0][rid#88a2ba8/initial] (3)
applying pattern '^/(.*)$' to uri '/kkdkblah1.jsp'
10.8.8.8 - - [site1.mydomain.com/sid#88261d0][rid#88a2ba8/initial] (2)
rewrite /kkdkblah1.jsp -> /msg/outage.html
10.8.8.8 - - [site1.mydomain.com/sid#88261d0][rid#88a2ba8/initial] (2) local
path result: /msg/outage.html
10.8.8.8 - - [site1.mydomain.com/sid#88261d0][rid#88a2ba8/initial] (2)
prefixed with document_root to /var/www/html/blahWEB/msg/outage.html
10.8.8.8 - - [site1.mydomain.com/sid#88261d0][rid#88a2ba8/initial] (1)
go-ahead with /var/www/html/blahWEB/msg/outage.html [OK]
-------------- next part --------------
An HTML attachment was scrubbed...




More information about the Ale mailing list