B
B
BonBon Slick2018-07-01 02:45:53
System administration
BonBon Slick, 2018-07-01 02:45:53

Correct permissions and groups for the project?

I myself set up like this for LAN

drwxrwsrwx+    6 bonbon www-data   4096 Apr 26 22:35 assets
-rwxrwxrwx+    1 bonbon www-data    530 Apr 14 14:53 bash.exe.stackdump
drwxrwsrwx+    2 bonbon www-data   4096 Jun 21 15:54 bin
-rwxrwxrwx+    1 bonbon www-data   5086 Jun 30 14:46 composer.json
-rwxrwxrwx+    1 bonbon www-data 420963 Jun 30 14:47 composer.lock
drwxrwsrwx+    5 bonbon www-data   4096 Jun 30 21:18 config
drwxrwsrwx+ 1193 bonbon www-data  36864 Apr 29 17:40 node_modules
-rwxrwxrwx+    1 bonbon www-data   1024 Apr 29 17:40 package.json
-rwxrwxrwx+    1 bonbon www-data    599 Apr 25 23:02 phpstan.neon
-rwxrwxrwx+    1 bonbon www-data    599 Apr 25 23:02 phpstan.neon.dist
-rwxrwxrwx+    1 bonbon www-data   5662 May 26 08:50 phpunit_example.xml
-rwxrwxrwx+    1 bonbon www-data   5551 Jun 21 15:54 phpunit.xml
drwxrwsrwx+    9 bonbon www-data   4096 May 18 00:13 public
-rwxrwxrwx+    1 bonbon www-data   8347 Jun 30 14:35 readme.md
-rwxrwxrwx+    1 bonbon www-data 583960 May 17 18:35 security-checker.phar
drwxrwsrwx+    5 bonbon www-data   4096 Jun 29 20:38 src
-rwxrwxrwx+    1 bonbon www-data  19073 Jun 30 14:47 symfony.lock
-rwxrwxrwx+    1 bonbon www-data    136 Apr 21 02:32 typescript
drwxrwsrwx+    4 bonbon www-data   4096 Apr 30 00:46 var
drwxrwsrwx+   70 bonbon www-data   4096 Jun 30 14:47 vendor
-rwxrwxrwx+    1 bonbon www-data   1108 Apr 30 10:54 webpack.config.js
-rwxrwxrwx+    1 bonbon www-data 298149 Apr 14 14:53 yarn-error.log
-rwxrwxrwx+    1 bonbon www-data 339370 Apr 29 17:40 yarn.lock

on demo and prod I put 775 and www-data for places where you need to write and read, such as logs, file uploads, etc. The rest is 664.
However, how about this:
-rwxrwxr-x  1 www-data www-data       0 Jun 19 17:36 2
drwxrwxr-x  9 www-data www-data    4096 Jun 30 16:42 app
-rwxrwxr-x  1 www-data www-data    1686 Jun 19 17:36 artisan
drwxrwxr-x  3 www-data www-data    4096 Jun 19 17:36 bootstrap
-rwxrwxr-x  1 www-data www-data    1738 Jun 30 16:42 composer.json
-rwxrwxr-x  1 www-data www-data  215955 Jun 30 16:42 composer.lock
-rwxrwxr-x  1 www-data www-data 1854600 Jun 19 17:36 composer.phar
drwxrwxr-x  2 www-data www-data    4096 Jun 19 17:36 config
drwxrwxr-x  5 www-data www-data    4096 Jun 19 17:36 database
-rwxrwxr-x  1 www-data www-data    8145 Jun 19 17:36 oldDashboard.txt
-rwxrwxr-x  1 www-data www-data    1125 Jun 19 17:36 package.json
-rwxrwxr-x  1 www-data www-data    1040 Jun 19 17:36 phpunit.xml
-rwxrwxr-x  1 www-data www-data    1581 Jun 19 17:36 Prerequisite
drwxrwxr-x 11 www-data www-data    4096 Jun 19 17:36 public
-rwxrwxr-x  1 www-data www-data    3550 Jun 19 17:36 readme.md
-rwxrwxr-x  1 www-data www-data    3550 Jun 19 17:36 README.md
drwxrwxr-x  5 www-data www-data    4096 Jun 19 17:36 resources
drwxrwxr-x  2 www-data www-data    4096 Jun 30 16:42 routes
-rwxrwxr-x  1 www-data www-data     563 Jun 19 17:36 server.php
drwxrwxr-x  6 www-data www-data    4096 Jun 20 15:41 storage
drwxrwxr-x  4 www-data www-data    4096 Jun 19 17:36 tests
drwxrwxr-x 52 www-data www-data    4096 Jun 30 20:36 vendor
-rwxrwxr-x  1 www-data www-data     549 Jun 19 17:36 webpack.mix.js
-rwxrwxr-x  1 www-data www-data   11862 Jun 19 17:36 worker.log

I looked at the server of one site with which I worked.
also sometimes confused how to correctly set the rights?
symfony.com/doc/current/setup/file_permissions.html
https://symfony.com/doc/3.3/setup/file_permissions.html
or just give chmod -R 775 and chown -R www-data? Or root:www-data?
Please tell me how to set it up correctly, how do you set it up?
Answers like
https://stackoverflow.com/questions/23540083/file-...
777 for the entire project.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2018-07-01
@BonBonSlick

the question is essentially meaningless, because there are many options depending on how the server is started and puffed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question