0

For other folders, my .htaccess file works fine, but when I was trying to download files under files folder, I got an error saying

You don't have permission to access /files/ on this server.
Server unable to read htaccess file, denying access to be safe
Apache/2.4.18 (Debian) Server at example.com Port 

I checked the permission settings of related files, didn't find anything wrong, and .htaccess is world readable under /var/www/html/. Plus, files folder is world readable too.

When I ls -l with low privileged user, I get

ls: cannot access 'files/ImmunityDebugger_1_85_setup.exe': Permission denied
ls: cannot access 'files/lwk69ff8f3169e274429c': Permission denied
ls: cannot access 'files/openwrt-ramips-mt7620a-hc5861-squashfs-sysupgrade.bin': Permission denied
ls: cannot access 'files/ssss.sh': Permission denied
ls: cannot access 'files/sss.tmpl': Permission denied
ls: cannot access 'files/to.torrent': Permission denied

And with root privilege

-rw-r--r-- 1 user user 1945064624 Apr  6 03:04 10_y
-rw-r--r-- 1 user user    3528192 Aug  2  2012 anyconnect-win-3.0.3054-pre-deploy-k9.msi
-rw-r--r-- 1 user user       3238 Apr  9 08:05 bap.zip
-rw-r--r-- 1 user user       1115 May 27 11:45 car
-rw-r--r-- 1 user user    9379014 May  8 08:22 taaa.pdf
5
  • I tried deleting the files folder using normal user and failed, due to insufficient privilege... but when I ls -l files, all I see is the files are owned by my current user (at least looks like so), and the files folder itself is also owned by my current user.
    – jm33_m0
    May 27, 2016 at 13:05
  • Which OS? Anything like SElinux enabled? Please show output of these ls -l commands.
    – JayMcTee
    May 27, 2016 at 13:20
  • @JayMcTee I am using Debian Stretch
    – jm33_m0
    May 27, 2016 at 13:21
  • @JayMcTee I tried with chmod 644 * and chown -R user *, didn't work...
    – jm33_m0
    May 27, 2016 at 13:30

2 Answers 2

0

I deleted files folder and created a new one in my web root, then copied all files to the new folder, now it's working fine.

0

Check out the permissions on the files directory. World needs to have the execute permission set to be able to traverse into it. You can set this with chmod o+x files from within the appropriate directory.

1
  • Your method will probably work, though
    – jm33_m0
    May 27, 2016 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .