Skip to content

Instantly share code, notes, and snippets.

@zhd4n
Last active June 25, 2019 07:50
Show Gist options
  • Select an option

  • Save zhd4n/faadfa46b6df98f3356a91aa1f628dd2 to your computer and use it in GitHub Desktop.

Select an option

Save zhd4n/faadfa46b6df98f3356a91aa1f628dd2 to your computer and use it in GitHub Desktop.

Revisions

  1. zhd4n revised this gist Jun 25, 2019. 2 changed files with 5 additions and 17 deletions.
    5 changes: 5 additions & 0 deletions laravel_perms.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    sudo chown -R $USER:www-data /path/to/your/laravel/root/directory
    sudo find /path/to/your/laravel/root/directory -type f -exec chmod 664 {} \;
    sudo find /path/to/your/laravel/root/directory -type d -exec chmod 775 {} \;

    sudo chmod -R ug+rwx storage bootstrap/cache
    17 changes: 0 additions & 17 deletions perms.txt
    Original file line number Diff line number Diff line change
    @@ -1,17 +0,0 @@
    //www-data = web server user
    //$USER = your local user which you use to login via ssh

    //Most folders should be normal "755" and files, "644"
    sudo find /path/to/your/root/directory -type -d -exec chmod 755 {} \;
    sudo find /path/to/your/root/directory -type f -exec chmod 644 {} \;
    sudo chown -R $USER:www-data /path/to/your/root/directory

    //Laravel requires some folders to be writable for the web server user. You can use these command on *nix based OSs.

    //Using ACL
    sudo setfacl -Rdm u:www-data:rwx,u:$USER:rwx storage
    sudo setfacl -Rm u:www-data:rwx,u:$USER:rwx storage

    //If you don't have ACL, you can use these but they're not so great;
    sudo chgrp -R www-data storage bootstrap/cache
    sudo chmod -R ug+rwx storage bootstrap/cache
  2. zhd4n revised this gist Mar 25, 2019. No changes.
  3. zhd4n renamed this gist Mar 25, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. zhd4n renamed this gist Mar 25, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. zhd4n renamed this gist Mar 25, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. zhd4n renamed this gist Mar 25, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. zhd4n created this gist Mar 25, 2019.
    17 changes: 17 additions & 0 deletions rights,sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    //www-data = web server user
    //$USER = your local user which you use to login via ssh

    //Most folders should be normal "755" and files, "644"
    sudo find /path/to/your/root/directory -type -d -exec chmod 755 {} \;
    sudo find /path/to/your/root/directory -type f -exec chmod 644 {} \;
    sudo chown -R $USER:www-data /path/to/your/root/directory

    //Laravel requires some folders to be writable for the web server user. You can use these command on *nix based OSs.

    //Using ACL
    sudo setfacl -Rdm u:www-data:rwx,u:$USER:rwx storage
    sudo setfacl -Rm u:www-data:rwx,u:$USER:rwx storage

    //If you don't have ACL, you can use these but they're not so great;
    sudo chgrp -R www-data storage bootstrap/cache
    sudo chmod -R ug+rwx storage bootstrap/cache