I'm new un the world of GNU/Linux and I have a problem which I think is caused by the permissions which are not correct. I'm running Ubuntu 11.10 with chroot running under Android 4.4.2 (I don't know if this expression is correct). When I mounted it I binded the Android directory (where I have my PHP projects) "/sdcard" to the Linux directory "/media/sdcard". Then I created a folder called "media" in "/var/www" and another folder within it called "sdcard". When I access it with Apache everything is correct (it shows me an empty index of files) and the permissions are: drwxrwxr-x. 2 root www-data 4096 Apr 18 10:24 sdcard Then I added a line in "/etc/fstab" which binds "/media/sdcard" with "/var/www/media/sdcard":
/media/sdcard /var/www/media/sdcard auto bind
But it didn't worked. I rebooted Ubuntu and Android but it's still not mounted. I tried to change "auto bind" with "none bind 0 0" but still doesn't work, "/var/www/media/sdcard" appears to be empty.
Finally, I tried using "sudo mount --bind /media/sdcard /var/www/media/sdcard" which worked for me. But now the folder "/var/www/media/sdcard" has as permissions: drwxrwx--x. 31 root 1028 4096 Apr 16 5:52 And now Apache throws me a 403 Forbidden error instead of the previous empty list.
Is it caused by the permissions? If that's true, how can I "restore" them? I tried with "sudo chmod -vR 0775 /var/www/media/sdcard" but it doesn't work, and changing the ownership with "sudo chown -vR www-data /var/www/media/sdcard" doesn't change anything.
Sorry for my English, I'm from Spain.