Skip to content

Instantly share code, notes, and snippets.

@chesio
Created May 10, 2017 12:20
Show Gist options
  • Save chesio/334869430689aedd343867e46c051338 to your computer and use it in GitHub Desktop.
Save chesio/334869430689aedd343867e46c051338 to your computer and use it in GitHub Desktop.
Restrict access to a file (debug.log) on Apache webserver
# Restrict access to debug.log only to certain IPs
<Files "debug.log">
<IfModule mod_authz_core.c>
# Multiple IP (network) addresses need to be separated by space
Require ip 127.0.0.1
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
# Multiple IP (network) addresses need to be separated by space
Allow from 127.0.0.1
</IfModule>
</Files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment