0

I have a strange problem but it hopefully has a logical answer.

Using - Server version: Apache/2.4.18 (Unix) in Archlinux 4.4.44-1-ARCH

I have a web page directory that I want to restrict access to *.ini files. The directive in httpd.conf is:

<Files "*.ini">
    Require all denied
</Files>

This works for all .ini files giving access denied on Listen 80 but if I change the port to Listen 15401 and of course use that port in the URL it then allows access to all .ini files. What does the port have to do with the access in this case?

There is a .htpasswd file but NO .htaccess

1 Answers1

0

In Apache configuration "context" is everything.

So, if you probably have that under a virtualhost that is *:80 or similar, it is logical it is not being applied if you just change the "Listen" directive and nothing else, since then probably another virtualhost or the default config is dealing with the incoming requests.

Review your whole config to confirm in which section/context you have defined that Files entry.

Daniel Ferradal
  • 2,727
  • 1
  • 13
  • 19