[Catalyst-dev] Re: [RFC] Template and Static directory locations
A. Pagaltzis
pagaltzis at gmx.de
Tue Oct 24 00:34:42 GMT 2006
* Jonathan Rockway <jon at jrock.us> [2006-10-23 22:00]:
> >One question is whether it makes sense to have such
> >a directory at all. Rails has this which lets you put in
> >a .fcgi script along with images, css, js, etc.
>
> So it looks like:
>
> root/
> root/templates
> root/static
> root/static/index.fcgi -> ../../../script/myapp_fastcgi.pl
> root/static/.htaccess
>
> and the .htaccess tells the webserver to handle requests for
> / with index.fcgi and /static /root/static? Sounds good to me,
> if that's possible. I assume .htaccess is webserver dependent,
> though, which I dislike.
Is the `root` parent really necessary? Proliferation of
equivalent directories is not an issue here, so I’d prefer to
keep the structure flat. Is there a good reason not to?
* Jesse Sheidlower <jester at panix.com> [2006-10-23 20:20]:
> On Mon, Oct 23, 2006 at 10:38:38AM -0700, John Wang wrote:
> > I avoided MyApp/static because one advantage of having
> > a ./htdocs or ./public directory is that you can put
> > a .htaccess and index.fcgi in it and then just point your web
> > server to that directory. This would make it easier to get
> > some apps up and running.
>
> I don't agree with this. I think the meaning of "static" is
> extremely, perfectly clear. You can put other levels under
> it--/static/images/, /static/html, /static/js, whatever. But
> "static" says _exactly_ what it is.
>
> "htdocs" may have an advantage for some Apache purposes but
> it's otherwise totally opaque; even people who use Apache
> regularly might not know what it means. And it shares with
> "public" the problem of not specifying exactly what it is
> you're using it for. "public" suggests a certain level of
> access restrictions, not a static/dynamic disparity, for
> example.
I agree with your argument against `htdocs` and `public`, but
I disagree with your argument in favour of `static`. That name
may not imply a level of access restrictions, but instead it
implies a certain type of content. A FastCGI script is certainly
not something I’d expect to see in `static`. Even `.htacess` is
pushing it.
I’d advocate something like `wwwroot`, which says exactly what
*the directory* is. `htdocs` is an Apache-ism, but the concept of
a document root is generic to web servers, and that’s what the
directory in question is, so the name should reflect exactly
that.
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>
More information about the Catalyst-dev
mailing list