diff --git a/optimize_apache.sh b/optimize_apache.sh index c15bd36..655749a 100644 --- a/optimize_apache.sh +++ b/optimize_apache.sh @@ -231,6 +231,17 @@ else echo -e "${YELLOW} [!] Cấu hình mod_reqtimeout đã tồn tại trước đó, giữ nguyên.${NC}" fi + +if ! grep -q "mod_remoteip.c" "$HTTPD_CONF"; then + cat >> "$HTTPD_CONF" < + RemoteIPHeader X-Forwarded-For + RemoteIPInternalProxy 127.0.0.1 + RemoteIPInternalProxy 127.0.0.8 + +EOF +fi + # 7. KIỂM TRA VÀ KHỞI ĐỘNG LẠI APACHE echo -e "${BLUE}--> [Bước 4] Kiểm tra cú pháp cấu hình Apache...${NC}"