Last active
January 18, 2020 22:56
-
-
Save charliepage88/ca0bb52af0f042801b3b1ccf815bc2e4 to your computer and use it in GitHub Desktop.
Simple shell script to setup unix permissions for Laravel
This file contains 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
#!/usr/bin/env bash | |
cd /var/www/projects/projectname | |
sudo find storage/ -type f -exec chmod 664 {} \; | |
sudo find storage/ -type d -exec chmod 775 {} \; | |
sudo find bootstrap/cache/ -type f -exec chmod 664 {} \; | |
sudo find bootstrap/cache/ -type d -exec chmod 775 {} \; | |
sudo chown -R www-data:dev storage | |
sudo chown -R www-data:dev bootstrap/cache | |
sudo chmod -R ug+w storage | |
sudo chmod -R ug+w bootstrap/cache | |
sudo chmod g+s storage | |
sudo chmod g+s bootstrap/cache | |
sudo setfacl -R -dm u:www-data:rwx storage | |
sudo setfacl -R -m u:www-data:rwx storage | |
sudo chmod -R g+w storage | |
sudo setfacl -R -m 'group:dev:rwx' -m 'd:group:dev:rwx' . | |
php artisan cache:clear | |
composer dump-autoload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shell script that will set up permissions for you, at least in Ubuntu, for a Laravel app.