[Catalyst] OT Apache question

J. Shirley jshirley at gmail.com
Fri Nov 28 03:10:20 GMT 2008

On Thu, Nov 27, 2008 at 6:45 PM, Jesse Sheidlower <jester at panix.com> wrote:
> A few weeks ago I asked a series of questions about caching,
> at the end of which discussion it was suggested that I use
> Apache, instead of Cat with the Static::Simple plugin, to
> serve my static files. I had tried this once before and ran
> into problems and given up, so, the question:
> I'd prefer to keep my current directory setup, in which I have
> my Cat applications, in the usual configuration, under
> /usr/local/www/modules. So, for example, my "incomings"
> database is at /usr/local/www/modules/Incomings, its
> templates are at /usr/local/www/modules/Incomings/root (so
> Static::Simple serves them normally), the controllers are at
> (for example)
> /usr/local/www/modules/Incomings/lib/Incomings/Controller/Search.pm,
> and so forth.
> However my document root is at /usr/local/www/data, which
> obviously does not include /usr/local/www/modules. So, if I
> try to follow the Static::Simple suggestion of adding, say,
> <Location /Incomings/static>
>        SetHandler default-handler
> </Location>
> this obviously won't work because /Incomings/static isn't in
> fact under my document root, it's in the filesystem at
> /usr/local/www/modules/Incomings/root/static/. Trying this
> just gives me 404's for all of the static stuff (CSS, images,
> JS).
> How do I configure Apache to serve these files, without
> reorganizing what is by now a rather complicated directory
> structure?
> Thanks.
> Jesse

If you just add in an alias, it should do the trick.  You'll also have
to instruct Apache on how to handle the directory, iirc.  Something
similar to this should do the trick (in addition to setting the proper
handler, as you have done above):

Alias "/incoming/static" /real/path/on/disk/to/incoming/static
<Directory /real/path/on/disk/to/incoming/static>


More information about the Catalyst mailing list