Answers.Body: <p>Is your webserver running as user 'nobody'?  You have something running as root that is causing the cache to be rebuilt - like using <code>cv</code> as root.  Are your cron scheduled jobs running as root?</p>
  <p>You have two basic approaches: either get everything that causes a rebuild to run as the webserver user ('nobody'), or arrange for all the users to have access to the cache directory.</p>
  <p>One option for doing that is using Linux file ACL's with <a href="https://manpages.ubuntu.com/manpages/kinetic/man1/setfacl.1.html" rel="nofollow noreferrer">setfacl</a>.  You can look at how <code>buildkit</code> uses <code>setfacl</code> for an example, but there's nothing Civi-specific.</p>
  <p>Something like this should ensure your webserver user has access to the cache files:</p>
  <pre><code>$ setfacl -R -m d:u:nobody:rwX,u:nobody:rwX cache_dir
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-17T10:04:01.817Z
Answers.Text: Hello Aidan, Thank you for your quick and detailed response and your time. I will try to sort out the server permissions.
Answers.UserDisplayName: Evan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-16T09:11:18.777Z
Answers.LastActivityDate: 2022-11-16T09:11:18.777Z
Answers.UserDisplayName: Aidan
Body: <p>I am having problems with the permissions of the cache folder. Once I reset the permissions to Nobody everything works just fine but when a new cache file is created it uses the root user and certain CiviCRM pages do not load because of that (ex. the contact search). Is there a way to define or force the user to be &quot;nobody&quot;?</p>
  <p>Thank you in advance.</p>
  
Tags: <wordpress>
Title: Issue with Permissions inside cache folder
ThreadText: # Issue with Permissions inside cache folder
  
  (Asked by: username_0 on 2022-11-15)
  
  I am having problems with the permissions of the cache folder. Once I reset the permissions to Nobody everything works just fine but when a new cache file is created it uses the root user and certain CiviCRM pages do not load because of that (ex. the contact search). Is there a way to define or force the user to be "nobody"?
  
  Thank you in advance.
  
  **Tags:** wordpress
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-11-16. Score: 0
  
  Is your webserver running as user 'nobody'?  You have something running as root that is causing the cache to be rebuilt - like using cv as root.  Are your cron scheduled jobs running as root?
  You have two basic approaches: either get everything that causes a rebuild to run as the webserver user ('nobody'), or arrange for all the users to have access to the cache directory.
  One option for doing that is using Linux file ACL's with setfacl.  You can look at how buildkit uses setfacl for an example, but there's nothing Civi-specific.
  Something like this should ensure your webserver user has access to the cache files:
  $ setfacl -R -m d:u:nobody:rwX,u:nobody:rwX cache_dir
  
  > **Comments:**
  > **username_0**: Hello username_1, Thank you for your quick and detailed response and your time. I will try to sort out the server permissions.  
  
  ---
  
  