Last active
September 21, 2017 22:16
-
-
Save redesigned/0a2e75507b43d6a778aeae7a64e48294 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mount the EFS NFS volume | |
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 fs-b5f1571c.efs.us-west-2.amazonaws.com:/ efs | |
# Add Apache to ec2-user group if not already | |
sudo useradd -G apache ec2-user | |
sudo usermod -a -G apache ec2-user | |
# Set permissions on the new volume | |
sudo chmod 2775 /efs | |
sudo find /efs -type d -exec sudo chmod 2775 {} \; | |
sudo find /efs -type f -exec sudo chmod 0664 {} \; | |
# Set the fstab to auto-remount the EFS on reboot | |
#/etc/fstab | |
fs-b5f1571c.efs.us-west-2.amazonaws.com:/ /efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,_netdev 0 0 | |
#/efs/fixawspermissions.sh | |
./fixawspermissions_every5min.sh; | |
./fixawspermissions_hourly.sh; | |
#/efs/fixawspermissions_every5min.sh | |
sudo chmod 2775 /efs; | |
sudo chown -R apache:ec2-user /efs; | |
sudo chmod 4700 /efs/fixawspermissions_every5min.sh; | |
sudo chmod 4700 /efs/fixawspermissions_hourly.sh; | |
sudo chmod 4700 /efs/fixawspermissions.sh; | |
#/efs/fixawspermissions_hourly.sh | |
sudo chmod 2775 /efs; | |
sudo chown -R apache:ec2-user /efs; | |
sudo find /efs -type d -exec sudo chmod 2775 {} \; | |
sudo find /efs -type f -exec sudo chmod 0664 {} \; | |
sudo chmod 4700 /efs/fixawspermissions_every5min.sh; | |
sudo chmod 4700 /efs/fixawspermissions_hourly.sh; | |
sudo chmod 4700 /efs/fixawspermissions.sh; | |
#crontab | |
*/5 * * * * /var/www/fixpermissions_every5min.sh | |
1 */1 * * * /var/www/fixpermissions_hourly.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment