Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a file on my apache server which i do not want the public to access.

I have a couple of IP addresses that will be needing the file, hence i want to grant them access to the file.

How can i go about it?


share|improve this question

migrated from Jun 23 '11 at 6:29

This question came from our site for professional and enthusiast programmers.

2 Answers 2

If you want to restrict access to just a single file say /var/www/filename.ext:

<Directory /var/www/>
  <Files filename.ext>
    Order allow,deny
    Allow from
share|improve this answer

mod_authz_host? There are a few way to specify, check out the link it has a few examples.

Order Deny,Allow
Deny from all
Allow from
Allow from 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.