Understanding how permissions are set in a fresh installation

Posted 2 years ago by fsdolphin

Hi,

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?

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.

I'm using Ubuntu + Nginx servers.

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

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

Please sign in or create an account to participate in this conversation.