Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to complete Redmine's feature request #2693: Use to authenticate for any directory (1). I have not much knowledge on all these things and need help. Redmine uses mod_perl module for authentication & authorization. This module defines several custom configuration directives. I've successfully modified patch from (1) and it works when all config is in <Location>:

<Location /digischrank/test>
        AuthType basic
        AuthName "Digischrank Test" 
        Require valid-user
        PerlAccessHandler Apache::Authn::Redmine::access_handler
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler
        RedmineDSN "DBI:mysql:database=SomedaTaBAse;host=localhost" 
        RedmineDbUser "SoMeuSer" 
        RedmineDbPass "SomePaSS" 
        RedmineProject "digischrank" 

But when I move one of these directives (RedmineProject, see (1)) in .htaccess file, doesn't see it! I've tried to change <Location> to <Directory> and add AllowOverride All. Directives from .htaccess is visible, but remaining ones from <Directory> - not. I don't want to move all directives to each .htaccess. When I add <Location> in addition to <Directory>, again - only directives from <Location> are visible.

As far as I know, directives should be merged. I miss something?

share|improve this question

I've found that doesn't provide DIR_MERGE function to merge configuration objects. See details in Creating and Merging Configuration Objects section of mod_perl manual. I've simplified given example because I need only override mode:

sub DIR_MERGE    { merge(@_) }

sub merge {
      my ($base, $add) = @_;
      my %mrg = ();
      for my $key (keys %$base, keys %$add) {
          next if exists $mrg{$key};
          # override mode
          $mrg{$key} = $base->{$key} if exists $base->{$key};
          $mrg{$key} = $add->{$key}  if exists $add->{$key};
      return bless \%mrg, ref($base);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.