summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_unixd.xml
blob: 656f38a1ac9cae04bd0c9009097f48fb6a729967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
<!-- $LastChangedRevision$ -->

<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<modulesynopsis metafile="mod_unixd.xml.meta">

<name>mod_unixd</name>
<description>Basic (required) security for Unix-family platforms.</description>
<status>Base</status>
<sourcefile>mod_unixd.c</sourcefile>
<identifier>unixd_module</identifier>

<seealso><a href="../suexec.html">suEXEC support</a></seealso>

<directivesynopsis>
<name>Group</name>
<description>Group under which the server will answer
requests</description>
<syntax>Group <var>unix-group</var></syntax>
<default>Group #-1</default>
<contextlist><context>server config</context></contextlist>

<usage>
    <p>The <directive>Group</directive> directive sets the group under
    which the server will answer requests. In order to use this
    directive, the server must be run initially as <code>root</code>. If
    you start the server as a non-root user, it will fail to change to the
    specified group, and will instead continue to run as the group of the
    original user. <var>Unix-group</var> is one of:</p>

    <dl>
      <dt>A group name</dt>
      <dd>Refers to the given group by name.</dd>

      <dt><code>#</code> followed by a group number.</dt>
      <dd>Refers to a group by its number.</dd>
    </dl>

    <example><title>Example</title>
    <highlight language="config">
      Group www-group
      </highlight>
    </example>

    <p>It is recommended that you set up a new group specifically for
    running the server.  If the configured <directive>User</directive>
    is a member of any supplementary groups, the process will also
    become a member of these groups.</p>

    <note type="warning"><title>Security</title>
      <p>Don't set <directive>Group</directive> (or <directive
      module="mod_unixd">User</directive>) to <code>root</code> unless
      you know exactly what you are doing, and what the dangers are.
      It is not recommended to use the group <code>nobody</code>,
      which is not intended for use by long-running daemons.</p>
    </note>

</usage>
<seealso><directive module="mod_privileges">VHostGroup</directive></seealso>
<seealso><directive module="mod_suexec">SuexecUserGroup</directive></seealso>
</directivesynopsis>

<directivesynopsis>
<name>User</name>
<description>The userid under which the server will answer
requests</description>
<syntax>User <var>unix-userid</var></syntax>
<default>User #-1</default>
<contextlist><context>server config</context></contextlist>

<usage>
    <p>The <directive>User</directive> directive sets the user ID as
    which the server will answer requests. In order to use this
    directive, the server must be run initially as <code>root</code>.
    If you start the server as a non-root user, it will fail to change
    to the lesser privileged user, and will instead continue to run as
    that original user. If you do start the server as <code>root</code>,
    then it is normal for the parent process to remain running as root.
    <var>Unix-userid</var> is one of:</p>

    <dl>
      <dt>A username</dt>
      <dd>Refers to the given user by name.</dd>

      <dt># followed by a user number.</dt>
      <dd>Refers to a user by its number.</dd>
    </dl>

    <p>The user should have no privileges that result in it being
    able to access files that are not intended to be visible to the
    outside world, and similarly, the user should not be able to
    execute code that is not meant for HTTP requests. It is
    recommended that you set up a new user and group specifically for
    running the server.</p>

    <note type="warning"><title>Security</title>
      <p>Don't set <directive>User</directive> (or <directive
      module="mod_unixd">Group</directive>) to <code>root</code> unless
      you know exactly what you are doing, and what the dangers are.
      It is not recommended to use the user <code>nobody</code>,
      which is not intended for use by long-running daemons.</p>
    </note>

</usage>
<seealso><directive module="mod_privileges">VHostUser</directive></seealso>
<seealso><directive module="mod_suexec">SuexecUserGroup</directive></seealso>
</directivesynopsis>

<directivesynopsis>
<name>ChrootDir</name>
<description>Directory for apache to run chroot(8) after startup.</description>
<syntax>ChrootDir <var>/path/to/directory</var></syntax>
<default>none</default>
<contextlist><context>server config</context></contextlist>
<modulelist><module>mod_unixd</module></modulelist>

<usage>
    <p>This directive tells the server to <var>chroot(8)</var> to the
    specified directory after startup, but before accepting requests
    over the 'net.</p>
    <p>Note that running the server under chroot is not simple,
    and requires additional setup, particularly if you are running
    scripts such as CGI or PHP.  Please make sure you are properly
    familiar with the operation of chroot before attempting to use
    this feature.</p>
</usage>
</directivesynopsis>

<directivesynopsis>
<name>Suexec</name>
<description>Enable or disable the suEXEC feature</description>
<syntax>Suexec On|Off</syntax>
<default>On if suexec binary exists with proper owner and mode,
Off otherwise</default>
<contextlist><context>server config</context></contextlist>

<usage>
    <p>When On, startup will fail if the suexec binary doesn't exist
    or has an invalid owner or file mode.</p>
    <p>When Off, suEXEC will be disabled even if the suexec binary exists
    and has a valid owner and file mode.</p>
</usage>
</directivesynopsis>

</modulesynopsis>