這篇文章主要介紹“Linux服務(wù)器中DansGuardian的安裝配置方法”,在日常操作中,相信很多人在Linux服務(wù)器中DansGuardian的安裝配置方法問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”Linux服務(wù)器中DansGuardian的安裝配置方法”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!

網(wǎng)站建設(shè)哪家好,找
成都創(chuàng)新互聯(lián)!專(zhuān)注于網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開(kāi)發(fā)、
成都小程序開(kāi)發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了
閩清免費(fèi)建站歡迎大家使用!
DansGuardian
DansGuardian可以限制客戶端的訪問(wèn),通過(guò)這個(gè)軟件,我們可以限制哪些網(wǎng)站不可以訪問(wèn)、哪些內(nèi)容不能下載。
1、下載DansGuardian,提供一個(gè)網(wǎng)址http://www.rpmfind.net/linux/RPM/dag/redhat/el5/i386/dansguardian-2.8.0.6-1.2.el5.rf.i386.html
2、安裝
[root@localhost wj]# rpm -ivh dansguardian-2.8.0.6-1.2.el5.rf.i386.rpm
warning: dansguardian-2.8.0.6-1.2.el5.rf.i386.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing... ########################################### [100%]
1:dansguardian ########################################### [100%]
|
3、修改配置文件“/etc/dansguardian/dansguardian.conf
”,搜索“filterport”將端口改為8088。默認(rèn)是8080,和tomcat沖突。關(guān)于proxyport端口,使用的是proxy服務(wù)器端口,默認(rèn)3128,如果你修改了proxy的端口,那么這里也要改成對(duì)應(yīng)的端口。
[root@localhost wj]# gedit /etc/dansguardian/dansguardian.conf
# the port that DansGuardian listens to.
filterport = 8088
|
4、配置防火墻,打開(kāi)tcp的8088端口
[root@localhost wj]# gedit /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8088 -j ACCEPT
[root@localhost wj]# service iptables restart
iptables :將鏈設(shè)置為政策 ACCEPT : filter nat [ 確定 ]
iptables :清除防火墻規(guī)則: [ 確定 ]
iptables :正在卸載模塊: [ 確定 ]
iptables :應(yīng)用防火墻規(guī)則: [ 確定 ]
iptables :載入額外模塊: nf_conntrack_ftp [ 確定 ]
|
5、啟動(dòng)服務(wù)
[root@localhost wj]# service dansguardian start
正在關(guān)閉 Web Content Filter (dansguardian) : [ 確定 ]
啟動(dòng) Web Content Filter (dansguardian) : [ 確定 ]
|
6、修改客戶端的代理設(shè)置,將代理端口改成dansguardian的端口8088,然后去百度一些內(nèi)容,不良的網(wǎng)站就被屏蔽了。注意,這里端口必須修改,不可以使用3128.


7、增加過(guò)濾網(wǎng)址。
1)修改配置文件“/etc/dansguardian/bannedsitelist”,在后面追加要過(guò)濾的網(wǎng)址。重啟服務(wù)
[root@localhost wj]# gedit /etc/dansguardian/bannedsitelist
# You will need to edit to add and remove categories you want
news.baidu.com
[root@localhost wj]# service dansguardian restart
正在關(guān)閉 Web Content Filter (dansguardian) : [ 確定 ]
啟動(dòng) Web Content Filter (dansguardian) : [ 確定 ]
|
2)客戶端訪問(wèn)百度新聞

8、過(guò)濾關(guān)鍵字
1)修改配置文件“/etc/dansguardian/bannedphraselist”,在后面追加要過(guò)濾的網(wǎng)址。重啟服務(wù)
[root@localhost wj]# gedit /etc/dansguardian/bannedphraselist
# To block any page with words that contain the string "sex". (ie. sexual)
<sex>
[root@localhost wj]# service dansguardian restart
正在關(guān)閉 Web Content Filter (dansguardian) : [ 確定 ]
啟動(dòng) Web Content Filter (dansguardian) : [ 確定 ]
|
2)使用客戶端瀏覽器搜索sex,發(fā)現(xiàn)網(wǎng)頁(yè)打不開(kāi)


9、過(guò)濾下載內(nèi)容
1)修改配置文件“/etc/dansguardian/bannedextentsionlist”,里面默認(rèn)已經(jīng)有很多被禁止下載的格式了,如果要去掉某個(gè)限制,在前面加#
[root@localhost wj]# gedit /etc/dansguardian/bannedextentsionlist
#Banned extension list
.ade # Microsoft Access project extension
.adp # Microsoft Access project
.asx # Windows Media Audio / Video
.bas # Microsoft Visual Basic class module
.bat # Batch file
.cab # Windows setup file
.chm # Compiled HTML Help file
.cmd # Microsoft Windows NT Command script
[root@localhost wj]# service dansguardian restart
正在關(guān)閉 Web Content Filter (dansguardian) : [ 確定 ]
啟動(dòng) Web Content Filter (dansguardian) : [ 確定 ]
|
2)使用客戶端瀏覽器下載一個(gè)文件

10、查看日志??梢酝ㄟ^(guò)日志文件“/var/log/dansguardian/access.log
”來(lái)分析當(dāng)前哪些內(nèi)容被攔截了。
[root@localhost wj]# gedit /var/log/dansguardian/access.log
Sella&utm_term=wkjxxx0913 *DENIED* 禁止的文件擴(kuò)展名 : .exe GET 0
2018.8.15 16:29:07 - 192.168.0.112 http://xiazai.mindmanager.cc/favicon.ico GET 345
2018.8.15 16:30:28 192.168.0.112
http://trackercdn.kugou.com/i/v2/?cmd=26&pid=4&authType=1&hash=1319C71BC5CBF32EF1495CECDA23AF24&key=b1e358948cb6ce56a6c37cc88f408419&behavior=play&
module=&appid=1155&mid=bc7ba9731b77d3e10d329f751e774f1c&userid=0&token=&version=2.6.4&vipType=0&album_id=517209 GET 318
|
到此,關(guān)于“Linux服務(wù)器中DansGuardian的安裝配置方法”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!
網(wǎng)頁(yè)標(biāo)題:Linux服務(wù)器中DansGuardian的安裝配置方法-創(chuàng)新互聯(lián)
瀏覽路徑:http://chinadenli.net/article22/dehijc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開(kāi)發(fā)、電子商務(wù)、網(wǎng)站營(yíng)銷(xiāo)、企業(yè)網(wǎng)站制作、響應(yīng)式網(wǎng)站、微信小程序
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源:
創(chuàng)新互聯(lián)