1

I'm trying many different configurations following many tutorials and documentations, I can't get the authentication without creating thousands .htaccess files.

Here is my configuration :

<VirtualHost *:443>
 DocumentRoot /home/user/www
 ServerName preprod.user.com
 <Directory /home/user/www>
     Options Indexes SymLinksIfOwnerMatch
     AllowOverride All
     AllowOverride FileInfo AuthConfig Limit
     Require all granted
 </Directory>

 SSLEngine on
 SSLCertificateFile      /etc/ssl/private/preprod.user.com.crt
 SSLCertificateKeyFile /etc/ssl/private/preprod.user.com.key
</VirtualHost>

And at the root level, I wrote this /home/user/www/.htaccess file :

 AuthType DIGEST
 AuthName "preproduction"
 AuthDigestNonceLifetime 1
 AuthDigestDomain "/home/user/www/" "https://preprod.user.com/"
 AuthDigestProvider file
 AuthUserFile "/web/auth/.digest_pw"
 Require valid-user

The result is :

https://preprod.user.com/ asks for a password
https://preprod.user.com/v1/ asks for a password

BUT :

https://preprod.user.com/v1/index.php <strong>doesn't ask for password</strong>

Thank you all

6
  • do you have other .htaccess who could cut the auth system ?
    – Froggiz
    Nov 2, 2015 at 15:51
  • Can't I forbid the Auth Override ? Nov 5, 2015 at 17:48
  • I dont have a .htaccess in the v1 folder Nov 5, 2015 at 17:52
  • i think it come from AuthDigestDomain httpd.apache.org/docs/2.2/en/mod/… try to remove "/home/user/www/" causse it accept only uri, if it still dont work add "/v1/" as uri
    – Froggiz
    Nov 5, 2015 at 18:22
  • Actually it is just the index.php on which it fails. I edited the end on Answer. @Froggiz, I removed /home.... Still the same, with /v1/ ... the same. Nov 6, 2015 at 10:04

1 Answer 1

1

I just found a solution :

The problem comes from the files : without telling the files the Authentication applies, it only applies on the directories and files keep served !

<Files *>
         AuthType DIGEST
         AuthName "preproduction"
         AuthDigestNonceLifetime 1
         AuthDigestDomain "https://preprod.user.com/"
         AuthDigestProvider file
         AuthUserFile "/web/auth/.digest_pw"
         Require valid-user
</Files>

Bye !

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .