Project

General

Profile

[Solved] Cannot read directory from CGI even though it is 777 and www-data:www-data

Added by respectech over 9 years ago

My lighttpd www directory is at /var/www. I have symlinked the following file in that directory:

lrwxrwxrwx 1 root root 27 oct 6 14:20 video -> /media/odroid/1TB/smoothcam

When I try accessing that directory from lighttpd using CGI, I get:

** Access error: cannot open: video/ reason: 13 **

If I try accessing that symlink with any other user (not within lighttpd), I can access it fine.

Here is a listing of video/:

drwxrwxrwx 1 www-data www-data 4096 oct 6 13:40 smoothcam1

I've added www-data to the "root" and "odroid" groups as well as those can access that directory just fine. I cannot figure out how to execute a process as the user "www-data", so I can't try to recreate that. Here's the id of user "www-data" on my system:

uid=33(www-data) gid=33(www-data) groups=33(www-data),0(root),1001(odroid)

Any ideas what I'm doing wrong?


Replies (2)

RE: Cannot read directory from CGI even though it is 777 and www-data:www-data - Added by respectech over 9 years ago

For anyone who is interested, here's what I discovered.

Lighttpd on Xubuntu 13.10 doesn't have any trouble accessing the /media/odroid/1TB/smoothcam directory.

Lighttpd on Lubuntu 14.04.1 LTS will not access the /media/odroid/1TB/smoothcam directory.

However, if the drive is mounted via /etc/fstab to /var/www/video, for instance, Lighttpd on Lubuntu 14.04.1 LTS can access the drive fine.

RE: [Solved] Cannot read directory from CGI even though it is 777 and www-data:www-data - Added by gstrauss about 7 years ago

check selinux/apparmor settings, as well as default mount or automount settings for things mounted under /media.

    (1-2/2)