3

Scenario

I am working with two servers both running apache. An identical .htaccess is working on one server and not the other.

Code

AuthUserFile .htpasswd
AuthType Basic
AuthName "Password Required"
Require user jackson
Order Deny,Allow
Deny from All

<FilesMatch "^ads\.txt$">
Allow from all
</FilesMatch>

Satisfy Any

Question

Anonymous visitors are able to see ads.txt on server A without logging in, however, they'll see 401 (unauthorized) on server B. What could be the reason or what can I do to troubleshoot further?

Extra

  • If I switch to Allow from All on line 6 the ads.txt is STILL blocked on server B by a 401. If I comment out the FilesMatch condition then it's unblocked. This only escalates the confusion..
  • Server B has a .htaccess in the parent directory. Setting it to Allow from All didn't have any effect.
  • Both files are 664 and belong to a group apache has access to.
Jacksonkr
  • 465
  • 1
  • 7
  • 16
  • 1
    same .htaccess doesn't mean both servers are identical in terms of other aspect. e.g. directory permissions – Mox Aug 14 '18 at 14:16
  • Both files are `664` and belong to a group apache has access to - just added to "Extra" – Jacksonkr Aug 14 '18 at 15:31
  • Which Apache version are on both servers? – MrWhite Aug 16 '18 at 21:43
  • @MrWhite `Apache/2.4.7 (Ubuntu)` on B but w server A it seems I don't have the creds to see the current OS or apache details - Per how it operates it's definitely apache2 on some linux distro. – Jacksonkr Aug 17 '18 at 14:06

1 Answers1

2

Are both servers running the same linux distribution and version and are both running the same version of Apache?

Although the files might have the same permissions (664 and same owner/group), is the full path accessible on both servers? Maybe one of the subfolders has too restrictive permissions.

Tommiie
  • 5,627
  • 2
  • 12
  • 46