Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Hello i have been struggling alot today with my new home server. I have installed newest release of ubuntu server on it. Installed php, apache, mysql and everything seemed to work perfect.
I am trying to set up a website that worked perfectly with XAMPP on my local machine. I have been using this guide to set up mod_rewrite. http://www.solutionsamir.com/20110303140/Operating-Systems/Linux-Unix/How-to-enable-mod_rewrite-on-ubuntu-server-for-apache2.html
Here is my HTACCESS
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/?index.php$
RewriteRule . index.php
And here is my 000-default
`
ServerAdmin webmaster#localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride all
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride all
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
`
Its working somehow, but everytime i post a form, i get 500 internal server error. Any idea whats wrong?
Edit: This is what i get by activating logging.
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (3) [perdir /var/www/serverpanel/] add path info postfix: /var/www/serverpanel/login -> /var/www/serverpanel/login/
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (3) [perdir /var/www/serverpanel/] strip per-dir prefix: /var/www/serverpanel/login/ -> login/
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (3) [perdir /var/www/serverpanel/] applying pattern '^(.+)/$' to uri 'login/'
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (2) [perdir /var/www/serverpanel/] rewrite 'login/' -> 'index.php'
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (3) [perdir /var/www/serverpanel/] add per-dir prefix: index.php -> /var/www/serverpanel/index.php
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (2) [perdir /var/www/serverpanel/] strip document_root prefix: /var/www/serverpanel/index.php -> /serverpanel/index.php
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (1) [perdir /var/www/serverpanel/] internal redirect with /serverpanel/index.php [INTERNAL REDIRECT]
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f5289230208/initial/redir#1] (3) [perdir /var/www/serverpanel/] strip per-dir prefix: /var/www/serverpanel/index.php -> index.php
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f5289230208/initial/redir#1] (3) [perdir /var/www/serverpanel/] applying pattern '^(.+)/$' to uri 'index.php'
192.168.1.110 - - [04/Apr/2012:23:41:22 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f5289230208/initial/redir#1] (1) [perdir /var/www/serverpanel/] pass through /var/www/serverpanel/index.php
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (3) [perdir /var/www/serverpanel/] add path info postfix: /var/www/serverpanel/login -> /var/www/serverpanel/login/
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (3) [perdir /var/www/serverpanel/] strip per-dir prefix: /var/www/serverpanel/login/ -> login/
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (3) [perdir /var/www/serverpanel/] applying pattern '^(.+)/$' to uri 'login/'
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (2) [perdir /var/www/serverpanel/] rewrite 'login/' -> 'index.php'
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (3) [perdir /var/www/serverpanel/] add per-dir prefix: index.php -> /var/www/serverpanel/index.php
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (2) [perdir /var/www/serverpanel/] strip document_root prefix: /var/www/serverpanel/index.php -> /serverpanel/index.php
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f528923b0a0/initial] (1) [perdir /var/www/serverpanel/] internal redirect with /serverpanel/index.php [INTERNAL REDIRECT]
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f52892304b8/initial/redir#1] (3) [perdir /var/www/serverpanel/] strip per-dir prefix: /var/www/serverpanel/index.php -> index.php
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f52892304b8/initial/redir#1] (3) [perdir /var/www/serverpanel/] applying pattern '^(.+)/$' to uri 'index.php'
192.168.1.110 - - [04/Apr/2012:23:41:52 +0200] [192.168.1.233/sid#7f52893ad1d8][rid#7f52892304b8/initial/redir#1] (1) [perdir /var/www/serverpanel/] pass through /var/www/serverpanel/index.php
Nice question, with logs. It deserves some attention ;)
As I can see it, you're trying to connect to your local URL login/.
Going through your rewrite rules, at the end, it's
/var/www/serverpanel/index.php -> /serverpanel/index.php
to it's redirected to another URL (not using the actual Php) which is /serverpanel/index.php.
So it tries to apply once again the rules, but with /serverpanel/index.php.
As you can guess, it will be rewritten to go to index.php, thus doing an infinite loop.
Take a close look at your log:
(1) [perdir /var/www/serverpanel/] internal redirect with /serverpanel/index.php [INTERNAL REDIRECT]
This may be the key to your solution: perdir /var/www/serverpanel/
2 questions:
Is there any .htaccess file here?
If there isn't any .htaccess, try to check all your Apache conf files, looking for
a <Directory "xxx"> directive that concerns /var/www/serverpanel/, and you may find where the problem is.
Hope this helps
Related
I am trying to configure mod_jk for apache2 in front of tomcat7 but I'm getting a following error:
mod_jk.log[Error]:jk_uri_worker_map.c (580): Could not find worker
with name '/var/lib/tomcat7/conf/workers.properties' in uri map post
processing
workers.properties is in tomcat7/conf/
jk.conf is in apache2/mods-enabled/
000-default.conf is in apache2/sites-enabled/
workers.properties
`workers.tomcat_home=/var/lib/tomcat7
workers.java_home=/usr/lib/jvm/java-8-openjdk-amd64
ps=/
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=xxxx.com
worker.worker1.port=8009
worker.ajp13_worker.lbfactor=1
worker.worker1.mount=/*
# configure jk-status
worker.list=jk-status
worker.jk-status.type=status
worker.jk-status.read_only=true
#configure jk-manager
worker.list=jk-manager
worker.jk-manager.type=status`
jk.conf
`<IfModule jk_module>
JkWorkersFile /var/lib/tomcat7/conf/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
JkShmFile /var/log/apache2/jk-runtime-status
JkOptions +RejectUnsafeURI +ForwardKeySize +ForwardURICompat
JkWatchdogInterval 60
JkMount /* worker1
<Location /jk-status>
# Inside Location we can omit the URL in JkMount
JkMount jk-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
<Location /jk-manager>
# Inside Location we can omit the URL in JkMount
JkMount jk-manager
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>`
000-default.conf
<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [L,R=301]
JkMount /* worker1
JkMountCopy On
</VirtualHost>
mod_jk.log
[Tue Mar 06 12:27:55.370 2018] [14733:140153319872384] [debug] wc_get_worker_for_name::jk_worker.c (120): did not find a worker /var/lib/tomcat7/conf/workers.properties
[Tue Mar 06 12:27:55.370 2018] [14733:140153319872384] [error] extension_fix::jk_uri_worker_map.c (580): Could not find worker with name '/var/lib/tomcat7/conf/workers.properties' in uri map post processing.
[Tue Mar 06 12:27:55.370 2018] [14733:140153319872384] [debug] wc_get_worker_for_name::jk_worker.c (120): did not find a worker /var/lib/tomcat7/conf/workers.properties
[Tue Mar 06 12:27:55.370 2018] [14733:140153319872384] [error] extension_fix::jk_uri_worker_map.c (580): Could not find worker with name '/var/lib/tomcat7/conf/workers.properties' in uri map post processing.
Our server has been upgraded from Apache 2.2.32->2.4.20, and with that change, my mod_rewrites don't pass-through to Tomcat endpoints any longer.
Here is the Tomcat Load Balancer config:
<Location /balancer-manager>
SetHandler balancer-manager
</Location>
<Proxy balancer://tomcatHttpCluster>
BalancerMember http://localhost:9946 loadfactor=100
</Proxy>
And the rewrite rule of interest:
RewriteCond %{REQUEST_METHOD} POST [NC]
RewriteRule ^/catalog/preferences$ /ac/rest/preferences [B,PT,L,QSA]
And also the Location config which applies to all /ac requests:
<Location /ac/>
ProxyPass balancer://tomcatHttpCluster/ac/ stickysession=JSESSIONID
...
</Location>
If I go directly to the /ac Tomcat endpoint, it works. The Apache log:
mod_rewrite.c(477): [client 10.20.3.63:50485] 10.20.3.63 - - [tesla/sid#caa5f8] [rid#f75c230/initial] pass through /ac/rest/preferences
mod_proxy_balancer.c(73): [client 10.20.3.63:50485] canonicalising URL //tomcatHttpCluster/ac/rest/preferences
mod_lbmethod_byrequests.c(95): AH01207: proxy: Entering byrequests for BALANCER (balancer://tomcathttpcluster)
mod_lbmethod_byrequests.c(142): AH01208: proxy: byrequests selected worker "http://localhost:9946" : busy 0 : lbstatus 0
mod_proxy_balancer.c(614): [client 10.20.3.63:50485] AH01172: balancer://tomcathttpcluster: worker (http://localhost:9946) rewritten to http://localhost:9946/ac/rest/preferences
proxy_util.c(1783): AH00924: worker http://localhost:9946 shared already initialized
proxy_util.c(1825): AH00926: worker http://localhost:9946 local already initialized
mod_proxy.c(1159): [client 10.20.3.63:50485] AH01143: Running scheme balancer handler (attempt 0)
mod_proxy_ajp.c(738): [client 10.20.3.63:50485] AH00894: declining URL http://localhost:9946/ac/rest/preferences
mod_proxy_http.c(1903): [client 10.20.3.63:50485] HTTP: serving URL http://localhost:9946/ac/rest/preferences
proxy_util.c(2158): AH00942: HTTP: has acquired connection for (localhost)
proxy_util.c(2212): [client 10.20.3.63:50485] AH00944: connecting http://localhost:9946/ac/rest/preferences to localhost:9946
proxy_util.c(2421): [client 10.20.3.63:50485] AH00947: connected /ac/rest/preferences to localhost:9946
mod_proxy_http.c(1374): [client 10.20.3.63:50485] Status from backend: 200
mod_proxy_http.c(1048): [client 10.20.3.63:50485] Headers received from backend:
mod_proxy_http.c(1051): [client 10.20.3.63:50485] Server: Apache-Coyote/1.1
mod_proxy_http.c(1051): [client 10.20.3.63:50485] Content-Type: application/json
mod_proxy_http.c(1051): [client 10.20.3.63:50485] Content-Length: 218
mod_proxy_http.c(1051): [client 10.20.3.63:50485] Date: Fri, 28 Oct 2016 00:32:26 GMT
mod_proxy_http.c(1646): [client 10.20.3.63:50485] start body send
proxy_util.c(2173): AH00943: http: has released connection for (localhost)
mod_proxy_http.c(1791): [client 10.20.3.63:50485] end body send
mod_proxy_balancer.c(669): [client 10.20.3.63:50485] AH01176: proxy_balancer_post_request for (balancer://tomcathttpcluster)
BUT. If I try to use the rewrite URL - the rewrite happens...then nothing:
mod_rewrite.c(477): [client 10.20.3.63:50457] 10.20.3.63 - - tesla/sid#c6a5f8rid#dc2a110/initial RewriteCond: input='GET' pattern='GET' [NC] => matched
mod_rewrite.c(477): [client 10.20.3.63:50457] 10.20.3.63 - - tesla/sid#c6a5f8rid#dc2a110/initial rewrite '/catalog/preferences' -> '/ac/rest/preferences'
mod_rewrite.c(477): [client 10.20.3.63:50457] 10.20.3.63 - - tesla/sid#c6a5f8rid#dc2a110/initial forcing '/ac/rest/preferences' to get passed through to next API URI-to-filename handler
I'm no expert at Apache (until now!), but I did try changing the mod_rewrite flags to just [R] and that worked fine. I am not able to make that change on the server because that code is not under my control. I assumed the [PT] rewrite flag would send the rewritten url back through the mod_proxy_balancer and voila, but that doesn't appear to be happening.
Is there something obvious that changed from 2.2 to 2.4 that would cause this? Help! I've been stuck on this for days.
try to use P instead of PT in rewriterule. It works for me.
RewriteRule ^/catalog/preferences$ /ac/rest/preferences [B,P,L,QSA]
<IfModule mod_fcgid.c>
<Directory "C:\Apache24">
SetHandler fcgi-script
Order Allow,deny
Allow from all
Require all granted
</Directory>
ScriptAlias /host1/ "C:\http\fast_cgi.exe"
In log file access:
::1 - - [30/Aug/2016:17:06:49 -0300] "GET /host1/ HTTP/1.1" 403 215
I have a big problem with websockets and my reverse proxy configuration on Apache. When I access Tomcat directly, the application with websockets works perfectly. But as soon is I try it with Apache, the websockets are not working.
I use:
Tomcat 7.0.42 on Windows
Apache 2.4.6 on Windows
<VirtualHost _default_:80>
ServerName myserver
RewriteEngine on
RedirectMatch ^/$ /myserver/
RewriteRule ^/myserver$ /myserver/ [R]
RewriteRule ^/myserver/active$ /myserver/active/ [R]
ProxyRequests Off
ProxyPreserveHost On
ProxyVia On
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
LogLevel debug
ProxyHTMLEnable On
ProxyHTMLBufSize 102400
ProxyHTMLExtended On
ProxyHTMLStripComments Off
ProxyHTMLDocType "<!DOCTYPE html>" XML
ProxyHTMLMeta On
DocumentRoot "${SRVROOT}/htdocs/"
<Location /myserver/active/ws/atmsphr/>
ProxyPass ws://localhost:8080/myapp/ws/atmsphr/
ProxyPassReverse ws://localhost:8080/myapp/ws/atmsphr/
</Location>
ProxyPass /myserver/active/ ajp://localhost:8009/myapp/
ProxyHTMLURLMap ajp://localhost:8009/myapp /myserver/active/
<Location /myserver/active/>
ProxyPassReverse ajp://localhost:8009/myapp/
SetOutputFilter proxy-html
ProxyHTMLURLMap /myapp/ /myserver/active/
ProxyPassReverseCookiePath /myapp/ /myserver/active/
</Location>
ProxyPass /myserver/ ajp://localhost:8009/mylogin/
ProxyHTMLURLMap ajp://localhost:8009/mylogin /myserver/
<Location /myserver/>
ProxyPassReverse ajp://localhost:8009/mylogin/
SetOutputFilter proxy-html
ProxyHTMLURLMap /mylogin/ /myserver/
ProxyPassReverseCookiePath /mylogin/ /myserver/
</Location>
</VirtualHost>
In the Apache logs I can see that the workers were initialized:
[Tue Oct 22 17:25:21.625342 2013] [proxy:debug] [pid 4116:tid 164] proxy_util.c(1693): AH00925: initializing worker ws://localhost:8080/myapp/ws/atmsphr/ shared
[Tue Oct 22 17:25:21.625342 2013] [proxy:debug] [pid 4116:tid 164] proxy_util.c(1733): AH00927: initializing worker ws://localhost:8080/myapp/ws/atmsphr/ local
I followed the Ordering ProxyPass Directives, but the first request is processed by mod_proxy_ajp and not by mod_proxy_wstunnel:
[Tue Oct 22 17:26:19.283043 2013] [proxy_http:debug] [pid 4116:tid 840] mod_proxy_http.c(1891): [client 192.168.5.68:49451] AH01113: HTTP: declining URL ajp://localhost:8009/myapp/websock/atmsphr?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.0.2-jquery&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&Content-Type=application/json&X-atmo-protocol=true
[Tue Oct 22 17:26:19.283043 2013] [proxy_ajp:debug] [pid 4116:tid 840] mod_proxy_ajp.c(713): [client 192.168.5.68:49451] AH00895: serving URL ajp://localhost:8009/myapp/ws/atmsphr?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.0.2-jquery&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&Content-Type=application/json&X-atmo-protocol=true
What is wrong in my configuration?
After a long research I found a workaround which fullfills my requirements. I've to run this webapplication via HTTPS and with port 443 it works perfectly. I can not explain why there is a problem with the default HTTP port 80, but if I access the webapp through port 443 there is no problem. In addition i tried port 8000 via HTTP und it also works.
Summary:
Port 80 / HTTP --> not working
Port 8000 / HTTP --> working
Port 443 / HTTPS --> working
In conclusion I have an virtual host config for port 80 with a permanent redirct to 443.
It has to do with the effective order of your ProxyPass directives. Have a look at the server-status page to see what it really is. When you embed them in Location blocks the effective order is changed from the order you wrote them in. See the mod_proxy_wstunnel documentation.
I have the rules (below) and we have added a new alias /msn which has some static content, like an html file ayuda.html which is the directory index file and some images.
Currently I can see the HTML file, but not the image. Also there are different errors depending if I go to domain.com/msn or domain.com/msn/. On the first case the image location is not being rewritten to domain.com/msn/image-blah-blah.jpg, but it does on the second case.
This is the Virtual Directory:
<VirtualHost *:80>
ServerAdmin administracion.linux#yellargentina.com
DocumentRoot "/opt/tomcat-5.5.30/webapps/portalPA"
ServerAlias *.amarillas.tm.yellargentina.com
CustomLog /tmp/amarillas-access_log combined
ErrorLog /tmp/amarillas-error_log
RewriteLog /tmp/amarillas-rewrite_log
RewriteLogLevel 9
JkUnMount /images/*.gif w1
JkUnMount /images/*.png w1
JkUnMount /images/*.jpg w1
JkUnMount /js/*.js w1
JkUnMount /styles/*.css w1
#JkMount /jkmanager/* jkstatus
JkMount /portalPA w1
JkMount /portalPA/* w1
JkUnMount /msn/* w1
CookieName PaginasAmarillas
CookieExpires "2 years"
CookieDomain ".tm.yellargentina.com"
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
Options +FollowSymlinks
RewriteRule ^/(msn|msn/) /msn/ayuda.html [PT]
RewriteRule ^/msn/ayuda.html$ /msn/ [R,L]
RewriteRule ^/msn/(?!ayuda.html)(.*) /msn/$1 [R,L]
RewriteRule ^/$ /portalPA/index.action [PT]
RewriteRule ^/portalPA/index.action / [R]
RewriteRule ^/(?!portalPA/)(.*) /portalPA/$1 [PT]
</VirtualHost>
Logs for when I try to access to domain.com/msn/
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (2) init rewrite engine with requested uri /msn/yello-apps-mesenger.jpg
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (3) applying pattern '.*' to uri '/msn/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (4) RewriteCond: input='GET' pattern='^(TRACE|TRACK)' => not-matched
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (3) applying pattern '^/(msn|msn/)' to uri '/msn/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (2) rewrite '/msn/yello-apps-mesenger.jpg' -> '/msn/ayuda.html'
10.248.19.52 - - [23/Aug/2011:16:54:36 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc8338/initial] (2) forcing '/msn/ayuda.html' to get passed through to next API URI-to-filename handler
Logs for when I try to access to domain.com/msn
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (2) init rewrite engine with requested uri /msn
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (3) applying pattern '.*' to uri '/msn'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (4) RewriteCond: input='GET' pattern='^(TRACE|TRACK)' => not-matched
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (3) applying pattern '^/(msn|msn/)' to uri '/msn'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (2) rewrite '/msn' -> '/msn/ayuda.html'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bc02f8/initial] (2) forcing '/msn/ayuda.html' to get passed through to next API URI-to-filename handler
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (2) init rewrite engine with requested uri /yello-apps-mesenger.jpg
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '.*' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (4) RewriteCond: input='GET' pattern='^(TRACE|TRACK)' => not-matched
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/(msn|msn/)' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/msn/ayuda.html$' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/msn/(?!ayuda.html)(.*)' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/$' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/portalPA/index.action' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (3) applying pattern '^/(?!portalPA/)(.*)' to uri '/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (2) rewrite '/yello-apps-mesenger.jpg' -> '/portalPA/yello-apps-mesenger.jpg'
10.248.19.52 - - [23/Aug/2011:16:55:33 --0300] [amarillas.tm.yellargentina.com/sid#2af084b03cd0][rid#2af084bb82b8/initial] (2) forcing '/portalPA/yello-apps-mesenger.jpg' to get passed through to next API URI-to-filename handler
Based on rewrite logs provided I came to conclusion that yello-apps-mesenger.jpg is the problematic image in question. As I understand the aforementioned image is linked from that /msn page.
I think it is all about how you wrote your <img> tag (or where you are using that image). I guess it is declared relative to the current document like this: <img src="yello-apps-mesenger.jpg" />.
Well -- that is the problem:
when you requesting domain.com/msn/ that image will be requested like domain.com/msn/yello-apps-mesenger.jpg
but when you requesting domain.com/msn (without trailing slash), the image will be requested like domain.com/yello-apps-mesenger.jpg and ^/(msn|msn/) simply not got applied to it.
TBH I do not know which one is doing wrong -- you are not clear on this (at least I cannot figure it out ATM).
I see 2 approaches to fix the issue:
1. Only accept domain.com/msn/ and not domain.com/msn (or other way around) and build your rules with this in mind.
2. Fix image URLs -- make then relative to the website root, for example: <img src="/yello-apps-mesenger.jpg" /> (notice the leading slash) .. or maybe <img src="/msn/yello-apps-mesenger.jpg" /> (/msn/ is part of image URL) -- you should know better what is good for you.