pkraft
By:
pkraft

No User Can Access /var/www/vhosts Folder

December 24, 2013 2.2k views
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? deploy:x:1001:33:Deploy,,,:/home/deploy:/bin/bash www-data:x:33:deploy root@test:~# ls -al /var/www/vhosts// total 20 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
2 Answers
Sorry, but some formatting I used was stripped out of my info on the user and folder. Here it is again in case the above is confusing.

USER INFO:

ETC/PASSWD:
deploy:x:1001:33:Deploy,,,:/home/deploy:/bin/bash

ETC/GROUP:
www-data:x:33:deploy


FOLDER:
root@test:~# ls -al /var/www/vhosts/SITENAME/
total 20
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
"Sorry, but some formatting I used was stripped out ..."

That's where sites like Pastie or CentOS Pastebin come in handy.
Have another answer? Share your knowledge.