# Permission Denied Error

**URL:** <https://www.ruby-forum.com/t/permission-denied-error/219094>\
**Category:** NGINX\
**Created:** [April 20, 2012, 1:58pm UTC](https://www.ruby-forum.com/t/permission-denied-error/219094 "2012-04-20T13:58:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [April 20, 2012, 1:58pm UTC](https://www.ruby-forum.com/t/permission-denied-error/219094/1 "2012-04-20T13:58:36Z")

</div>

I am seeing some error like below in my nginx error log:

2012/04/20 11:51:52 [crit] 21437#0: \*2548 open()  
“/var/cache/nginx/fastcgi\_temp/5/00/0000000005” failed (13: Permission  
denied) while reading upstream, client: 139.112.144.210, server:  
[example.com](http://example.com),  
request: “GET /index.php HTTP/1.0”, upstream:  
“fastcgi://127.0.0.1:9000”,  
host: “[example.com](http://example.com)”, referrer: “[http://example.com/](http://example.com/)”

I have: user www-data; in my nginx.conf and  
the owners of the /var/cache/nginx/fastcgi\_temp/5/00 are ‘nginx:nginx’

How can I fix this?

Thanks  
Sparsh G.

---

<div class="post-metadata">

**Author:** ![Sparsh\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@Sparsh\_G](https://www.ruby-forum.com/u/Sparsh_G)\
**Post date:** [April 20, 2012, 3:06pm UTC](https://www.ruby-forum.com/t/permission-denied-error/219094/2 "2012-04-20T15:06:53Z")

</div>

Hello!

On Fri, Apr 20, 2012 at 05:27:40PM +0530, Sparsh G. wrote:

> How can I fix this?

With chown(1), see “man chown” for details.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Sparsh\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@Sparsh\_G](https://www.ruby-forum.com/u/Sparsh_G)\
**Post date:** [April 22, 2012, 12:29am UTC](https://www.ruby-forum.com/t/permission-denied-error/219094/3 "2012-04-22T00:29:08Z")

</div>

On Sat, 2012-04-21 at 00:27 +0530, Sparsh G. wrote:

> My concern was that when I have user www-data; mentioned in my config  
> file, why is nginx creating files for fastcgi\_temp with user nginx and  
> group nginx

Probably they were created before you changed the nginx config file  
settings.

Cliff

---

<div class="post-metadata">

**Author:** ![Sparsh\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@Sparsh\_G](https://www.ruby-forum.com/u/Sparsh_G)\
**Post date:** [April 20, 2012, 8:58pm UTC](https://www.ruby-forum.com/t/permission-denied-error/219094/4 "2012-04-20T20:58:34Z")

</div>

My concern was that when I have user www-data; mentioned in my config  
file,  
why is nginx creating files for fastcgi\_temp with user nginx and group  
nginx

I understand thats the default user:group while compiling was  
nginx:nginx  
but shouldn’t they be overridden by the option provided in nginx runtime  
configuration file?

Sparsh G.

---

<div class="post-metadata">

**Author:** ![Sparsh\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@Sparsh\_G](https://www.ruby-forum.com/u/Sparsh_G)\
**Post date:** [April 22, 2012, 12:33am UTC](https://www.ruby-forum.com/t/permission-denied-error/219094/5 "2012-04-22T00:33:27Z")

</div>

Hello!

On Sat, Apr 21, 2012 at 12:27:40AM +0530, Sparsh G. wrote:

> My concern was that when I have user www-data; mentioned in my config file,  
> why is nginx creating files for fastcgi\_temp with user nginx and group nginx
> 
> I understand thats the default user:group while compiling was nginx:nginx  
> but shouldn’t they be overridden by the option provided in nginx runtime  
> configuration file?

They are overriden. But if you change user/group set in config you  
have to fix permissions on already created subdirs (or just remove  
them, nginx will re-create them with correct permissions).

Maxim D.

> > > I am seeing some error like below in my nginx error log:  
> > > the owners of the /var/cache/nginx/fastcgi\_temp/5/00 are ‘nginx:nginx’  
> > > [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)
