Ubuntu – cannot upload images to data directory on Ubuntu LAMP

apache-2.2permissionsUbuntu

I'm migrating to a new server. It is the same setup as my last one: Ubuntu 11.4 with LAMP and ispconfig3.

Im using the php framework Elgg. All photos are stored in a data located at /var/www/clients/client0/web1/data

All permissions on the directories are set to 777. When i do ls -ld data/, the result is:

drwxrwxrwx 4 admin-wi www-data 4096 2012-07-13 12:53 data/

But I cant upload anything to the data directory, even with all the open permissions. Any help appreciated

Best Answer

You need to chown at least the directory to www-data:www-data and, for security reasons, really should only have it set to 775, or, preferably 755.

chown www-data:www-data data
chmod 775 data