Widget HTML #1


Panduan teknis praktis mengamankan OJS di VPS

Panduan teknis praktis mengamankan OJS di VPS, disusun berlapis (defense-in-depth) dan relevan dengan pola serangan judi online di Indonesia.
Contoh asumsi: Linux (Ubuntu 20.04/22.04), Nginx/Apache, OJS 3.x, PHP, MySQL/MariaDB.


1. Hardening VPS (fondasi – WAJIB)

A. SSH & akses server

# Ganti port SSH (contoh 2222)
sudo nano /etc/ssh/sshd_config
Port 2222
PermitRootLogin no
PasswordAuthentication no
sudo systemctl restart ssh
  • Gunakan SSH key
  • Batasi IP admin via firewall

B. Firewall (UFW)

sudo ufw allow 2222/tcp
sudo ufw allow 80,443/tcp
sudo ufw enable

C. Fail2Ban (bruteforce protection)

sudo apt install fail2ban -y

Aktifkan jail untuk:

  • SSH
  • Nginx/Apache
  • PHP-FPM (jika ada)

2. Web Server Hardening (anti bot & judi)

A. WAF (sangat dianjurkan)

Opsi cepat: Cloudflare (gratis sudah cukup)
Opsi lokal: ModSecurity + OWASP CRS

Cloudflare minimal:

  • Bot Fight Mode
  • Rate limit /login, /user/register
  • Block country jika perlu

B. Disable PHP execution di folder rawan

Ini langkah KRITIS

Untuk Nginx:

location ~* ^/(public|cache|files)/.*\.php$ {
    deny all;
}

Untuk Apache:

<Directory "/var/www/ojs/public">
    php_admin_flag engine off
</Directory>

C. Proteksi file sensitif

location ~ /\.(ht|git|env) {
    deny all;

3. OJS-Level Security (sering diabaikan)

A. Permission file

find /var/www/ojs -type d -exec chmod 755 {} \;
find /var/www/ojs -type f -exec chmod 644 {} \;

Folder yang boleh write:

  • public/
  • cache/
  • files/

B. config.inc.php

force_ssl = On
session_check_ip = On
csrf_check = O

C. Login & akun

  • Ganti semua password
  • Hapus user mencurigakan
  • Matikan open registration jika tidak perlu
  • Aktifkan CAPTCHA

4. Database Security

A. User DB khusus

CREATE USER 'ojsuser'@'localhost' IDENTIFIED BY 'STRONGPASS';
GRANT SELECT,INSERT,UPDATE,DELETE ON ojsdb.* TO 'ojsuser'@'localhost';

❌ Jangan pakai root

B. Backup terenkripsi

mysqldump ojsdb | gpg -c > ojsdb.sql.gpg

5. Deteksi & Anti SEO Judi (ini sering telat disadari)

A. Scan file mencurigakan

find /var/www/ojs -name "*.php" -mtime -7
grep -R "eval\|base64_decode" /var/www/

B. Google Search Console

  • Cek:
    • Indexed pages aneh
    • Keyword judi
  • Request Remove URL jika perlu

6. Monitoring & Log (supaya tidak kecolongan lagi)

Log penting

  • /var/log/nginx/access.log
  • /var/log/nginx/error.log
  • /var/log/auth.log

Alert sederhana

  • Install logwatch
  • Kirim report ke email admin

7. SOP DARURAT jika OJS sudah terinfeksi

  1. Offline sementara
  2. Backup forensik (jangan overwrite)
  3. Scan & hapus file asing
  4. Reset semua credential
  5. Re-deploy OJS clean
  6. Submit reindex ke Google

8. Checklist ringkas (bisa ditempel)

✅ OJS terbaru
✅ PHP execution off di public/cache
✅ WAF aktif
✅ SSH key only
✅ Fail2Ban aktif
✅ Backup harian offsite
✅ Google Search Console aktif

Intinya

OJS di VPS harus diperlakukan seperti sistem publikasi kritikal,
bukan sekadar website kampus.

Silakan japri, jika Ingin:

1. Buatkan hardening checklist versi kampus

2. Contoh rule WAF khusus OJS

3. Template SOP keamanan OJS

4. Panduan audit pasca-kena judi online

Jangan lupa Infokan server Kamu pake Web server: Nginx atau Apache?, OS Ubuntu atau CentOS?  OJS 3.2 / 3.3 / 3.4?