as mostly stated above:
- Your comands look fine, so I suspect there`s something wrong with the assumptions surrounding what you do
- please make shure that the apache user and group are called "apache" and not "apache2", "httpd" or "www-data" ore some such name
- chmod -R 770 sets the execute-bit on directories and files in those directories. You should only set the "x"-bit on directories to allow dir-traversal.
if you want to exclude all users of the group "users" from accessing the "upload"-dir, you could assign that directory explicitly to group "users" and then set restrictive group permissions:
# group permissions override permissions for "others"
chown -R www-data:users /mydir
# group has no permissions, "others" can read and traverse
chmod 0705 /mydir
# change permissions on subdirs only
find /mydir -type d -exec chmod 0705 {} \;
# files should by default not be executeable anyway
find /mydir -type f -exec chmod a-x,o-w {} \;
If you want to find the apache user, do (on linux only)
ps axu | grep apache | grep -v root
and look at the leftmost column. Maybe substitute apache with httpd in the grep command.
Cheers,
Nik.
chown
ing toapache:apache
, too