2016年4月9日星期六

Block specific keyword in Squid Proxy squidproxy屏蔽关键字

INTRODUCTION

After learning how to block website using ban list, so now in this short guide I am going to tell you how to restrict any websites based on keywords in squid proxy server.
Blocking keywords in squid proxy server is very helpful for the system administrators in colleges and schools networks.

SOLUTION

Let’s start
Same as we make ban_domains list in my previous article, I will store all keywords in ban_keywords.txt file which you wish to block.
Step 1:
create list:
# vi /etc/squid/ban_keywords.txt
Add keywords
gambling
spyware
bad
Step 2:
Add ACL to block website by reading ban_keywords.txt file.
Edit /etc/squid/squid.conf file:
# vi /etc/squid/squid.conf
ACL:
acl bad_keywords url_regex “/etc/squid/ban_keywords.txt”
http_access deny bad_keywords
Step 3:
Restart Squid
# systemctl restart squid.service
Try to search ban keywords in search engine, you will get squid default blocked message in browser.

没有评论:

发表评论