apache – grant access to single file


  1. Ensure target file has read access from apache user
    ls -l /path/to/my/file/myfile.doc

    If not, grant right via:

    chmod a+rwx /path/to/my/file/myfile.doc
  2. In one of your /etc/apache/sites-enable/*.conf files, add the following:
    <Directory /path/to/my/file>
    <Files myfile.doc>
    Require all granted
  3. Restart apache
    sudo apache2ctl restart



Post a Comment

Your email is never published nor shared. You're allow to say what you want...