Security Setting
- Install bitninja
- Matikan ping/ICMP
- Change SSH Port
- Minta dibuatkan Reverse DNS untuk IP VPS kepada pihak hosting
Vesta Specific
- Vesta, buat cron matikan interface
- service vesta stop
- Vesta: buat cron backup users
- sebagai root: v-backup-users
- sebagai admin: sudo /usr/local/vesta/bin/v-backup-users
- Vesta: https://vestacp.com/docs/
- Upgrade ke PHP 7.2
Web Server Setting
- Use gzip untuk compression. Vesta dan cPanel sudah gzip by default.
- Use BunnyCDN as frontend proxy. Jaga-jaga in case server utama down (sebagai “always online” cache). Mencegah DDoS dan hacking juga.
- Use latest PHP version, enable extensions: curl, iconv, ioncube, mbstring, mysqlnd, opcache
- Enable PHP FPM on all accounts
- Enable HTTP/2 for Apache
- Enable Opcache
- Use litespeed web server if possible. Pada testing dengan visitor sekitar 500.000/day tanggal 9 Mei 2019, server load Litespeed + Litespeed Cache for WordPress dari 1-2,naik jadi 24-32 dengan Apache + WP Super Cache Mod_Rewrite
- Kalau pakainya Apache, gunakan MPM Event if possible.
- Event [default MPM for Apache 2.4]
- Prefork [default MPM for Apache 2.2, 2.0 and 1.3]
(MPM Event) The fastest MPM and considered least stable…although fine for most people in real-world practices. Uses the least resources and can handle the most visits. If you have problems, then try Worker and that last is Prefork.
https://wpjohnny.com/apache-performance-tip-switch-to-mpm-event/
Prefork is a more stable mpm. But both memory and CPU have their disadvantages. Not efficient in process management. Separate processing for each request is causing high resource consumption.
https://forums.cpanel.net/threads/why-does-mpm-prefork-faster-than-any-other-mpm.596455/
The event MPM is threaded like the Worker MPM, but is designed to allow more requests to be served simultaneously by passing off some processing work to supporting threads, freeing up the main threads to work on new requests.
https://www.woktron.com/secure/knowledgebase/133/How-to-optimize-Apache-performance.html
- Aktifkan PHP-FPM untuk meningkatkan performa Apache kita
Generally PHP-FPM performanya sudah cukup bagus, dan kita tidak terlalu perlu backend PHP yang mahal kalau sudah pakai frontend proxy BunnyCDN
- Untuk alternatif PHP-FPM, bisa gunakan LSAPI (seperti litespeed) untuk menjalankan file-file PHP yang kita miliki. Caranya, install module LSAPI via Easy Apache
Lalu matikan PHP-FPM untuk semua website dan jadikan LSAPI sebagai PHP Handle untuk file-file PHP
Berdasar hasil testing internal di server sendiri, tanggal 7 Mei 2019, untuk speed LSAPI masih di bawah PHP-FPM, dan PHP-FPM masih di bawah Litespeed. Berikut penggunaan CPU antara
Litespeed (kotak hijau), Apache PHP-FPM (kotak kuning), Apache LSAPI (kotak merah):
Static Files Setting
- Pisahkan static files ke server berbeda, atau CDN terpisah. Jangan dilayani dari server yg sama, terutama kalau pakai Apache.
- Gunakan VestaCP nginx only, enable http2 untuk nginx dan pastikan matikan vestacp (service vesta stop) untuk security. Bisa juga pakai CyberPanel sebagai alternatif VestaCP
Leave a Reply