2

I am running apache 2.2 on a linux machine and my goal is to have all directories except for a subdirectory with authentification. I can get the "all" directories to work, but when I add the except for the subdirectory, I get an internal error:

configuration error:  couldn't check user.  No user file?: /download/public/

This is my configuration file:

<Directory /var/www/mydir/software/download/public>
     AuthType None
     Require all granted
</Directory>


<Directory /var/www/mydir/software>
      AuthType Basic
      AuthName download
      AuthUserFile /etc/apache2/auth/software
      Require valid-user
 </Directory>

when I comment out the first four lines, everything works fine. With these lines, I get the aforementioned error.

$ apache2 -v
Server version: Apache/2.2.8 (Ubuntu)

Question: what do I need to change to get the subdirectory without authentification with apache 2.2. I believe that the configuration above is for 2.4. Is that what I want possible with 2.2?

topskip
  • 16,207
  • 15
  • 67
  • 99
  • 2
    possible duplicate of [How to accomplish "AuthType None" in Apache 2.2](http://stackoverflow.com/questions/2641646/how-to-accomplish-authtype-none-in-apache-2-2) (according to accepted answer) – hakre Feb 17 '14 at 11:49

2 Answers2

1

I had the same error and I solved adding in the httpd.conf

LoadModule authz_core_module modules/mod_authz_core.so
Oscar Raig Colon
  • 1,302
  • 12
  • 14
  • 1
    This may be useful for others with a 2.4 configuration, but the question lists Apache 2.2 and it should be noted mod_authz_core was brought in on Apache 2.3 so this wouldn't work. – Stuart Brock Jun 16 '17 at 08:52
1

Looks like this was already answered: see this previous stackoverflow question. You might try the "ugly workaround" listed in the answers to that previous question.

Community
  • 1
  • 1
Reggie
  • 644
  • 5
  • 10