Skip to content

Commit d93958a

Browse files
committed
Merge branch '2.0' into 2.1
2 parents 6467fdc + e2dd34c commit d93958a

File tree

3 files changed

+37
-26
lines changed

3 files changed

+37
-26
lines changed

book/installation.rst

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,29 @@ If there are any issues, correct them now before moving on.
214214
must be writable both by the web server and the command line user. On
215215
a UNIX system, if your web server user is different from your command
216216
line user, you can run the following commands just once in your project
217-
to ensure that permissions will be setup properly. Change ``www-data``
218-
to your web server user:
217+
to ensure that permissions will be setup properly.
218+
219+
**Note that not all web servers run as the user** ``www-data`` as in the examples
220+
below. Instead, check which user *your* web server is being run as and
221+
use it place of ``www-data``.
222+
223+
On a UNIX system, this can be done with one of the following commands:
224+
225+
.. code-block:: bash
226+
227+
$ ps aux | grep httpd
228+
229+
or
230+
231+
.. code-block:: bash
232+
233+
$ ps aux | grep apache
219234
220235
**1. Using ACL on a system that supports chmod +a**
221236

222237
Many systems allow you to use the ``chmod +a`` command. Try this first,
223-
and if you get an error - try the next method:
238+
and if you get an error - try the next method. Be sure to replace ``www-data``
239+
with your web server user on the first ``chmod`` command:
224240

225241
.. code-block:: bash
226242
@@ -229,7 +245,7 @@ If there are any issues, correct them now before moving on.
229245
230246
$ sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
231247
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
232-
248+
233249
**2. Using Acl on a system that does not support chmod +a**
234250

235251
Some systems don't support ``chmod +a``, but do support another utility
@@ -242,11 +258,6 @@ If there are any issues, correct them now before moving on.
242258
$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
243259
$ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
244260
245-
Note that not all web servers run as the user ``www-data``. You have to
246-
check which user the web server is being run as and put it in for ``www-data``.
247-
This can be done by checking your process list to see which user is running
248-
your web server processes.
249-
250261
**3. Without using ACL**
251262

252263
If you don't have access to changing the ACL of the directories, you will

book/security.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -780,27 +780,27 @@ Take the following ``access_control`` entries as an example:
780780
security:
781781
# ...
782782
access_control:
783-
- { path: ^/user, roles: ROLE_USER_IP, ip: 127.0.0.1 }
784-
- { path: ^/user, roles: ROLE_USER_HOST, host: symfony.com }
785-
- { path: ^/user, roles: ROLE_USER_METHOD, methods: [POST, PUT] }
786-
- { path: ^/user, roles: ROLE_USER }
783+
- { path: ^/admin, roles: ROLE_USER_IP, ip: 127.0.0.1 }
784+
- { path: ^/admin, roles: ROLE_USER_HOST, host: symfony.com }
785+
- { path: ^/admin, roles: ROLE_USER_METHOD, methods: [POST, PUT] }
786+
- { path: ^/admin, roles: ROLE_USER }
787787
788788
.. code-block:: xml
789789
790790
<access-control>
791-
<rule path="^/user" role="ROLE_USER_IP" ip="127.0.0.1" />
792-
<rule path="^/user" role="ROLE_USER_HOST" host="symfony.com" />
793-
<rule path="^/user" role="ROLE_USER_METHOD" method="POST, PUT" />
794-
<rule path="^/user" role="ROLE_USER" />
791+
<rule path="^/admin" role="ROLE_USER_IP" ip="127.0.0.1" />
792+
<rule path="^/admin" role="ROLE_USER_HOST" host="symfony.com" />
793+
<rule path="^/admin" role="ROLE_USER_METHOD" method="POST, PUT" />
794+
<rule path="^/admin" role="ROLE_USER" />
795795
</access-control>
796796
797797
.. code-block:: php
798798
799799
'access_control' => array(
800-
array('path' => '^/user', 'role' => 'ROLE_USER_IP', 'ip' => '127.0.0.1'),
801-
array('path' => '^/user', 'role' => 'ROLE_USER_HOST', 'host' => 'symfony.com'),
802-
array('path' => '^/user', 'role' => 'ROLE_USER_METHOD', 'method' => 'POST, PUT'),
803-
array('path' => '^/user', 'role' => 'ROLE_USER'),
800+
array('path' => '^/admin', 'role' => 'ROLE_USER_IP', 'ip' => '127.0.0.1'),
801+
array('path' => '^/admin', 'role' => 'ROLE_USER_HOST', 'host' => 'symfony.com'),
802+
array('path' => '^/admin', 'role' => 'ROLE_USER_METHOD', 'method' => 'POST, PUT'),
803+
array('path' => '^/admin', 'role' => 'ROLE_USER'),
804804
),
805805
806806
For each incoming request, Symfony will decided which ``access_control``
@@ -904,18 +904,18 @@ given prefix, ``/esi``, from outside access:
904904
Here is how it works when the path is ``/esi/something`` coming from the
905905
``10.0.0.1`` IP:
906906

907-
* The first access control rule does not match and is ignored as the ``path``
908-
matches but the ``ip`` does not;
907+
* The first access control rule is ignored as the ``path`` matches but the
908+
``ip`` does not;
909909

910-
* The second access control rule matches (the only restriction being the
910+
* The second access control rule is enabled (the only restriction being the
911911
``path`` and it matches): as the user cannot have the ``ROLE_NO_ACCESS``
912912
role as it's not defined, access is denied (the ``ROLE_NO_ACCESS`` role can
913913
be anything that does not match an existing role, it just serves as a trick
914914
to always deny access).
915915

916916
Now, if the same request comes from ``127.0.0.1``:
917917

918-
* Now, the first access control rule does match as both the ``path`` and the
918+
* Now, the first access control rule is enabled as both the ``path`` and the
919919
``ip`` match: access is allowed as the user always has the
920920
``IS_AUTHENTICATED_ANONYMOUSLY`` role.
921921

reference/dic_tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ channel when injecting the logger in a service.
385385
386386
$definition = new Definition('Fully\Qualified\Loader\Class\Name', array(new Reference('logger'));
387387
$definition->addTag('monolog.logger', array('channel' => 'acme'));
388-
$container->register('my_service', $definition);;
388+
$container->register('my_service', $definition);
389389
390390
.. note::
391391

0 commit comments

Comments
 (0)