Report this

What is the reason for this report?

No User Can Access /var/www/vhosts Folder

Posted on December 24, 2013

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/<sitename>/. 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 user>

<passwd> deploy:x:1001:33:Deploy,:/home/deploy:/bin/bash

<group> www-data:x:33:deploy

<the 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



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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. <br> <br>USER INFO: <br> <br>ETC/PASSWD: <br>deploy:x:1001:33:Deploy,:/home/deploy:/bin/bash <br> <br>ETC/GROUP: <br>www-data:x:33:deploy <br> <br> <br>FOLDER: <br>root@test:~# ls -al /var/www/vhosts/SITENAME/ <br>total 20 <br>drwxrwsrwx 5 deploy www-data 4096 Dec 23 15:06 . <br>drwxrw-r-- 3 root www-data 4096 Dec 23 15:06 … <br>drwxrwsrwx 2 deploy www-data 4096 Dec 23 15:06 backups <br>drwxrwsrwx 6 deploy www-data 4096 Dec 23 16:19 httpdocs <br>drwxrwsrwx 2 deploy www-data 4096 Dec 23 15:06 logs

<b>“Sorry, but some formatting I used was stripped out …”</b> <br> <br>That’s where sites like <a href=“http://pastie.org/”>Pastie</a> or <a href=“http://pastebin.centos.org/”>CentOS Pastebin</a> come in handy.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.