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-20, 14:23:18

Author Topic: ask - Blok IP di kloxo MR / lxguard  (Read 6986 times)

0 Members and 1 Guest are viewing this topic.

Offline menyo

  • Senior Member
  • *
  • Posts: 157
  • Karma: +0/-0
    • View Profile
ask - Blok IP di kloxo MR / lxguard
« on: 2014-11-18, 04:46:43 »
Malam pak, saya mau tanya. Bagaimana memblokir IP lewat kloxo MR?
dengar fungsi LX guard mirip dengan CSF. Nah di csf kan ada tuh blokir IP agar tak mengakses server kiita.
Sepertinya saya mengalami lagi load dari satu IP yang cukup lumayan. meski tak besar namun cukup mengganggu juga sih pak.

Saya ingin blokir IP tersebut tidak hanya dari kloxo MR panel namun juga agar tidak mengakses web client agar tak membuat load server semakin besar.
Mohon pencerahannya pak?

salam.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #1 on: 2014-11-18, 04:51:56 »
LxGuard memonitor login ssh dan ftp. Jika gagal berturut-turut sampai 20 x (default) maka otomatis di-block.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline menyo

  • Senior Member
  • *
  • Posts: 157
  • Karma: +0/-0
    • View Profile
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #2 on: 2014-11-18, 05:38:30 »
o saya pikir bisa batasin request per ip per second pak kaya CSF ;D
Soalnya sekilas sih, dulu liat di csf ada settingan kaya begitu

Saya pake nginx proxy kloxo MR 6.5f
kalau mau buat blokir IP atau syukur2 bisa buat batasin request per IP, di kloxo MR bisa tidak ya pak?
atau harus lewat settingan centos bagian mana ya pak?

terimakasih pak
Salam.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #3 on: 2014-11-18, 06:12:40 »
Jika yang anda maksud request ke http maka nginx sudah ada pembatasan (untuk mengangkal DDOS).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline menyo

  • Senior Member
  • *
  • Posts: 157
  • Karma: +0/-0
    • View Profile
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #4 on: 2014-11-18, 18:38:11 »
Nah bisa tidak pak disetting lewat nginx request/s tersebut?

meskipun tidak membuat down tapi cukup mengganggu.

Kira2 file apa yang harus di edit untuk setting ddos di nginx ini? syukur dikasih dikit keterangan pak. hehe
lalu yang kedua untuk blok IP itu langsung lewat centos nya ya pak?

trimakasih pak
salam

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #5 on: 2014-11-18, 19:15:10 »
Copy '/opt/configs/nginx/etc/conf.d/~lxcenter.conf' (Kloxo-MR 7) atau '/home/nginx/etc/conf.d/~lxcenter.conf' (Kloxo-MR 6.5.0) ke 'custom.~lxcenter.conf'.

Kemudian modifikasi file custom tersebut (baca http://community.cloud66.com/articles/nginx-allow-and-deny-by-ip). Setelah itu, jalankan 'sh /script/fixweb; sh script/restart-web' (Kloxo-MR 7) atau 'sh /script/cleanup' (Kloxo-MR 6.5.0). Langkah ini bisa diringkas dengan copy custom tersebut ke /etc/nginx/conf.d/~lxcenter.conf dan kemudian 'sh /script/restart-web'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline menyo

  • Senior Member
  • *
  • Posts: 157
  • Karma: +0/-0
    • View Profile
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #6 on: 2014-11-18, 23:43:34 »
Copy '/opt/configs/nginx/etc/conf.d/~lxcenter.conf' (Kloxo-MR 7) atau '/home/nginx/etc/conf.d/~lxcenter.conf' (Kloxo-MR 6.5.0) ke 'custom.~lxcenter.conf'.

Kemudian modifikasi file custom tersebut (baca http://community.cloud66.com/articles/nginx-allow-and-deny-by-ip). Setelah itu, jalankan 'sh /script/fixweb; sh script/restart-web' (Kloxo-MR 7) atau 'sh /script/cleanup' (Kloxo-MR 6.5.0). Langkah ini bisa diringkas dengan copy custom tersebut ke /etc/nginx/conf.d/~lxcenter.conf dan kemudian 'sh /script/restart-web'.

saya dah buat blockips.conf dan saya include ke custom
namun IP xxx.xxx.123.200 masih masih bisa mengakses nampaknya.

saya cek netstat -ntu | awk '{print $5}' | tail --lines=+3 | cut -s -d: -f1 | sort | uniq -c | sort -n -b -r

IP tersebut masih eksis pak.
Apa ada hal lain yang perlu diilakukan?
terimakasih

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #7 on: 2014-11-18, 23:49:06 »
Coba saja lihat isi  /etc/nginx/conf.d/~lxcenter.conf apa suda sesuai.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline menyo

  • Senior Member
  • *
  • Posts: 157
  • Karma: +0/-0
    • View Profile
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #8 on: 2014-11-19, 00:30:03 »
Coba saja lihat isi  /etc/nginx/conf.d/~lxcenter.conf apa suda sesuai.
yang saya tambahkan hanya include /home/nginx/etc/conf.d/blockips.conf;
dan isi file itu hanya "deny 222.123.121.200;"

ini pak custom lxcenter.conf
Code: [Select]
    include /home/nginx/etc/conf.d/blockips.conf;
    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;

    error_log /var/log/nginx/error.log warn;

    ### MR - must be using nginx-special (including ngx_http_log_request_speed)
## just enough remove # below for enable; only request > 5000 miliseconds write to error.log
    #log_request_speed_filter on;
    #log_request_speed_filter_timeout 5000;

    gzip            on;
    gzip_static     on;
    gzip_min_length 1024;
    gzip_comp_level 4;
    gzip_proxied    any;

    gzip_types text/plain
           text/css
           application/x-javascript
           text/xml
           application/xml
           application/xml+rss
           text/javascript;

    keepalive_timeout 180;

    limit_conn_zone $binary_remote_addr zone=addr:10m;

    proxy_cache_path /var/cache/nginx-proxy levels=1:2 keys_zone=pcache:8m max_size=1000m inactive=600m;
    proxy_temp_path /tmp/nginx 1 2;

    fastcgi_cache_path /var/cache/nginx-fastcgi levels=1:2 keys_zone=fcache:8m max_size=1000m inactive=600m;
    fastcgi_temp_path /tmp/nginx 1 2;

    include /home/nginx/conf/defaults/*.conf;
    include /home/nginx/conf/domains/*.conf;
    include /home/nginx/conf/webmails/*.conf;

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #9 on: 2014-11-19, 00:44:41 »
Delete custom.~lxcenter.conf and letakkan blockips.conf di /etc/nginx/conf.d
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline menyo

  • Senior Member
  • *
  • Posts: 157
  • Karma: +0/-0
    • View Profile
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #10 on: 2014-11-19, 01:07:45 »
masih bisa akses pak ip nya
Maaf pak ya kalau saya mungkin agaj sok tau hehe
tadi googling nemu yang dirubah itu file nginx.conf
apa mungkin itu ya pak? apa file nginx.conf hanya untuk nginx murni saja?

nah ini penelusuran saya mencari nginx.conf

./home/nginx/etc/conf/nginx.conf
./etc/nginx/nginx.conf
./usr/local/lxlabs/kloxo/init/nginx.conf
./usr/local/lxlabs/kloxo/file/nginx/etc/conf/nginx.conf

mana yang dirubah ya pak, kalau memang nginx conf yang dirubah

terimakasih pak
salam

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #11 on: 2014-11-19, 01:31:35 »
Tidak begitu. Nginx sendiri ketika running akan membaca file yang ada di /etc/nginx/ dan /etc/nginx/conf.d (sesuai setting service di /etc/rc.d/init.d/nginx). Kloxo-MR menambahkan file ~lxcenter.conf karena ingin meletakkan file init.conf dan domain .conf ditempat berbeda.

Setelah merubah file .conf maka nginx harus direstart.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline menyo

  • Senior Member
  • *
  • Posts: 157
  • Karma: +0/-0
    • View Profile
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #12 on: 2014-11-19, 01:47:23 »
sudah saya restart-all -y pak tadi

Karena error dan masih membaca custom yang dihapus tadi, maka saya cleanup

Sudah saya restart-all -y lagi
dan tidak ada error. tapi ya anehnya itu ip masih nongol ya pak ketika dicek.

sebelumnya saya cek loadnya normal namun setelah beberapa hari domain dipindah keserver baru kok agak naik.
Memang masih kuat, namun gak kebayang saja kalau smua client kaya begitu.

Sayang saja kalau server overload cuma request dri  ip yang gak jelas itu.
Makanya saya coba blokir tapi masih gagal pak.

Install CSF takut error, sudah produksi soalnya servernya.

Bingungnya ya gak ngefek ya pak.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #13 on: 2014-11-19, 01:53:53 »
Jika anda pakai php-fpm untuk php-type maka jumlah client akan mempengaruhi ram terpakai ini karena php-fpm mengalokasikan jumlah php children dengan jumlah tertentu (default: unlimited = 6) untuk setiap client.

Tidak ada rumus yang pasti berapa client yang bisa 'ditampung' untuk jumlah ram tertentu.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline menyo

  • Senior Member
  • *
  • Posts: 157
  • Karma: +0/-0
    • View Profile
Re: ask - Blok IP di kloxo MR / lxguard
« Reply #14 on: 2014-11-19, 02:41:27 »
Oke pak sudah ilang IP nya

tidak tahu juga sih kenpa. tadi tiba2 ilang saja.
mungkin efek deny IP tidak langsung alias nunggu proses dulu mungkin ya pak.

IP table itu kalau gak salah kaya firewall and bisa blok ip juga. Itu defaultnya kan mati di service. Itu kalau dihidupkan masalah tidak y pak?
salam

 


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

Page created in 0.026 seconds with 19 queries.

web stats analysis