Page 1 of 1

Can't mkdir permission denied

Posted: Mon Jul 25, 2022 12:17 pm
by adfytr
Managed to install on Arch run by nginx
using nfs as main storage /mnt/hdd/cam-vid path recognized
but receive title error when detecting so no events recorded obviously

chmod 755 on /mnt/hdd
chown by root

what am I doing wrong? thank you

Re: Can't mkdir permission denied

Posted: Mon Jul 25, 2022 1:23 pm
by Ralphred
You've only set write privilege to the "owner" of /mnt/hdd, the three numbers 7, 5 & 5 are user, group & other respectively.
What you should do is (as root) find out what the primary group ID of your apache2 user is

Code: Select all

grep $(ps aux|awk '/\/apache/ {print $1}'|grep -v $(whoami)|sort -u) /etc/passwd|sed 's/:/ /g'|awk '{print $4}'
set this as the group of /mnt/hdd/

Code: Select all

chown :[gid from above] /mnt/hdd/ -R
and let 'group' have write access

Code: Select all

chmod g+w /mnt/hdd/ -R

If you are feeling lazy, you can add just write access to 'others'

Code: Select all

chmod o+w /mnt/hdd/ -R

You should also

Code: Select all

touch /mnt/hdd/cam-vid/test.deleteme
as root just to prove your nfs exports/fstab are correct too.

Re: Can't mkdir permission denied

Posted: Mon Jul 25, 2022 1:32 pm
by adfytr
thank you so much!
i managed to find some instructions (although outdated for conf.d folder and requirement for ZM_DIR_EVENTS=)

and put chown for http:http (since it is nginx) on /mnt/hdd/cam-vid that did the trick