Oct 16, 2019
0
Level 7
Correct way to set permissions for Laravel (Linux + SELinux)?
This is what I thought, what should I change?
git clone/pull will be run by root
find /path-to-dir -type f -exec chmod 640 {} \;
find /path-to-dir -type d -exec chmod 750 {} \;
chown -R nginx:nginx /path-to-dir
semanage fcontext -a -t httpd_sys_content_t "/path-to-dir(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/path-to-dir/storage(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/path-to-dir/bootstrap/cache(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/path-to-dir/vendor(/.*)?"
restorecon -Rv /path-to-dir
composer will by run by nginx along with all artisan commands
Please or to participate in this conversation.