Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 9d891dd

Browse files
Merge pull request #1239 from jeff-matthews/jm_1196_secondary_group_2.2
1196: Add latest revisions to v2.2 docs
2 parents 7ad9ae8 + a959ffc commit 9d891dd

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

_includes/install/file-system-perms-twouser_22.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ To enable the web server to write files and directories in the Magento file syst
1212

1313
This section discusses how to create a new Magento file system owner and put that user in the web server's group. You can use an existing user account if you wish; we recommend the user have a strong password for security reasons.
1414

15+
<div class="bs-callout bs-callout-info">
16+
Skip to <a href="#install-update-depend-user-findgroup">step 2</a> if you plan on using an existing user account.
17+
</div>
18+
1519
### Step 1: Create the Magento file system owner and give the user a strong password {#mage-owner-create-user}
1620
This section discusses how to create the Magento file system owner. (Magento file system owner is another term for the *command-line user*.)
1721

@@ -35,7 +39,7 @@ For example, to create a user named `magento_user` and give the user a password,
3539
sudo passwd magento_user
3640

3741
<div class="bs-callout bs-callout-warning">
38-
<p>Because the point of creating this user is to provide added security, make sure you create a <a href="https://en.wikipedia.org/wiki/Password_strength" target="_blank">strong password</a>.</p>
42+
<p>Because the point of creating this user is to provide added security, make sure you create a <a href="https://en.wikipedia.org/wiki/Password_strength" target="&#95;blank">strong password</a>.</p>
3943
</div>
4044

4145
### Step 2: Find the web server user's group {#install-update-depend-user-findgroup}
@@ -51,20 +55,28 @@ To find the web server user's group:
5155
### Step 3: Put the Magento file system owner in the web server's group {#install-update-depend-user-add2group}
5256
To put the Magento file system owner in the web server's primary group (assuming the typical Apache group name for CentOS and Ubuntu), enter the following command as a user with `root` privileges:
5357

54-
* CentOS: `usermod -g apache <username>`
55-
* Ubuntu: `usermod -g www-data <username>`
58+
* CentOS: `usermod -a -G apache <username>`
59+
* Ubuntu: `usermod -a -G www-data <username>`
60+
61+
<div class="bs-callout bs-callout-info" id="info" markdown="1">
62+
The `-a -G` options are important because they add `apache` or `www-data` as a _secondary_ group to the user account, which preserves the user's _primary_ group. Adding a secondary group to a user account helps [restrict file ownership and permissions](#perms-set-two-users) to ensure members of a shared group only have access to certain files.
63+
</div>
5664

5765
For example, to add the user `magento_user` to the `apache` primary group on CentOS:
5866

59-
usermod -g apache magento_user
67+
usermod -a -G apache magento_user
6068

6169
To confirm your Magento user is a member of the web server group, enter the following command:
6270

63-
groups <user name>
71+
groups magento_user
72+
73+
The following sample result shows the user's primary (`magento`) and secondary (`apache`) groups.
6474

65-
A sample result follows:
75+
magento_user : magento_user apache
6676

67-
magento_user : apache
77+
<div class="bs-callout bs-callout-info" id="info" markdown="1">
78+
Typically, the user name and primary group name are the same.
79+
</div>
6880

6981
To complete the task, restart the web server:
7082

@@ -96,4 +108,4 @@ To set ownership and permissions before you install the Magento software:
96108
After you have set file system ownership and permissions, continue with any of the following:
97109

98110
* [Command-line installation]({{page.baseurl}}install-gde/install/cli/install-cli.html)
99-
* [Setup Wizard installation]({{page.baseurl}}install-gde/install/web/install-web.html)
111+
* [Setup Wizard installation]({{page.baseurl}}install-gde/install/web/install-web.html)

0 commit comments

Comments
 (0)