Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   11.Xây dựng máy chủ Proxy Server - Squid (http://quantrinet.com/forum/forumdisplay.php?f=212)
-   -   Xây dựng một Proxy Server trên centos với Squid Proxy (http://quantrinet.com/forum/showthread.php?t=9566)

hoctinhoc 28-11-2013 10:21 AM

Xây dựng một Proxy Server trên centos với Squid Proxy
 
Xây dựng một Proxy Server trên centos với Squid Proxy


1. Cài đặt và cấu hình Squid trên Server


Mã:


[root@lan ~]# yum -y install squid
 Loading "installonlyn" plugin Loading "fastestmirror" plugin Setting up Install
 Process Setting up repositories base 100%
|=========================| 1.1 kB    00:00  updates 100%

|=========================| 951 B    00:00  addons 100%

|=========================| 951 B    00:00  extras 100%

|=========================| 1.1 kB    00:00  Loading mirror speeds

from cached hostfile Reading repository metadata in from local files Parsing

 package install arguments Resolving Dependencies --> Populating

transaction set with selected packages. Please wait. ---> Downloading
header for squid to pack into transaction set. squid-2.6.STABLE6-4.el5.i 
100% |========================|  139 kB    00:00 ---> Package
squid.i386 7:2.6.STABLE6-4.el5 set to be updated --> Running transaction

check  Dependencies Resolved 

===========================================================
Package Arch  Version  Repository  Size 
===========================================================
Installing:  squid i386  7:2.6.STABLE6-4.el5    updates  1.2 M    Transaction
Summary
===========================================================
Install 1 Package(s)  Update 0 Package(s)  Remove 0 Package(s)    Total
download size: 1.2 M Downloading Packages: (1/1): squid-2.6.STABLE6-
100% |====================| 1.2 M 00:00  Running Transaction Test
Finished Transaction Test Transaction Test Succeeded Running Transaction 
Installing:  squid#################################### [1/1]   

Installed: squid.i386 7:2.6.STABLE6-4.el5 Complete! 

[root@lan ~]# vi /etc/squid/squid.conf

http_port 8080    // Thay đôi port cho proxy

acl CONNECT method CONNECT  acl lan src 192.168.0.0/255.255.255.0 // Thêm (Chỉ cho phép LAN)

http_access allow localhost http_access allow lan // Thêm (Chỉ cho phép LAN)

http_access deny all  visible_hostname lan.quantrinet.com

// Thêm dòng    # forwarded_for on forwarded_for off      header_access Referer deny all 

// Thêm
  header_access X-Forwarded-For deny all header_access Via deny all header_access Cache-Control deny all    

[root@lan ~]# /etc/rc.d/init.d/squid start 

init_cache_dir /var/spool/squid... Starting squid: [  OK  ]

[root@lan ~]# chkconfig squid on




2. Cấu hình kết nối đến proxy server
[trên Client]

Open Internet Explore -> Chọn [Tools] -> [Internet Options] -> Chọn Connections Tab

http://server-world.info/en/CentOS_5/squid/img/1.jpg



Chọn tiếp LAN Setting và điền vào thông tin của Proxy Server



http://quantrinet.com/images/2proxy.jpg


Done!

Chúc các bạn thành công!


Bây giờ là 03:45 PM. Giờ GMT +7

Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.