I built an Ubuntu 12.04 droplet, installed a LAMP stack, created a couple users, added one of them to the www-data group, and created a folder for that user at /var/www/vhosts//. The problem is, that user cannot access that folder. Further testing revealed that no user other than root can access it or any folder I create in /var/www.
I have added users to the www-data group, I have changed the ownership of the folder to the users, I have even set permissions to 777 on the folder. No matter what I do only root can access the folders. Apparently the www-data user cannot access it either because web visitors cannot access any files I place in the folder either.
Below is some info on the folder and one of the users in question. Does anyone know what could be causing this?
root@test:~# ls -al /var/www/vhosts//
drwxrwsrwx 5 deploy www-data 4096 Dec 23 15:06 .
drwxrw-r-- 3 root www-data 4096 Dec 23 15:06 ..
drwxrwsrwx 2 deploy www-data 4096 Dec 23 15:06 backups
drwxrwsrwx 6 deploy www-data 4096 Dec 23 16:19 httpdocs
drwxrwsrwx 2 deploy www-data 4096 Dec 23 15:06 logs
These answers are provided by our Community. If you find them useful, show some love by clicking the heart.
If you run into issues leave a comment, or add your own answer to help others.