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-27, 10:47:51

Author Topic: Help Cara Mengunakan Nginx  (Read 7800 times)

0 Members and 1 Guest are viewing this topic.

Offline indomovi

  • Junior Member
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Help Cara Mengunakan Nginx
« on: 2014-12-03, 08:24:28 »
Selamat malam para suhu  ;D

Mau tanya neh saya sudah mengunakan Kloxo-Mr lebih dari satu tahun selama ini lancar jaya mengunakan apache sekarang mau coba pake nginx tapi ada sedikit probem  :'(  sehabis di switch program cuma tampilan home saja yang bisa di kunjungi halaman yang lain tidak  :-[ , kira-kira bagaimana yah cara memperbaikinya  :D ?

Regard
Kloxo-Mr Mania

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: Help Cara Mengunakan Nginx
« Reply #1 on: 2014-12-03, 09:02:03 »
apakah ketika pakek apache menggunakan mod_rewrite_url?
kalau iya di config ngin juga harus di terapkan rewrite rulesnya, coba bawa thread2 sebelumnya, sudah ada yg bahas...

Offline indomovi

  • Junior Member
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Help Cara Mengunakan Nginx
« Reply #2 on: 2014-12-03, 09:32:09 »
iya mas, saya sudah coba ubah /etc/nginx/conf.d/default.conf jadi seperti ini tapi blum bisa jua

server {
    listen       80;
    server_name  localhost;
    root /usr/share/nginx/html;
    index index.php;
    client_max_body_size 5G;

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    location / {
      if (!-e $request_filename) {
         rewrite ^/(.*) /index.php?_page_url=$1 last;
      }
    }

    location /files/ {
        internal;
    }

    # these locations would be hidden by .htaccess normally
    location /core/logs/ {
        deny all;
    }
}

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Help Cara Mengunakan Nginx
« Reply #3 on: 2014-12-03, 21:55:37 »
Informasikan server anda dengan 'sh /script/sysinfo'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline indomovi

  • Junior Member
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Help Cara Mengunakan Nginx
« Reply #4 on: 2014-12-03, 22:35:35 »
baik pak MR,

ini infonya :


Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Help Cara Mengunakan Nginx
« Reply #5 on: 2014-12-03, 22:40:17 »
Hmm, sudah pakai Kloxo-MR 7.

Terusterang belum ada cara gampang untuk membuat fasilitas custom untuk rewrite di nginx. Rewrite yang salah akan berakibat web service akan down.

Ini berbeda dengan apache (melalui .htaccess) atau hiawatha (melalui .hiawatha) dimana kesalahan di rewrite rules hanya akan berakibat pada website terkait saja.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline indomovi

  • Junior Member
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Help Cara Mengunakan Nginx
« Reply #6 on: 2014-12-03, 22:45:33 »
tapi setelah saya ubah  /etc/nginx/conf.d/default.conf terus sh/script/restart-web,
filenya kembali sperti belum di ubah, oia pak bisakah saya intall mod_xsendfile ( https://tn123.org/mod_xsendfile ) di kloxo
« Last Edit: 2014-12-03, 22:50:43 by indomovi »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Help Cara Mengunakan Nginx
« Reply #7 on: 2014-12-03, 22:51:16 »
Anda tidak bisa melakukannya di  /etc/nginx/conf.d/default.conf karena file ini tidak digunakan oleh Kloxo-MR dan bisa berakibat conflict dengan setting lain.

Yang harus dilakukan adalah mengubah isi custom.defaults.conf.tpl dan custom.domains.conf.tpl terkait 'include' untuk 'switch_standard.conf' dan atau 'switch_wildcard.conf' karena pengaturan rewrite rule berada di kedua file ini.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline indomovi

  • Junior Member
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Help Cara Mengunakan Nginx
« Reply #8 on: 2014-12-03, 22:57:55 »
untuk edit file ini dimana tempatnya yah pak MR, custom.defaults.conf.tpl dan custom.domains.conf.tp
saya cari di /home/ kok nginxnya tidak ada,
« Last Edit: 2014-12-03, 23:02:10 by indomovi »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Help Cara Mengunakan Nginx
« Reply #9 on: 2014-12-03, 23:08:48 »
copy-kan dari defaults.conf.tpl dan domains.conf.tpl di /opt/configs/nginx/tpl. Kedua file ini ditulis memakai php dan digunakan oleh Kloxo-MR untuk menghasilkan file init.conf dan untuk masing-masing domain di /opt/configs/nginx/conf/defaults dan /opt/configs/nginx/conf/domains.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline indomovi

  • Junior Member
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Help Cara Mengunakan Nginx
« Reply #10 on: 2014-12-03, 23:40:52 »
pak mustafa saya sudah copykan kedua filenya dan saya edit tapi belum terjadi apa2 cuma tampilan index.php aja yang kebaca yang lainnya jika di klik kembali lagi ketampilan index.php  :'(

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Help Cara Mengunakan Nginx
« Reply #11 on: 2014-12-03, 23:50:31 »
Kedua file tersebut adalah file template, anda harus menjalankan 'sh /script/fixweb; sh /script/restart-web -y' setelah itu.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline indomovi

  • Junior Member
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Help Cara Mengunakan Nginx
« Reply #12 on: 2014-12-04, 00:05:34 »
sudah saya coba dan masih sama, mungkin saya pake apache aja dulu

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Help Cara Mengunakan Nginx
« Reply #13 on: 2014-12-04, 01:02:46 »
Mengapa tidak pilih nginx-proxy (nginx in front and apache in backend)?.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline GentZu

  • Senior Member
  • *
  • Posts: 323
  • Karma: +0/-0
  • Gender: Male
  • yare yare...
    • View Profile
Re: Help Cara Mengunakan Nginx
« Reply #14 on: 2014-12-04, 01:21:19 »
kalau cara saya sedikit modif di jadi nanti pada /opt/configs/nginx/tpl/custom.domains.conf.tpl

if ($wildcards) {
?>

   include '<?php echo $globalspath; ?>/switch_wildcards.conf';
<?php
         } else {
?>

   include '<?php echo $globalspath; ?>/switch_standard.conf';   
   include '<?php echo $globalspath; ?>/<?php echo $domainname; ?>.conf';
<?php
         }


jadi nanti pada /opt/configs/nginx/conf/domains/* ada include tambahan setiap domain yg letaknya /opt/configs/nginx/conf/globals/namadomain.net.conf, kekuranganya sih kita harus menambahkan manual file sebanyak jumlah domain yg ada, kalau tidak akan error...

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo

Page created in 0.052 seconds with 19 queries.

web stats analysis