0

I have a problem that's baffling me. I couldn't get my .htpasswd file to work: no matter what I'd do, my web server would refuse my credentials. In desperation, I finally made a second file called .xxx. This file is identical, as you can see in the ls output below:

[smith@ctweb03 public_html]$ ls -l .xxx .htpasswd
-rw-r--r-- 1 aasmith ctweb03-access 501 Nov 30 22:36 .htpasswd
-rw-r--r-- 1 aasmith ctweb03-access 501 Nov 30 22:35 .xxx
[smith@ctweb03 public_html]$ diff .xxx .htpasswd
[smith@ctweb03 public_html]$ 

Yet, when I change my .htaccess file to read .xxx rather than .htpasswd, the system works. It does this regardless of browser that I use.

Does anyone have any idea what I could check, to figure out why this is so? (Please note that I don't have easy access to the Apache log file...I'd have to ask IT nicely, and I'm not sure that they'd do it.) What can I check to figure out what the crucial difference between these files is?

One last final note...as an experiment I briefly set up .xxx to be a symbolic link to .htpasswd, and then it didn't work. But when I changed them back to identical, independent files, it did.

Thank you.

Adam Smith
  • 449
  • 9
  • 23
  • Refused credentials makes me think that there's another `.htpasswd` file somewhere else that takes precedence over yours. Possibly some server config at a higher level managed by IT? – sal Dec 01 '16 at 07:28
  • Wouldn't it need to be a `.htaccess` file taking precedence, rather than a `.htpasswd` file? – Adam Smith Dec 01 '16 at 07:35
  • I meant, maybe the server is set to use a specific .htpasswd already, and you can't override it. Unless you use a different filename. But I am not *that* of an expert in apache config. Just an educated guess. – sal Dec 01 '16 at 20:19

1 Answers1

0

Check the MD5 hash of both files and see if they are actually identical.

md5 .htpasswd and md5 .xxx

Just because a file is the same size, does not mean it has the same data.

Halcyon
  • 1
  • 1
  • Good thought, but the md5 hashes are identical. (That's why I did the `diff` above--they really do have the same contents.) – Adam Smith Dec 01 '16 at 07:21