Professional Documents
Culture Documents
Caidatsquidproxytrongsuot 130908212220
Caidatsquidproxytrongsuot 130908212220
Khi ng Squid
S dng lnh chkconfig cu hnh chy Squid mi khi khi ng my:
[root@proxy tmp]# chkconfig squid on
S dng cu lnh service start, stop, v restart Squid sau khi khi chy:
[root@proxy tmp]# service squid start
[root@proxy tmp]# service squid stop
[root@proxy tmp]# service squid restart
S dng cu lnh pgrep kim tra Squid c ang chy hay khng:
[root@proxy tmp]# pgrep squid
Kt qu cu lnh trn s l ProcessID ca Squid
Hoc bn cng c th dng cu lnh:
[root@proxy tmp]# ps aux
MT VI V D
Gii hn truy cp web theo thi gian
Chng ta c th to ACL vi cc thng s l thi gian. V d, nu mun ch cho php truy cp
web trong thi gian lm vic, trong khi cm truy cp n host 192.168.1.123, chng ta thc
hin nh sau:
#
# Thm cc dng ACL ny vo pha trn trong on ACL trong
squid.conf
#
acl home_network src 192.168.1.0/24
acl business_hours time M T W H F 9:00-17:00
acl RestrictedHost src 192.168.1.23
#
# Thm cc pht biu sau vo phn di cng ca on
http_access trong file squid.conf
#
http_access deny RestrictedHost
http_access allow home_network business_hours
#
# Thm vo phn u tin ca on http_access trong squid.conf
#
http_access deny BadSites
http_access allow home_network business_hours GoodSites
Gii hn truy cp web theo IP
Squid Proxy trong sut cho php client kt ni internet m khng cn phi cu
hnh g. Mi cu hnh u ti server. Vi Squid t phin bn 2.6 tr i cu
hnh proxy trong sut ch cn thm vo file cu hnh dng:
http_port 3128 transparent