Installation: why not changing user:group?

Hi Grav-community,

I just discovered Grav, and decided to test it on my VPS. I’m trying to install it, following instructions in documentation. Now I’m in the section Basic->Requirements->Permissions. I found user running my www-server and group it belongs to. Now I’m going to change permissions, and I have a question concerning this. Documentations lists this sequence of commands:

chgrp -R GROUP .
find . -type f | xargs chmod 664
find ./bin -type f | xargs chmod 775
find . -type d | xargs chmod 775
find . -type d | xargs chmod +s

Is there any reason not to do this instead:

chown -R USER:GROUP .

None of those following “find…” commands would be necessary if I just changed user to the one running web-server (instead of group), because all files are already 644 and dirs 755 (so owner could modify/run them). And playing with sticky-bits is quite dangerous, it should be avoided whenever possible…

@Jarry Have you tried the most simple way of installing Grav?

Option 1: Install from ZIP package

The easiest way to install Grav is to download the ZIP package and extract it:

  1. Download the latest-and-greatest Grav or Grav + Admin package.
  2. Extract the ZIP file in the webroot of your web server, e.g. ~/webroot/grav

You can now point your browser at your local webserver:

It hasn’t failed on me yet…

Fixing owner/group is part of that “simple way”. Because if you download & unzip package as ordinary user, all files (after unzipping) will be owned by that user. And if your web-server is not running as root (and it should not!) then it can not modify files of other user…

What I do not understand is why official documentations recommends changing just group (and mode-bits) instead of simply changing owner. Those 5 commands can be substituted by single one, and it is much safer than playing with set-uid…

1 Like

If you want run a file-based CMS like Grav (and we want that! :sunglasses:) then you have to let your webserver modify the files in the webroot.

CHOWN is a better way of doing that than CHMOD in my opinion

CHOWN is a better way of doing that than CHMOD in my opinion

This is very true especially in cases when CHMOD involves “+s”…