Skip to content

Commit 78ce3e9

Browse files
committed
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
1 parent 01965cc commit 78ce3e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ If there are any issues, correct them now before moving on.
243243
$ rm -rf app/cache/*
244244
$ rm -rf app/logs/*
245245
246-
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
246+
$ 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`
247247
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
248248
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
249249
@@ -258,7 +258,7 @@ If there are any issues, correct them now before moving on.
258258

259259
.. code-block:: bash
260260
261-
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
261+
$ 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`
262262
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
263263
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
264264

0 commit comments

Comments
 (0)