[opensuse] apache2 Directory directive
I need to borrow an extra pair of eyes. Does anyone see any significant difference between these two: a) <Directory ~ "^/srv/www/vhosts/[^/]+/htdocs"> b) <Directory "/srv/www/vhosts/*/htdocs"> In apache 2.4. -- Per Jessen, Zürich (9.9°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, 20 May 2015 18:25, Per Jessen wrote:
I need to borrow an extra pair of eyes. Does anyone see any significant difference between these two:
a) <Directory ~ "^/srv/www/vhosts/[^/]+/htdocs"> b) <Directory "/srv/www/vhosts/*/htdocs">
In apache 2.4.
At first glance? a) allows only one directory between .../vhosts/ and /htdocs b) allows zero, one, or more directories between .../vhosts/ and /htdocs e.g: /srv/www/vhosts//htdocs, /srv/www/vhosts/test.domain.com/htdocs, /srv/www/vhosts/hijinks/blubber/blah/htdocs in a) that could be extended to exclude some other chars, too. e.g. exclude "_" from vhostname: .../[^/_]+/... - Yamaban -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, May 20, 2015 at 8:59 PM, Yamaban <foerster@lisas.de> wrote:
On Wed, 20 May 2015 18:25, Per Jessen wrote:
I need to borrow an extra pair of eyes. Does anyone see any significant difference between these two:
a) <Directory ~ "^/srv/www/vhosts/[^/]+/htdocs"> b) <Directory "/srv/www/vhosts/*/htdocs">
In apache 2.4.
At first glance? a) allows only one directory between .../vhosts/ and /htdocs b) allows zero, one, or more directories between .../vhosts/ and /htdocs
Are you sure? From 2.4 manual None of the wildcards match a `/' character
e.g: /srv/www/vhosts//htdocs, /srv/www/vhosts/test.domain.com/htdocs, /srv/www/vhosts/hijinks/blubber/blah/htdocs
in a) that could be extended to exclude some other chars, too. e.g. exclude "_" from vhostname: .../[^/_]+/...
- Yamaban -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Wed, 20 May 2015 18:25:24 +0200 Per Jessen <per@computer.org> пишет:
I need to borrow an extra pair of eyes. Does anyone see any significant difference between these two:
a) <Directory ~ "^/srv/www/vhosts/[^/]+/htdocs"> b) <Directory "/srv/www/vhosts/*/htdocs">
In apache 2.4.
No. Do you observe different behavior? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov wrote:
В Wed, 20 May 2015 18:25:24 +0200 Per Jessen <per@computer.org> пишет:
I need to borrow an extra pair of eyes. Does anyone see any significant difference between these two:
a) <Directory ~ "^/srv/www/vhosts/[^/]+/htdocs"> b) <Directory "/srv/www/vhosts/*/htdocs">
In apache 2.4.
No. Do you observe different behavior?
Yes, much to my surprise. During the weekend, I changed from (b) to (a) when I was experimenting with the "Require" serttings. I ended up rolling back the "Require" changes, but I forgot to change (a) back to (b). With (a), all of a sudden it seemed like .htaccess was not being read. I have not looked into it in any detail yet. With <Directory "/srv/www/vhosts/*/htdocs"> I have a number of settings that apply to all virtual hosts, for instance "Require all granted". -- Per Jessen, Zürich (7.6°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Per, et al -- ...and then Per Jessen said... % % > ?? Wed, 20 May 2015 18:25:24 +0200 % > Per Jessen <per@computer.org> ??????????: % > % >> I need to borrow an extra pair of eyes. Does anyone see any % >> significant difference between these two: % >> % >> a) <Directory ~ "^/srv/www/vhosts/[^/]+/htdocs"> % >> b) <Directory "/srv/www/vhosts/*/htdocs"> % ... % With (a), all of a sudden it seemed like .htaccess was not being read. I % have not looked into it in any detail yet. [snip] The only thing that comes to mind is that the * may not be parsed quite like a regexp (it should be .*) or like shell globbing (it would be limited to one dir level) but instead covers any depth. The [^/]+ clearly is limited to only one level. Soooooo... Does anyone have the httpd source code handy to know? :-) HTH & HAND :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
David T-G wrote:
Per, et al --
...and then Per Jessen said... % % > ?? Wed, 20 May 2015 18:25:24 +0200 % > Per Jessen <per@computer.org> ??????????: % > % >> I need to borrow an extra pair of eyes. Does anyone see any % >> significant difference between these two: % >> % >> a) <Directory ~ "^/srv/www/vhosts/[^/]+/htdocs"> % >> b) <Directory "/srv/www/vhosts/*/htdocs"> % ... % With (a), all of a sudden it seemed like .htaccess was not being read. I % have not looked into it in any detail yet. [snip]
The only thing that comes to mind is that the * may not be parsed quite like a regexp (it should be .*) or like shell globbing (it would be limited to one dir level) but instead covers any depth. The
[^/]+
clearly is limited to only one level.
Yep - in my case, the structure only has one level: /srv/www/vhosts/xxxxxx/htdocs If I had something like /srv/www/vhosts/xxx/yyy/htdocs the regexp version would clearly fail, but as I don't, I can't explain the behaviour. -- Per Jessen, Zürich (11.1°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Andrei Borzenkov
-
David T-G
-
Per Jessen
-
Yamaban