Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I got a dedicated server running Ubuntu 10.04 with 10 users. Weeks ago i configure Apache with Alias for each user, everyone got a www/ inside their own /home/ and i pointed a subdomain to each www/

Alias /foo /home/foo/www/
    <Directory /home/foo/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

It works well to regular website but when i want to use some shell_exec with PHP i got some rights issues. Apache don't got the sufficient right to write in the folder. I tried to add www-data group to the www/ & to grant my users with the www-data rights but it does not work...

Here is a the ls -a command result

drwxr-xr-x  8 foo www-data  4096 2012-07-24 08:44 www/

Any clue to fix this ?

share|improve this question

2 Answers 2

You'll want to use the userdir module in Apache for this, instead.

It allows Apache access to a specific directory in your users' home directory - by default

/home/foo/public_html

http://www.techytalk.info/enable-userdir-apache-module-ubuntu-debian-based-linux-distributions/ has a pretty good guide on how to set this up.

share|improve this answer

With your current permission-scheme on the www-folder, the www-data-group only got read and execute permissions on the directory. Give it write-permissions with the following command:

chmod 0775 www

If the directory contains more directories and you need to apply new permissions recursively, you can run the following commands:

find www -type d -exec chmod 0775 '{}' \;
find www -type f -exec chmod 0664 '{}' \;
share|improve this answer
    
Yeah, i also tought to do it that way but i'm a bit afraid to give write rights to groups ... Especially on a production environnement. –  x_vi_r Jul 25 '12 at 13:30
    
You have to if you want Apache to write to those directories. If possible, you should limit this write-access only to what is absolutely necessary. –  pkhamre Jul 25 '12 at 13:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.