0

I am facing this issue on my nginx setup on ubuntu 13.10 I got these weird error on the log of my local domain

2014/04/06 21:29:37 [crit] 18065#0: *3 stat() "/media/user/Backup/Sites/sp/" failed (13: Permission denied), client: 127.0.0.1, server: sp.local, request: "GET / HTTP/1.1", host: "sp.local"
2014/04/06 21:29:37 [crit] 18065#0: *3 stat() "/media/user/Backup/Sites/sp/" failed (13: Permission denied), client: 127.0.0.1, server: sp.local, request: "GET / HTTP/1.1", host: "sp.local"
2014/04/06 21:29:37 [crit] 18065#0: *3 stat() "/media/user/Backup/Sites/sp/index.php" failed (13: Permission denied), client: 127.0.0.1, server: sp.local, request: "GET / HTTP/1.1", host: "sp.local"

this configuration was working before upgrading to this version 13.10

the permissions on this folder is : 755 & there is no log recorded on php fpm error log

I had did every idea to fix it with no luck could you please suggest / help me , It would be appreciated
Thanks

update:

  • I am not using SElinux
  • the files are located in non encrypted drive
  • nginx is installed on encrypted drive / , is this the issue ??

Relevant mount point:

/dev/sda3 on /media/tawfek/Backup type ext4 (rw,nosuid,nodev,uhelper=udisks2)

ls -l output :

total 712
drwsr-xr-x  6 tawfek tawfek   4096 Apr  6 21:26 app
drwsr-xr-x  8 tawfek tawfek   4096 Apr  6 21:26 downloader
drwsr-xr-x  3 tawfek tawfek   4096 Apr  6 21:25 errors
drwsr-xr-x  2 tawfek tawfek   4096 Apr  6 21:26 includes
drwsr-xr-x 15 tawfek tawfek   4096 Apr  6 21:25 js
drwsr-xr-x 13 tawfek tawfek   4096 Apr  6 21:25 lib
drwsr-xr-x 13 tawfek tawfek   4096 Apr  6 21:26 media
drwsr-xr-x  3 tawfek tawfek   4096 Apr  6 21:25 nbproject
drwsr-xr-x  2 tawfek tawfek   4096 Mar  8 13:10 pear
drwsr-xr-x  2 tawfek tawfek   4096 Apr  6 21:25 pkginfo
drwsr-xr-x  2 tawfek tawfek   4096 Apr  6 21:25 shell
drwsr-xr-x  5 tawfek tawfek   4096 Apr  6 21:25 skin
drwsr-xr-x 11 tawfek tawfek   4096 Apr  6 21:25 var
-rwxr-xr-x  1 tawfek tawfek   2834 Feb  1 11:39 api.php
-rwxr-xr-x  1 tawfek tawfek   2831 Feb  1 11:39 cron.php
-rwxr-xr-x  1 tawfek tawfek    716 Mar 24 22:38 cron.sh
-rwxr-xr-x  1 tawfek tawfek   1150 Feb  1 11:39 favicon.ico
-rwxr-xr-x  1 tawfek tawfek   5979 Feb  1 11:39 get.php
-rwxr-xr-x  1 tawfek tawfek   2673 Apr  6 22:17 index.php
-rwxr-xr-x  1 tawfek tawfek   2366 Feb  1 11:39 index.php.sample
-rwxr-xr-x  1 tawfek tawfek   6441 Feb  1 11:39 install.php
-rwxr-xr-x  1 tawfek tawfek  10421 Feb  1 11:39 LICENSE_AFL.txt
-rwxr-xr-x  1 tawfek tawfek  10679 Feb  1 11:39 LICENSE.html
-rwxr-xr-x  1 tawfek tawfek  10410 Feb  1 11:39 LICENSE.txt
-rwxr-xr-x  1 tawfek tawfek   1319 Feb  1 11:39 mage
-rwxr-xr-x  1 tawfek tawfek    886 Feb  1 11:39 php.ini.sample
-rwxr-xr-x  1 tawfek tawfek    478 Feb 17 19:08 php.php
-rwxr-xr-x  1 tawfek tawfek 585086 Feb  1 11:39 RELEASE_NOTES.txt
  • perhaps, You are using selinux? – xiaodongjie Apr 9 '14 at 6:12
  • What effect it has on site? Also, please add output of ls -l /media/user/Backup/Sites/sp/. – Danatela Apr 10 '14 at 5:11
  • What is the output of sudo mount? – Braiam Apr 10 '14 at 5:19
  • @Braiam I just updated the question with info from this chatroom. – Danatela Apr 10 '14 at 5:29
  • And from which user do you start nginx? – Danatela Apr 13 '14 at 7:18
0

I don't know if my solution will work, just give it a try.

Probably, your nginx version is outdated.

# apt-cache policy nginx
nginx:
  Installed: 1.4.1-3ubuntu1.3
  Candidate: 1.5.12-1+saucy0
  Version table:
     1.5.12-1+saucy0 0
        500 http://ppa.launchpad.net/nginx/development/ubuntu/ saucy/main amd64 Packages
 *** 1.4.1-3ubuntu1.3 0
        500 http://security.ubuntu.com/ubuntu/ saucy-security/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu/ saucy-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     1.4.1-3ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ saucy/universe amd64 Packages

To install the latest version, you need to add Nginx's team PPA

sudo add-apt-repository ppa:nginx/development
sudo apt-get update
sudo apt-get upgrade

If it will not work, the problem will be resolved in next Ubuntu release (14.04), which will come soon (April, 17th).

May be Nginx expects owner of /media/user/Backup/Sites/sp/ to be www-data. To change:

sudo chown -R www-data:www-data /media/user/Backup/Sites/sp/

If the one of those solutions work, please reply which.

| improve this answer | |
0

After a lot of searching with no luck , I backed up my data , removed the encryption from the drive and restore my data , every thing worked as expected

please note that encryptfs was the issue , I can't give detailed / technical explanation but that fixed it

| improve this answer | |
0

在 Ubuntu 14.04 裡,若將 nginx 的 root (Apache`s DocumentRoot) 指到 /media/USERNAME/ 底下也會發生此問題,所以最後在下改掛載其它路徑以避開此問題。

If we nginx`s root (like DocomentRoot of Apache) is setting to under the /media/USERNAME on Ubuntu 14.04, we will has the some problem, so My solutiom is mount other path to workaround.


My environment

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty

$ nginx -v
nginx version: nginx/1.6.2

$ ls -l /media/
total 8
drwxr-xr-x  19 jonny jonny 4096 Sep 25 18:17 data
drwxr-xr--+  3 jonny jonny 4096 Sep 23 17:01 jonny
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.