On the server, I have a file called upload and its state was as follows:
drwx--x--- 12 bob bob 4096 JUL 20 19:07 upload
I use this file to be the destination file of the PHP function
move_uploaded_file's second argument to store the uploaded files.
So in order to get apache this permission to move files from /tmp to my upload, I add apache to the bob group, so it has the permission. apache is the user the apache is running as.
But if I exclude apache from the group bob using usermod, I can still upload files which means apache still have permissions like it's still in the group but obviously it isn't.
Uploading files will fail only when I
chmod -R 700 upload
or whenever I
service httpd restart
I don't know where I've missed in this.
Seems to me,
usermod will only apply permission changes after restarting apache.
Thanks in advance for helping me.