Skip to content

Instantly share code, notes, and snippets.

@eritislami
Last active January 27, 2023 18:21
Show Gist options
  • Save eritislami/0cd59d7bc32ecf6bd92301c0f172b086 to your computer and use it in GitHub Desktop.
Save eritislami/0cd59d7bc32ecf6bd92301c0f172b086 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