tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric P <eric.maill...@gmail.com>
Subject Re: static content not served for non-root apps via mod_jk
Date Sat, 14 Jan 2012 03:52:54 GMT
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>

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.maillist@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message