From f18a1aac9a1aaab01b19d589a452f2208bd2d4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Tue, 12 Jan 2016 15:38:32 +0100 Subject: [PATCH 1/2] Update directory permissions to make var/ writable Simplifies the directory permission commands to make sure: - session folder is writable - other custom var/ sub folders are writeable, typically data / storage / upload folder needed cms/crm/ecommerce/pim/.. systems built on top of symfony, avoiding that these projects needs to have own conflicting documentation on this Closes #6132 --- book/installation.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/book/installation.rst b/book/installation.rst index 54ce48ec930..2c467e59f27 100644 --- a/book/installation.rst +++ b/book/installation.rst @@ -220,9 +220,9 @@ If there are any issues, correct them now before moving on. .. sidebar:: Setting up Permissions - One common issue when installing Symfony is that the ``var/cache`` and - ``var/logs`` directories must be writable both by the web server and the - command line user. On a UNIX system, if your web server user is different + One common issue when installing Symfony is that the ``var/cache``, ``var/logs`` + and ``var/sessions`` directories must be writable both by the web server and + the command line user. On a UNIX system, if your web server user is different from your command line user, you can try one of the following solutions. **1. Use the same user for the CLI and the web server** @@ -242,12 +242,11 @@ If there are any issues, correct them now before moving on. .. code-block:: bash - $ rm -rf var/cache/* - $ rm -rf var/logs/* + $ rm -rf var/cache/* var/logs/* var/sessions/* $ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` - $ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs - $ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs + $ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var + $ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var **3. Using ACL on a system that does not support chmod +a** @@ -261,8 +260,8 @@ If there are any issues, correct them now before moving on. .. code-block:: bash $ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` - $ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var/cache var/logs - $ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var/cache var/logs + $ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var + $ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var If this doesn't work, try adding ``-n`` option. From d6456ad165af7bb669a3dda098b77070758d3df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Tue, 12 Jan 2016 16:45:41 +0100 Subject: [PATCH 2/2] Update dir permissions to reflect var being writable --- book/installation.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/installation.rst b/book/installation.rst index 2c467e59f27..613c83c6e33 100644 --- a/book/installation.rst +++ b/book/installation.rst @@ -220,10 +220,10 @@ If there are any issues, correct them now before moving on. .. sidebar:: Setting up Permissions - One common issue when installing Symfony is that the ``var/cache``, ``var/logs`` - and ``var/sessions`` directories must be writable both by the web server and - the command line user. On a UNIX system, if your web server user is different - from your command line user, you can try one of the following solutions. + One common issue when installing Symfony is that the ``var`` directory must + be writable both by the web server and the command line user. On a UNIX + system, if your web server user is different from your command line user + who owns the files, you can try one of the following solutions. **1. Use the same user for the CLI and the web server**