Alias doesn"t work correctly? (Re: Alias question)
am 07.06.2007 19:13:22 von nukeszr wrote:
> Mark Taylor wrote:
> > szr wrote:
> >
> > > Hello. I'm using Apache 1.3.27 and I've encountered a small
> > > problem using Alias'es.
> > >
> > > Say I have the following directory structure:
> > >
> > > /var/www/html
> > > /var/www/abc_html
> > > /var/abc/data
> > >
> > >
> > > and this in my httpd.conf:
> > >
> > > Alias /abc/ "/var/www/abc_html/"
> > > Alias /abc/data/ "/var/abc/data"
> > >
> > >
> > > If I enter the following URL's in my browser:
> > >
> > > http://host/abc/
> > >
> > > I get the contents of /var/www/abc_html like I would expect, but
> > > entering:
> > >
> > > http://host/abc/data/
> > >
> > > Doesn't give me the contents of /var/abc/data, but instead yield a
> > > 404 and in the error_log:
> > >
> > > ... File does not exist: /var/www/abc_html/data
> > >
> > >
> > > Keep in mind this describes exactly what I'm doing, reduced to
> > > it's basic parts for clarity sake.
> > >
> > > Is there any reason why it wont work?
> > >
> > > Seems the only way I could get round this was to use AliasMatch,
> > > it that feels like a hack for something that seems like it should
> > > be so basic.
> > >
> > > (And yes I know I could always use a symlink, but in my particular
> > > case I need to avoid that and do it via httpd.conf, as this
> > > actually involves a cross platform system we're developing.
> > >
> > > Thank you.
> > >
> > > -szr
> > >
> > >
> > >
> >
> > Probably because mod_alias finds the first occurance of /abc/ and,
> > finding a match it executes and terminates. Then again, I'm not real
> > sure alias works with two levels of directories. I suspect not.
> >
> > I'm wondering exactly what you are trying to do. If your data
> > directory really contains data is there are real reason why you
> > want it in the directory root structure? Usually data paths are
> > outside of the http root for security reasons. You are explicitly
> > putting the data in the http path eliminating security. Of course,
> > this may be exactly what you want to do....
>
> Thank you for replying. The scenario I described was just one I made
> up on the fly to describe the problem I was having with the Alias
> directive.
>
> It doesn't seem to make any sense that I could, for instance, do the
> following and it works as expected:
>
> Alias /somewebapp/foo.pl "/var/www/html/somewebapp/foo_linux.pl"
>
> but not be able to have more than one level:
>
> Alias /abc/data/ "/var/abc/data"
>
> (syntatically they would be the same, no?)
>
>
> Thanks again.
Same problem seems to exist on 2.x Apache.
I would categorize this as a bug.
Why shou'dn't one be able to build a complete vurtual directory
structure? IIS has allowed that for years (not that I would ever really
use it), but if Apache truly doesn't have a way to do that with normal
Alias directives, then what real good is it to only have one level? IMHO
it makes it practically useless for any.
Is there any way to make it work?