Skip to content

Instantly share code, notes, and snippets.

@sijad
Created November 26, 2016 09:11
Show Gist options
  • Save sijad/cd50d8a525e850144d9f43d5c713cbcc to your computer and use it in GitHub Desktop.
Save sijad/cd50d8a525e850144d9f43d5c713cbcc to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
sudo chown nginx:nginx -R $1
cd $1
# File permissions, recursive
find . -type f -exec chmod 0644 {} \;
# Dir permissions, recursive
find . -type d -exec chmod 0755 {} \;
# SELinux serve files off Apache, resursive
sudo chcon -t httpd_sys_rw_content_t $1 -R
# Allow write only to specific dirs
# sudo chcon -t httpd_sys_rw_content_t $1 -R
# sudo chcon -t httpd_sys_rw_content_t $1 -R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment