On 14/01/2012 03:52, Eric P wrote: > I remember now why static content works for my ROOT app. I have > Apache aliases set-up pointing to specific system directories for all > static content. > > For example, I have all images for the ROOT app aliased here. > Alias /img /opt/tomcat7/webapps/ROOT/img > <Directory "/opt/tomcat7/webapps/ROOT/img"> > Options Indexes MultiViews > AllowOverride None > Order allow,deny > Allow from all > </Directory>
Why bother - do you have a compelling reason to use HTTPD for this? Tomcat + APR will work just fine. p > But is there a better approach for this so that I don't have to create > static content aliases for each new Tomcat app I deploy? I would be > stuck using a unique alias for every app which seems crazy. > > Thanks, > Eric > > 2012/1/13 Eric P <eric.maill...@gmail.com>: >> Hi all, >> >> I'm having trouble getting Apache to serve static content (jpg, css, js, >> etc.) for Tomcat apps via mod_jk for any >> application except the ROOT Tomcat app. The ROOT app shows static content >> just fine. >> >> I have the following Apache settings attempting to point *all* requests to >> Tomcat and unsetting certain static content >> extensions so that Apache will serve them. >> >> ...clip... >> # Send everything to Tomcat >> JkMount /* ajp13 >> >> # And then unsend static content so that httpd will serve it >> JkUnMount /*.js ajp13 >> JkUnMount /*.css ajp13 >> JkUnMount /*.jpg ajp13 >> JkUnMount /*.png ajp13 >> JkUnMount /*.gif ajp13 >> ...clip... >> >> These settings work for the ROOT Tomcat app but not for anything else >> including Tomcat's manager app. >> >> FYI. when I access via Tomcat's port/web server everything works. >> E.g., http://localhost:8080/manager/html >> >> But not when I access via port 80. >> E.g., http://localhost/manager/html >> >> I"m seeing a 404 Not Found for all static content via port 80/Apache (again, >> the only exception is any static content >> belonging to the ROOT Tomcat app). I'm experiencing the exact same behavior >> on both an Ubuntu and CentOS. >> >> Thanks for any ideas. >> Eric > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > -- [key:62590808]
signature.asc
Description: OpenPGP digital signature