Nginx 13:Permision Denied

Discussion in 'VPS (Virtual Private Server)' started by heru nugroho, 1 Dec 2014.

Thread Status:
Not open for further replies.
  1. heru nugroho

    heru nugroho Beginner 2.0

    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    Siang Master,
    Langsung aja ke error log nginx saya :D

    Code:
    2014/12/01 13:54:31 [error] 3594#0: *1 open() "/home/heru/pub_html/index.php" failed (13: Permission denied), client: 10.10.6.142, server: nheru.me, request: "GET /index.php HTTP/1.1", host: "nheru.me"
    /etc/nginx/nginx.conf
    Code:
    user  nginx;
    worker_processes  1;
    
    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
        access_log  /var/log/nginx/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        keepalive_timeout  65;
    
        #gzip  on;
    
        include /etc/nginx/conf.d/*.conf;
    }
    /etc/nginx/conf.d/nheru.me.conf
    Code:
    server {
        listen       80;
        server_name  nheru.me;
    
        #charset koi8-r;
        access_log  /var/log/nginx/log/heru.me.access.log  main;
        error_log   /var/log/nginx/log/heru.me.error.log;
        location / {
            root   /home/heru/pub_html;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /home/heru/pub_html;
        }
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /home/heru/pub_html$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
    namei -l /home/heru/pub_html/index.html
    Code:
    f: /home/heru/pub_html/index.html
    dr-xr-xr-x root root /
    drwxr-xr-x root root home
    drwxr-xr-x heru heru heru
    drwxr-xr-x heru heru pub_html
    -rw-r--r-- heru heru index.html
    
    Mohon bantuannya :D
     
  2. mustafaramadhan

    mustafaramadhan Hosting Guru

    Messages:
    3,237
    Likes Received:
    857
    Trophy Points:
    113
    Sesuaikan ownership dan atau permissions dari directory terkait.
     
  3. heru nugroho

    heru nugroho Beginner 2.0

    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    Harus disesuaikan seperti apa lagi?
    Sepertinya sudah sesuai.
     
  4. mustafaramadhan

    mustafaramadhan Hosting Guru

    Messages:
    3,237
    Likes Received:
    857
    Trophy Points:
    113
    Yang '/home/heru/pub_html/index.php' bagaimana?.
     
  5. linboxs

    linboxs New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Dari error message nya sih dah kelihatan kalau ada request ke file /home/heru/pub_html/index.php :)
    Coba di cek lagi apakah file tersebut ada dan bagaimana ownershipnya :)
     
  6. heru nugroho

    heru nugroho Beginner 2.0

    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    Ownershipnya gini mas
    Code:
    f: /home/heru/pub_html/index.html
    dr-xr-xr-x root root /
    drwxr-xr-x root root home
    drwxr-xr-x heru heru heru
    drwxr-xr-x heru heru pub_html
    -rw-r--r-- heru heru index.html
     
  7. mustafaramadhan

    mustafaramadhan Hosting Guru

    Messages:
    3,237
    Likes Received:
    857
    Trophy Points:
    113
    Yang jadi masalah adalah '/home/heru/pub_html/index.php' sedangkan dari list file tersebut tidak terlihat. Ini masalahnya.
     
  8. heru nugroho

    heru nugroho Beginner 2.0

    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    saya coba /home/heru/pub_html/index.html pun sama saja. muncul pesan error yang sama :(
     
  9. mustafaramadhan

    mustafaramadhan Hosting Guru

    Messages:
    3,237
    Likes Received:
    857
    Trophy Points:
    113
    Kecuali tidak ada masalah lain, ini saya bandingkan dengan directory punya saya (pakai Kloxo-MR):

    > namei -l /home/anzip/anzi-pacific.com/index.html
    Code:
    f: /home/anzip/anzi-pacific.com/index.html
    drwxr-xr-x apache apache /
    drwxr-xr-x root root home
    drwxr-x--x anzip apache anzip
    drwxr-xr-x anzip apache anzi-pacific.com
    -rw-r--r-- anzip anzip index.html
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...