Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Installation & Hosting

Installation: why not changing user:group?

Started by Jarry 8 years ago · 4 replies · 621 views
8 years ago

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...

8 years ago

@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: http://yoursite.com

It hasn't failed on me yet....

last edited 08/17/18 by pamtbaau
8 years ago

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
8 years ago

If you want run a file-based CMS like Grav (and we want that! 😎) 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

8 years ago

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

This is very true especially in cases when CHMOD involves "+s"...

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by antoinep, 13 hours ago
5 60 7 hours ago
Installation & Hosting · by Jürgen Dietrich, 7 months ago
0 62 7 months ago
Installation & Hosting · by rappluk, 8 months ago
0 62 8 months ago
Installation & Hosting · by N, 12 months ago
3 72 12 months ago
Installation & Hosting · by Youle, 1 year ago
1 61 1 year ago