Saturday, April 1, 2017

Understanding how permissions are set in a fresh Laravel installation

I'm trying to have a better understanding on how server permissions work, in this case using Laravel. It is my understanding that in Laravel all folders should be set to 755 and all files to 644, with the exception of the storage and cache folders, but can someone explain me why in a fresh install all my folders are set to 775 and all files to 664?

  1. What dictates the default permissions when installing the framework, Laravel or the server?

  2. Is this the common default permissions in a fresh Laravel installation?

I'm using Ubuntu + Nginx servers.

Here is what I see in a fresh install...

drwxrwxr-x  6 groupName userName   4096 Mar 31 15:40 app
-rw-rw-r--  1 groupName userName   1646 Mar 31 15:40 artisan
drwxrwxr-x  3 groupName userName   4096 Mar 31 15:40 bootstrap
-rw-rw-r--  1 groupName userName   1300 Mar 31 15:40 composer.json
-rw-rw-r--  1 groupName userName 121424 Mar 31 15:40 composer.lock
drwxrwxr-x  2 groupName userName   4096 Mar 31 15:40 config
drwxrwxr-x  5 groupName userName   4096 Mar 31 15:40 database
-rw-rw-r--  1 groupName userName   1062 Mar 31 15:40 package.json
-rw-rw-r--  1 groupName userName   1055 Mar 31 15:40 phpunit.xml
drwxrwxr-x  4 groupName userName   4096 Mar 31 15:40 public
-rw-rw-r--  1 groupName userName   3424 Mar 31 15:40 readme.md
drwxrwxr-x  5 groupName userName   4096 Mar 31 15:40 resources
drwxrwxr-x  2 groupName userName   4096 Mar 31 15:40 routes
-rw-rw-r--  1 groupName userName    563 Mar 31 15:40 server.php
drwxrwxr-x  5 groupName userName   4096 Mar 31 15:40 storage
drwxrwxr-x  4 groupName userName   4096 Mar 31 15:40 tests
drwxrwxr-x 31 groupName userName   4096 Mar 31 15:40 vendor
-rw-rw-r--  1 groupName userName    555 Mar 31 15:40 webpack.mix.js
-rw-rw-r--  1 groupName userName 204990 Mar 31 15:40 yarn.lock

Again, all I'm trying to understand here is what sets the default folder and file permissions not what type of folder permission are need for Laravel.



via fs_tigre

Advertisement