Apache can't save files to mounted directory
I have bought WD myCloud storage and I have mount it to centos 7 by adding this line to fstab
Code:
\wd_mycloud_ip_address\shared_folder /backup cifs rw,suid,username=shared_folder_username,password=shared_folder_password 0 0 Code:
mount -a the problem now when I want to let the apache (using php web application) itself save files into the mounted directory /backup , I am getting an error in my web application "The destination folder is not writable." I tried diffrent senario to solve the issue but unfortuntly it dosen't works fine. First I have umount the /backup, changed the Code:
chown -R apache:apache /backup second, while the /backup is mounted with "chown root:root", I have tried to change it is owner/group to apache:apache but it doesn't allow. the commend goes without an error but when I "ls -al" it show me it is still root:root. How can I mount a /backup directory using root:root and at the same time let the web application save files into /backup using apache:apache ? |
Quote:
|
Quote:
|
Quote:
So ALL the files on your CIFS volume are always owned by the mount uid and gid. Except for readonly/readwrite they haven't got the same permissions either, those too are simulated by the umask (cq fmask/dmask) options ON the mount command. Probably easiest is to mount it with "you" as owner (so you can access it) and "apache" (or sometimes httpd) as the group (so apache can access it) and with a umask that allows writing by the group (like 002). |
Yes. You don't (can't) change the ownership of the mount. You need to change the ownership/permissions of the specific directory within that mount you want apache to be able to write to...and typically only that directory.
|
I have added apache uid and gid to the mount statement and deleted suid as following
Quote:
|
All times are GMT -5. The time now is 06:38 AM. |