Skip to content

Instantly share code, notes, and snippets.

@Africanpride
Forked from eritislami/setperms.sh
Created January 27, 2023 18:21
Show Gist options
  • Save Africanpride/6eb164f82aa3438715efdacf17a63465 to your computer and use it in GitHub Desktop.
Save Africanpride/6eb164f82aa3438715efdacf17a63465 to your computer and use it in GitHub Desktop.
Set permissions for laravel application on ubuntu/nginx
# Allow execution
# chmod +x ./setperms.sh
# Usage
# ./setperms.sh /var/www/domain.com
cd $1
sudo chown -R $USER:www-data .
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment