Tạo proxy server từ vps window
Nội dung chính 1. Proxy Server là gì?Proxy Server là một trung gian giữa người dùng và Internet. Với Proxy Server, các máy khách thực hiện kết nối với mạng gián tiếp. Các chương trình máy khách của người dùng sẽ kết nối với mạng thông qua một máy chủ trung gian thay vì máy chủ thực mà người dùng cần giao tiếp. 2.1. Cài đặt SQUID trên windowTải phần mềm SQUID tại http://squid.diladele.com. Hiện tại chỉ có sẵn phiên bản 64 bit. Cách cài đặt Squid 3.5 trên Windows, Trong hướng dẫn này, tôi cài đặt Squid vào thư mục F:\Squid (đường dẫn mặc định là C:\Squid). 2.2. Cấu hình xác thực bằng username/password
Bây giờ, Proxy Server đã sẵn sàng để sử dụng với các thông tin như sau: Proxy address: http://127.0.0.1:3128/ hoặc (http://[your local ip address]:3128/) Proxy username: admin Proxy password: 12345678 VIDEO THAM KHẢO Chuẩn bị về VPS
Dùng Squid tạo Proxy Server trên VPS Squid là một phần mềm Proxy Server dùng cho việc lưu trữ cache và lọc nội dung web. Squid hỗ trợ các giao thức HTTP, HTTPS, FTP,… Nguyên tắc hoạt động của Squid là khi người dùng truy vấn đến 1 website thông qua Squid thì Squid sẽ kiểm tra xem nội dung trang web đó có được lưu trữ và có thay đổi không? Nếu đã có lưu trữ và không thay đổi thì Squid sẽ trả luôn nội dung đó cho người dùng mà không cần phải truy vấn đến địa chỉ website kia nữa. Điều này giúp quá trình duyệt web nhanh hơn rất nhiều. Có rất nhiều phần mềm có thể giúp bạn tạo Proxy server nhưng theo mình phần mềm tốt nhất đó là Squid. Vì nó ổn định, đáng tin cậy và có nhiều chức năng. Và điều quan trọng nhất khi nói về các phần mềm trên linux, đa số là miễn phí và Squid cũng là một phần mềm như vậy. Squid cũng có một phiên bản trên windows nhưng mình nghĩ bạn nên sử dụng phiên bản trên Linux thì tốt hơn là chạy trên windows. ISA server không bao giờ là một lựa chọn tốt nhất cả. Để cài đặt Squid Proxy trên CentOS bạn đăng nhập vào VPS bằng PutTy và thực hiện lệnh sau : yum install -y squid Cấu hình để Squid để tự động chạy mỗi khi Server khởi động lại với lệnh sau: chkconfig squid on service squid start Thông tin cấu hình cho Squid sẽ được chứa trong file Bạn sửa Để tăng tính bảo mật cho Proxy của bạn, bạn nên tạo user để sử dụng proxy của bạn. Bạn thực hiện lệnh này: yum install -y httpd-tools touch /etc/squid/squid_passwd chown squid /etc/squid/squid_passwd Sau đó, bạn chạy câu lệnh này để tạo user, hệ thống sẽ yêu cầu bạn nhập mật khẩu: htpasswd /etc/squid/squid_passwd user_cuaban Với Debian và Ubuntu dpkg -L squid | grep ncsa_auth RHEL/CentOS/Fedora rpm -ql squid | grep ncsa_auth Kết quả báo ( dùng nó để thêm ở bước sau) /usr/lib64/squid/ncsa_auth Sau đó thêm vào dòng đầu của file auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/squid_passwd auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hours auth_param basic casesensitive off acl ncsa_users proxy_auth REQUIRED http_access allow ncsa_users Ngoài ra, để sử dụng Squid làm Proxy mà không muốn bị phát hiện ra là bạn dùng proxy thì bạn thêm vào cuối file via off forwarded_for off request_header_access Allow allow all request_header_access Authorization allow all request_header_access WWW-Authenticate allow all request_header_access Proxy-Authorization allow all request_header_access Proxy-Authenticate allow all request_header_access Cache-Control allow all request_header_access Content-Encoding allow all request_header_access Content-Length allow all request_header_access Content-Type allow all request_header_access Date allow all request_header_access Expires allow all request_header_access Host allow all request_header_access If-Modified-Since allow all request_header_access Last-Modified allow all request_header_access Location allow all request_header_access Pragma allow all request_header_access Accept allow all request_header_access Accept-Charset allow all request_header_access Accept-Encoding allow all request_header_access Accept-Language allow all request_header_access Content-Language allow all request_header_access Mime-Version allow all request_header_access Retry-After allow all request_header_access Title allow all request_header_access Connection allow all request_header_access Proxy-Connection allow all request_header_access User-Agent allow all request_header_access Cookie allow all request_header_access All deny all Sau đó khởi động lại Squid để các cấu hình trên có hiệu lực : service squid restart Nếu bạn không muốn sử dụng Proxy server bằng VPS của mình, ta có thẻ remove xóa Squid ra khỏi VPS bằng lệnh sau: yum remove squid -y Vậy là xong hướng dẫn chi tiết cách tạo SOCKS Proxy trên VPS. Chúc các bạn thành công! 5 1 đánh giá Article Rating |