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-04-28, 19:40:58

Author Topic: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write  (Read 5553 times)

0 Members and 1 Guest are viewing this topic.

Offline ahmaddaniyal

  • Valuable Member
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile
ini lanjutan dari masalah sebelumnya (install b2evolution tidak tampil thumbnail). Ternyata masalahnya ada pada nginx php5.5 nya kloxo-mr 7.0 tidak bisa write .

jadi saat folder media saya chmod 777, b2evolution create folder _evocache/nama_file  (nama_file ini adalah directory) yang memiliki file permission standart 775 bukan 777 dgn owner dan grup = client_username.client_username . nah di folder nama_file ini php5.5 tidak bisa membuat file baru di dalamnya.
 padahal file ini adalah thumbnail hasil generate dari file aslinya.
Code: [Select]
[root@vps isun]# sh /script/sysinfo
A. Control Panel:               
   - Kloxo-MR: 7.0.0.b-2016011904
   - Web: hiawatha-10.0.0-f.6.mr.el6.x86_64
   - PHP: php54s-5.4.45-1.ius.el6 (cgi mode)
B. Plateform:
   - OS: CentOS release 6.7 (Final) x86_64
   - Hostname: vps.server
C. Services:
   1. MySQL: MariaDB-server-10.0.23-1.el6.x86_64
   2. PHP:
      - Branch: php55u-cli-5.5.30-1.ius.el6.x86_64
      - Multiple:
        * php52m-5.2.17-102.mr.el6
        * php54m-5.4.45-1.ius.el6
        * php55m-5.5.30-1.ius.el6
      - Used: php55m
   3. Httpd: --uninstalled--
      - PHP Type: php-fpm_event
   4. Lighttpd: --uninstalled--
   5. Hiawatha: --unused--
   6. Nginx: nginx-1.9.9-1.el6.ngx.x86_64
   7. Cache: --uninstalled--
   8. Dns: bind-9.9.7-1.mr.el6.x86_64
   9. Qmail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64
D. Memory:
                total       used       free     shared    buffers     cached
   Mem:          2048       1805        242         43          0       1161
   -/+ buffers/cache:        644       1403
   Swap:         1024          4       1019
E. Disk Space:
   Filesystem      Size  Used Avail Use% Mounted on
   /dev/simfs      110G   69G   42G  63% /


*** Process Time: 00:00:00:01.1426 (dd:hh:mm:ss:xxxxxx) ***

* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
        (importance after Kloxo-MR update)

[root@vps isun]#

Nuwun..
« Last Edit: 2016-01-21, 02:28:30 by ahmaddaniyal »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #1 on: 2016-01-21, 03:22:29 »
Coba anda ubah ownership dari directory tersebut ke apache:apache daripada user:user tapi permission dikembalikan ke 755. Ini jauh lebih secure daripada 777.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline ahmaddaniyal

  • Valuable Member
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #2 on: 2016-01-21, 11:46:32 »
Nuwun...

sudah sy ubah di /etc/php-fpm.d/[client_name]

user = apache
group = apache

setelah itu saya kasih perintah 'sh /script/restart-all' dan 'sh /script/fix-all' saya cek file dah berubah semua permissionnya .. tapi owner nya tetep. kemudian sy cek lagi  /etc/php-fpm.d/[client_name]   ternyata

mbalik semual

user = [client_name]
group = [client_name]

dan tetep aja nginx - php tidak memiliki hak write... dan thumbnail tidak ter-generate..

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #3 on: 2016-01-21, 12:07:08 »
Nuwun...

sudah sy ubah di /etc/php-fpm.d/[client_name]

user = apache
group = apache

setelah itu saya kasih perintah 'sh /script/restart-all' dan 'sh /script/fix-all' saya cek file dah berubah semua permissionnya .. tapi owner nya tetep. kemudian sy cek lagi  /etc/php-fpm.d/[client_name]   ternyata

mbalik semual

user = [client_name]
group = [client_name]

dan tetep aja nginx - php tidak memiliki hak write... dan thumbnail tidak ter-generate..
Masalahnya bukan di php tapi di nginx yang usernya sebagai 'nginx'. Saya ubah ke 'apache' pada update Kloxo-MR.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline ahmaddaniyal

  • Valuable Member
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #4 on: 2016-01-21, 23:04:08 »
Inggih, kang... biar by default merubah user dan grupnya jadi 'apache' gimana? nggak harus manual.

Saya tadikan mencoba dgn edit di /etc/php-fpm.d/[client_name]. ternyata setelah 'sh /script/fix-all' user dan groupnya mbalik lagi menjadi 'client_name'.

Nuwun...

Offline ahmaddaniyal

  • Valuable Member
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #5 on: 2016-01-21, 23:43:58 »
setelah baca di https://forum.mratwork.com/kloxo-mr-development/php-fpm-custom-config/ ....

saya coba, alhamdulillaah berhasil merubah user dan group di /etc/php-fpm.d/[client_name] menjadi apache.

Tapi ternyata masalah utama masih berlanjut. tidak ada file thumbnail yang ter-generate di folder _evocache .

padahal  nginx-php dah bisa buat folder _evocache/[nama_file]  ([nama_file ini sebuah directory). tapi tidak bisa generate file thumbnail di dalam folder itu.



Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #6 on: 2016-01-22, 02:39:49 »
Setiap website sengaja disetting directory dan file dari website tersebut sesuai nama user tersebut. Misalnya directory /home/admin/domain.com akan memiliki owner admin:admin. Merubah user di php-fpm ke apache akan 'menyalahi' aturan ini (pertimbangan aspek security). Kembalikan ke semula dengan ownernya. Jika ada directory yang tidak mau di-write maka ubah owner directory tersebut ke apache:apache. Tapi sebelumnya, lakukan update Kloxo-MR ke 2016012103 dan jalankan cleanup. Begitu.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline ahmaddaniyal

  • Valuable Member
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #7 on: 2016-01-22, 02:52:57 »
yups... saya kembalikan lagi koq... situs yang lain jadi masalah.

Tapi ya itu... masalah utama nginx nggak bisa create file belum terpecahkan...

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #8 on: 2016-01-22, 03:29:07 »
1. Pastikan di /etc/nginx/nginx.conf berisi 'user apache;' dan BUKAN 'user nginx;'
2. Pastikan versi Kloxo-MR 7 melalui 'sh /script/version-full' adalah '7.0.0.b-2016012103' and sudah menjalankan 'sh /script/cleanup' setelah update ke versi terbaru ini.
3. Dalam pengujian saya tidak masalah untuk write di nginx. Saya coba jalankan file php dengan code:
Code: [Select]
<?php

if (!
file_exists('./hi')) {
mkdir('hi');
}

$file fopen("./hi/test.txt","w");
fwrite($file,"Hello World. Testing!");
fclose($file);
yang akan membentuk directory 'hi' dan dalam directory akan ada file test.txt dengan isi 'Hello World. Testing!'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline ahmaddaniyal

  • Valuable Member
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #9 on: 2016-01-22, 08:59:01 »
Nuwun, kang...
1. ternyata benar sebelumnya user nginx; dah diganti..
2. dah diupdate
3. sayangnya di b2evolution  file itu belum ter-genarate di subfolder _evocache/nama.file/

sebagai catatan... file ini tergenerate di Kloxo-MR 6.5 (di vps sy yang lain) dan di lokal ubuntu saya (menggunakan apache dan php56)

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #10 on: 2016-01-22, 09:07:17 »
Persoalan ownership dan permission untuk directory atau file berbeda kelakuan antara nginx dan apache.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline ahmaddaniyal

  • Valuable Member
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #11 on: 2016-01-22, 09:09:38 »
ini sysinfo di vps kloxo 6.5 saya :

Code: [Select]
[root@kaisan daniyal]# sh /script/sysinfo

A. Kloxo-MR: 6.5.0.f-2015083001

B. OS: CentOS release 6.7 (Final) x86_64

C. Apps:
   1. MySQL: mysql55-5.5.47-1.ius.el6.x86_64
   2. PHP: php54-5.4.45-1.ius.el6.x86_64
   3. Httpd: httpd-2.2.31-1.mr.el6.x86_64
   4. Lighttpd: --uninstalled--
   5. Nginx: nginx-1.9.9-1.el6.ngx.x86_64
   6. Qmail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64
   7. Dns: bind-9.9.7-1.mr.el6.x86_64

D. Php-type (for Httpd/proxy): php-fpm_event

E. Memory:
                total       used       free     shared    buffers     cached
   Mem:          1869       1638        230        432         14        763
   -/+ buffers/cache:        860       1008
   Swap:         2047         66       1981

[root@kaisan daniyal]#

lancar tergenerate

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #12 on: 2016-01-22, 09:14:26 »
Kelihatannya di 6.5 anda pakai nginx-proxy (bukan nginx standalone).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline ahmaddaniyal

  • Valuable Member
  • *
  • Posts: 95
  • Karma: +0/-0
    • View Profile
Re: nginx php5.5 di kloxo-mr 7.0 tidak punya hak write
« Reply #13 on: 2016-01-22, 10:11:31 »
Matur sembah nuwun...kang.. fixed.... halah cuman harus pakai nginx-proxy ternyata...

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine

Page created in 0.05 seconds with 18 queries.

web stats analysis