@@ -219,41 +219,27 @@ If there are any issues, correct them now before moving on.
219219
220220..sidebar ::Setting up Permissions
221221
222+
222223 One common issue is that the ``app/cache `` and ``app/logs `` directories
223224 must be writable both by the web server and the command line user. On
224225 a UNIX system, if your web server user is different from your command
225226 line user, you can run the following commands just once in your project
226227 to ensure that permissions will be setup properly.
227228
228- **Note that not all web servers run as the user ** ``www-data `` as in the examples
229- below. Instead, check which user *your * web server is being run as and
230- use it in place of ``www-data ``.
231-
232- On a UNIX system, this can be done with one of the following commands:
233-
234- ..code-block ::bash
235-
236- $ ps aux| grep httpd
237-
238- or
239-
240- ..code-block ::bash
241-
242- $ ps aux| grep apache
243-
244229 **1. Using ACL on a system that supports chmod +a **
245230
246231 Many systems allow you to use the ``chmod +a `` command. Try this first,
247- and if you get an error - try the next method. Be sure to replace ``www-data ``
248- with your web server user on the first ``chmod `` command:
232+ and if you get an error - try the next method.
249233
250234 ..code-block ::bash
251235
252236 $ rm -rf app/cache/*
253237 $ rm -rf app/logs/*
254238
255- $ sudo chmod +a" www-data allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
256- $ sudo chmod +a" ` whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
239+ $ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1`
240+ $ sudo chmod +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
241+ $ sudo chmod +a "`whoami ` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
242+
257243
258244 **2. Using Acl on a system that does not support chmod +a **
259245
@@ -264,9 +250,10 @@ If there are any issues, correct them now before moving on.
264250
265251 ..code-block ::bash
266252
267- $ sudo setfacl -R -m u:www-data:rwX -m u:` whoami` :rwX app/cache app/logs
268- $ sudo setfacl -dR -m u:www-data:rwx -m u:` whoami` :rwx app/cache app/logs
269-
253+ $ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1`
254+ $ sudo setfacl -R -m u:$APACHEUSER:rwX -m u: `whoami `:rwX app/cache app/logs
255+ $ sudo setfacl -dR -m u:$APACHEUSER:rwX -m u: `whoami `:rwX app/cache app/logs
256+
270257 **3. Without using ACL **
271258
272259 If you don't have access to changing the ACL of the directories, you will