From 78ce3e96fb8b83bb0bbe5a131e628ae070847551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20L=C3=A9v=C3=AAque?= Date: Mon, 17 Aug 2015 14:32:51 +0200 Subject: [PATCH] Fix the way we found the apache/nginx user If you have another web server like tomcat on your server, the previous command end up returning tomcat instead of apache. Previously we looked at the whole line, now only at the user and the command name --- book/installation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/installation.rst b/book/installation.rst index 95644e0f7fb..e8374ae0fbc 100644 --- a/book/installation.rst +++ b/book/installation.rst @@ -243,7 +243,7 @@ If there are any issues, correct them now before moving on. $ rm -rf app/cache/* $ rm -rf app/logs/* - $ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` + $ 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" app/cache app/logs $ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs @@ -258,7 +258,7 @@ If there are any issues, correct them now before moving on. .. code-block:: bash - $ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` + $ 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 app/cache app/logs $ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs