Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-05-16, 18:41:10

Author Topic: nginx user cannot stat folders  (Read 3587 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
nginx user cannot stat folders
« on: 2015-09-21, 11:34:16 »
Please see:

Quote
2015/09/21 11:38:41 [crit] 9054#9054: *2494971 stat() "/home/v-art/portal/game/news_images/20150921/1442828280_1202_small.jpg" failed (13: Permission denied), client: 77.65.80.246, server: game.grupx.pl, request: "GET /news_images/20150921/1442828280_1202_small.jpg HTTP/1.1", host: "game.grupx.pl", referrer: "http://game.grupx.pl/"
2015/09/21 11:38:41 [crit] 9054#9054: *2494971 stat() "/home/v-art/portal/game/news_images/20150921/1442828280_1202_small.jpg" failed (13: Permission denied), client: 77.65.80.246, server: game.grupx.pl, request: "GET /news_images/20150921/1442828280_1202_small.jpg HTTP/1.1", host: "game.grupx.pl", referrer: "http://game.grupx.pl/"
2015/09/21 11:38:41 [crit] 9054#9054: *2494976 stat() "/home/v-art/portal/game/news_images/20150921/1442828282_8351_small.jpg" failed (13: Permission denied), client: 77.65.80.246, server: game.grupx.pl, request: "GET /news_images/20150921/1442828282_8351_small.jpg HTTP/1.1", host: "game.grupx.pl", referrer: "http://game.grupx.pl/"
2015/09/21 11:38:41 [crit] 9054#9054: *2494976 stat() "/home/v-art/portal/game/news_images/20150921/1442828282_8351_small.jpg" failed (13: Permission denied), client: 77.65.80.246, server: game.grupx.pl, request: "GET /news_images/20150921/1442828282_8351_small.jpg HTTP/1.1", host: "game.grupx.pl", referrer: "http://game.grupx.pl/"
2015/09/21 11:38:41 [crit] 9054#9054: *2494974 stat() "/home/v-art/portal/game/news_images/20150921/1442828285_0006_small.jpg" failed (13: Permission denied), client: 77.65.80.246, server: game.grupx.pl, request: "GET /news_images/20150921/1442828285_0006_small.jpg HTTP/1.1", host: "game.grupx.pl", referrer: "http://game.grupx.pl/"
2015/09/21 11:38:41 [crit] 9054#9054: *2494974 stat() "/home/v-art/portal/game/news_images/20150921/1442828285_0006_small.jpg" failed (13: Permission denied), client: 77.65.80.246, server: game.grupx.pl, request: "GET /news_images/20150921/1442828285_0006_small.jpg HTTP/1.1", host: "game.grupx.pl", referrer: "http://game.grupx.pl/"

Quote
[root@online conf.d]# sudo -u nginx stat /home/v-art/portal
stat: cannot stat `/home/v-art/portal': Permission denied

[root@online conf.d]# sudo -u apache stat /home/v-art/portal
  File: `/home/v-art/portal'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 904h/2308d      Inode: 62133914    Links: 15
Access: (0755/drwxr-xr-x)  Uid: ( 2508/   v-art)   Gid: ( 2508/   v-art)
Access: 2015-07-21 07:13:29.086943899 +0200
Modify: 2012-11-23 03:33:42.000000000 +0100
Change: 2015-07-21 07:13:29.086943899 +0200

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx user cannot stat folders
« Reply #1 on: 2015-09-21, 12:21:29 »
What's about if running fix-chownchmod?.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginx user cannot stat folders
« Reply #2 on: 2015-09-21, 19:11:57 »
What's about if running fix-chownchmod?.

Does not help - it will only work if nginx is able to access the directory. So we might have to add nginx user to apache group.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginx user cannot stat folders
« Reply #3 on: 2015-09-22, 11:55:42 »
Quick fix:

usermod -a -G apache nginx

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx user cannot stat folders
« Reply #4 on: 2015-09-22, 12:11:06 »
If website under 'user1', what's happen if running 'usermod -a G user1 nginx'? (that mean directory ownership still under 'user1').
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: nginx user cannot stat folders
« Reply #5 on: 2015-09-22, 19:31:48 »
If website under 'user1', what's happen if running 'usermod -a G user1 nginx'? (that mean directory ownership still under 'user1').

It will add nginx to user group - this should be added as well when creating a client ;)

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo

Page created in 0.081 seconds with 18 queries.

web stats analysis