BƯỚC 1: Cài đặt CyberPanel
CyberPanel là một Hosting Panel sử dụng OpenLiteSpeed có tốc độ rất tốt dành cho những người dùng Wordpress
Đọc thêm tài liệu tại:Mã:sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)
https://docs.cyberpanel.net/doku.php?id=installation
BƯỚC 2: Cài đặt vDDoS Proxy Protection
vDDoS Proxy Protection là free software cung cấp một Reverse Proxy Server giao thức HTTP(S). Nó hoạt động như là một tường lửa ứng dụng chống đỡ DOS, DDOS, SYN Flo***, hoặc HTTP Flo*** attack để bảo vệ website của bạn.
Mã:curl -L https://github.com/duy13/vDDoS-Protection/raw/master/latest.sh -o latest.sh chmod 700 latest.sh bash latest.sh
BƯỚC 3: Change OpenLiteSpeed Default Port
Mặc định CyberPanel sử dụng OpenLiteSpeed chạy trên port 80 và 443, chúng ta có thể cấu hình lại cho Webserver này lắng nghe ở port khác để cho vDDoS có thể proxy vào nó.
Ví dụ mình chuyển OpenLiteSpeed sang port 8080 và 8443:
Mã:cp /usr/local/lsws/conf/httpd_config.conf.vddosbak nano /usr/local/lsws/conf/httpd_config.conf
Phần Port 80 chạy HTTP:
Sửa *:80 thành 127.0.0.1:8080:Mã:listener Default { address *:80 secure 0 map voduy.com voduy.com }
Mã:listener Default { address 127.0.0.1:8080 secure 0 map voduy.com voduy.com }
Và phần Port 443 chạy HTTPS:
Sửa *:443 thành 127.0.0.1:8443:Mã:listener SSL { address *:443 secure 1 keyFile /usr/local/lsws/admin/conf/webadmin.key certFile /usr/local/lsws/admin/conf/webadmin.crt map voduy.com voduy.com }
Nếu bạn không thấy có mục listener SSL {...} như trên thì có thể tự thêm vào cuối file một khung như vậy:Mã:listener SSL { address 127.0.0.1:8443 secure 1 keyFile /usr/local/lsws/admin/conf/webadmin.key certFile /usr/local/lsws/admin/conf/webadmin.crt map voduy.com voduy.com }
Sau này tạo Site chạy SSl CyberPanel sẽ tự động thêm mục "map" domain vào đó cho bạnMã:listener SSL { address 127.0.0.1:8443 secure 1 keyFile /usr/local/lsws/admin/conf/webadmin.key certFile /usr/local/lsws/admin/conf/webadmin.crt }
Save & Restart OpenLiteSpeed:
Kiểm tra lại OpenLiteSpeed port:Mã:service lsws restart
Mã:[root@vDDoS-CyberPanel ~]# netstat -lntup|grep openlitespeed [root@vesta ~]# netstat -lntup|grep httpd tcp 0 0 0.0.0.0:7080 0.0.0.0:* LISTEN 11507/openlitespeed tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 11507/openlitespeed tcp 0 0 127.0.0.1:8443 0.0.0.0:* LISTEN 11507/openlitespeed udp 0 0 0.0.0.0:32772 0.0.0.0:* 11576/openlitespeed
BƯỚC 4: Cấu hình vDDoS Proxy Protection
Ví dụ sau, do OpenLiteSpeed đã lắng nghe ở Port 8080 và 8443 ở IP 127.0.0.1 nên mình sẽ Proxy vDDOS vào 127.0.0.1 như sau:
Restart vDDoS service sau khi cấu hình:Mã:nano /vddos/conf.d/website.conf # Website Listen Backend Cache Security SSL-Prikey SSL-CRTkey default http://0.0.0.0:80 http://127.0.0.1:8080 no no no no default https://0.0.0.0:443 https://127.0.0.1:8443 no no /vddos/ssl/your-domain.com.pri /vddos/ssl/your-domain.com.crt
Auto-start vDDoS services khi boot:Mã:/usr/bin/vddos restart
Mã:/usr/bin/vddos autostart
BƯỚC 5: Cấu hình vDDoS Auto Add
vDDoS Auto Add là một addon hỗ trợ cho vDDoS Proxy Protection - Theo dõi Domains/Aliasdomains/Subdomains vừa được thêm trong Panel Hosting, Web Server, List Domain, Virtual Host... và tự động add thêm những domain vừa được tìm thấy vào trong file website.conf.
Crontab cho tự động làm việc theo dõi sau mỗi 15 phút scan hệ thống nhận diện những web đã được add trong CyberPanel rồi thì xin SSL Let's Encrypt và thêm vào trong website.conf:Mã:nano /vddos/auto-add/setting.conf Default Setting for vddos-add command: SSL Auto Cache no Security no HTTP_Listen http://0.0.0.0:80 HTTPS_Listen https://0.0.0.0:443 HTTP_Backend http://127.0.0.1:8080 HTTPS_Backend https://127.0.0.1:8443
Mã:echo '*/15 * * * * root /usr/bin/vddos-autoadd panel cyberpanel openlitespeed' >> /etc/crontab
BƯỚC 6: Cấu hình vDDoS Auto Switch
vDDoS Auto Switch là một addon hỗ trợ cho vDDoS Proxy Protection - Tự động nhận diện ra websites quá tải và dịch chuyển Security Mode của website đó một cách tự động trong website.conf
Đọc thêm tài liệu tại:Mã:echo '*/5 * * * * root /usr/bin/vddos-autoswitch checkalldomain high' >> /etc/crontab echo '0 */3 * * * root /usr/bin/vddos-autoswitch flushalldomain /vddos/conf.d/website.conf no' >> /etc/crontab
http://vddos.voduy.com/
https://www.diendanmaychu.vn/showthr...Layer4-Mapping