Masalah Ownership Nginx

Discussion in 'Masalah Teknik dan Keamanan' started by mas.satriyo, 7 Nov 2015.

Thread Status:
Not open for further replies.
  1. mas.satriyo

    mas.satriyo Expert 2.0

    Messages:
    961
    Likes Received:
    141
    Trophy Points:
    43
    kalo untuk buat konfigurasi ownership seperti di cpanel gimana ya?

    folder website milik user kan ada di folder "/home/namauser"
    itu ownership "user:group" nya apakah "namauser:www-data" atau "namauser:namauser" ?

    saya coba terapkan konfigurasi seperti ini di nginx
    root folder website = root folder user ( "/home/namauser/website" )
    ownershipnya = namauser:www-data
    "namauser" sudah ditambahkan ke group "www-data"
    di nginx.conf , variabel user = ( "user namauser www-data; ")

    tapi begitu website diakses, muncul error
    "Permission Error - /home/namauser directory must be writable".

    trims
     
  2. junior riau

    junior riau Hosting Guru Web Hosting

    Messages:
    3,228
    Likes Received:
    515
    Trophy Points:
    113
  3. paijo2

    paijo2 Apprentice 1.0

    Messages:
    233
    Likes Received:
    30
    Trophy Points:
    28
    coba
    Code:
    ls -ald /home/namauser
    mode permissionnya apakah sudah 775 ?
     
  4. mas.satriyo

    mas.satriyo Expert 2.0

    Messages:
    961
    Likes Received:
    141
    Trophy Points:
    43
  5. junior riau

    junior riau Hosting Guru Web Hosting

    Messages:
    3,228
    Likes Received:
    515
    Trophy Points:
    113
    cpanel memakai apache with suexec + suphp
    public_html dia ownernya itu username:nobody dengan permission 750
    dan ada symlink www -> public_html dengan permission 777
    isi dalam public_html nya baru username:username
    apachenya running as nobody kan?
     
  6. mas.satriyo

    mas.satriyo Expert 2.0

    Messages:
    961
    Likes Received:
    141
    Trophy Points:
    43
    kalo untuk nginx gimana mas?
    nginx kalo "user" di nginx.conf diubah jadi "user nobody;" malah error

    nginx: [emerg] getgrnam("nobody") failed in /etc/nginx/nginx.conf:1
    nginx: configuration file /etc/nginx/nginx.conf test failed

    ini dimintanya untuk nginx mas
    apa harus pake nginxproxy?
     
  7. junior riau

    junior riau Hosting Guru Web Hosting

    Messages:
    3,228
    Likes Received:
    515
    Trophy Points:
    113
    saya si ga terlalu sama nginx jadi mungkin bantu searching


    Code:
    1. http://serverfault.com/questions/534497/why-do-nginx-process-run-with-user-nobody
    
    2. http://nginx.org/en/docs/http/ngx_http_userid_module.html
    
    3. http://nginx.org/en/docs/ngx_core_module.html#user
    
    define user nya bukan di nginx.conf spertinya pada vhost nya si website lihat link 1

    alternatif coba openlitespeed dan lighttpd

    CMIIW yah
     
  8. mustafaramadhan

    mustafaramadhan Hosting Guru

    Messages:
    3,237
    Likes Received:
    857
    Trophy Points:
    113
    Untuk nginx yang saya lakukan di Kloxo-MR:
    1. set 'user nginx;' (bisa juga 'user apache;') di /etc/nginx/nginx.conf
    2. Set ownership di /home/<user> dan /home/<user>/<domain> sebagai <user>:apache
    3. Set permission di /home/<user> dan /home/<user>/<domain> sebagai 751 (rentunya ini lebih secure daripada 777, 771 atau 755)
     
  9. paijo2

    paijo2 Apprentice 1.0

    Messages:
    233
    Likes Received:
    30
    Trophy Points:
    28
    lain ladang lain ilalang, hehe...

    saya jg masih awam process ownership dari apache baik suphp atau suexec , monggo dibabarkan bagi yg tahu...

    afaik, itu berhubungan dg php-fpm nya, contoh di production saya:


    konfig nginx
    Code:
    user walipitu;
    
    konfig pool php-fpm
    Code:
    user = laskarsantri
    group = fpmsantri
    listen.owner = santri
    listen.group = phpexec
    
    setting group
    Code:
    fpmsantri:x:1020:laskarsantri,walipitu,santri
    
    setting permission & owner

    Code:
    root@yj:~/bin# ls -ald /home/santri/www/{.,wp-content,wp-content/cache}
    drwxr-x---  9 santri       fpmsantri    4096 Oct 15 21:14 /home/santri/www/.
    drwxr-xr-x 11 santri       santri       4096 Oct 11 16:35 /home/santri/www/wp-content
    drwxrwxr-x  6 laskarsantri laskarsantri 4096 Jul 26 19:21 /home/santri/www/wp-content/cache
    root@yj:~/bin# 
     
  10. mas.satriyo

    mas.satriyo Expert 2.0

    Messages:
    961
    Likes Received:
    141
    Trophy Points:
    43
    udah coba di define lewat vhost mas
    tapi malah keluar warning kalo directive user gak boleh ada di block vhost
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...