Install cPanel/WHM
One Command Solution Shortcut
# Install screen kalau belum ada
yum install screen -y
# Buat session baru
screen -S cpanel-install
# Di dalam session, jalankan seperti biasa
yum -y update && yum -y install perl && cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
# Detach dari session (install tetap jalan): tekan
Ctrl + A, lalu D
# Cek Sesi
screen -r cpanel-install
Update Package yum / dnf
Langkah awal, update package yum anda
yum update
Sebelum memasang cPanel, Anda harus memasang Perl di server Anda karena cPanel ditulis dalam Perl. Untuk memasang Perl di sistem Anda, masuk sebagai pengguna root dan jalankan perintah berikut.
Install Perl
yum -y install perl
Sekarang Anda perlu mengatur nama host untuk server Anda. Nama host adalah FQDN atau Fully Qualified Domain Name yang akan digunakan untuk mengidentifikasi server Anda. Misalnya, pertimbangkan vps.mydomain.com – ini adalah FQDN yang dapat Anda gunakan sebagai nama host Anda. Untuk mengubah nama host Anda, jalankan perintah berikut
Hostname
hostname vps.mydomain.com
Konfigurasi Mariadb
mkdir /root/cpanel_profile
touch /root/cpanel_profile/cpanel.config
yum install nano
nano /root/cpanel_profile/cpanel.config
mysql-version=10.6
Install cPanel/WHM
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
Install Versi Spesifik cPanel/WHM
echo "CPANEL=126.0.16" > /etc/cpupdate.conf
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
Disable SQL Mode
nano /etc/my.cnf
sql_mode = ""
service mysql restart
Install Versi PHP Alt & EA
yum groupinstall alt-php84 alt-php85
Masalah Security Penting
Disable Function PHP INI Global
WHM >> Multi PHP INI
Cari disable_function :
disable_functions = system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,posix_getpwuid
Tanpa escapeshellarg,escapeshellcmd untuk keperluan whmcs
disable_functions = system,exec,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,posix_getpwuid
Tambahan asert, create function untuk backdoor obfuscation
disable_functions = system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid,assert,create_function,phpinfo
Untuk mengecek, buat file phptester.php
<?php
$funcs = ['exec', 'passthru', 'shell_exec', 'system'];
foreach ($funcs as $f) {
echo $f . ': ' . (function_exists($f) ? 'available' : 'not available') . "\n";
}
?>
Disable allow_url_fopen PHP INI Global
allow_url_fopen = Off
mencegah inject file_get_contents di website, agar tidak bisa menggunakan fungsi itu.