Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The installation and configuration method of DansGuardian in Linux Server

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the installation and configuration of DansGuardian in the Linux server". In the daily operation, I believe that many people have doubts about the installation and configuration of DansGuardian in the Linux server. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about the installation and configuration of DansGuardian in the Linux server. Next, please follow the editor to study!

DansGuardian

DansGuardian can restrict client access, and through this software, we can restrict which websites are not accessible and which content cannot be downloaded.

1. Download DansGuardian and provide a URL of http://www.rpmfind.net/linux/RPM/dag/redhat/el5/i386/dansguardian-2.8.0.6-1.2.el5.rf.i386.html

2. Installation

[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. Modify the configuration file "/ etc/dansguardian/dansguardian.conf", search "filterport" and change the port to 8088. The default is 8080, which conflicts with tomcat. With regard to the proxyport port, the proxy server port is used. The default is 3128. If you modify the proxy port, then change it to the corresponding port here.

[root@localhost wj] # gedit / etc/dansguardian/dansguardian.conf

# the port that DansGuardian listens to.

Filterport = 8088

4. Configure the firewall and open port 8088 of tcp

[root@localhost wj] # gedit / etc/sysconfig/iptables

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 8088-j ACCEPT

[root@localhost wj] # service iptables restart

Iptables: set chain to policy ACCEPT:filter nat [OK]

Iptables: clear firewall rules: [OK]

Iptables: uninstalling module: [OK]

Iptables: apply firewall rules: [OK]

Iptables: load additional modules: nf_conntrack_ftp [OK]

5. Start the service

[root@localhost wj] # service dansguardian start

Shutting down Web Content Filter (dansguardian): [OK]

Start Web Content Filter (dansguardian): [OK]

6. Modify the proxy settings of the client, change the proxy port to dansguardian port 8088, and then go to Baidu for some content, and the bad websites will be blocked. Note that the port must be modified and 3128 cannot be used.

7. Add filtering URL.

1) modify the configuration file "/ etc/dansguardian/bannedsitelist" and append the URL to be filtered. Restart the service

[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

Shutting down Web Content Filter (dansguardian): [OK]

Start Web Content Filter (dansguardian): [OK]

2) the client accesses Baidu News

8. Filter keywords

1) modify the configuration file "/ etc/dansguardian/bannedphraselist" and append the URL to be filtered. Restart the service

[root@localhost wj] # gedit / etc/dansguardian/bannedphraselist

# To block any page with words that contain the string "sex". (ie. Sexual)

[root@localhost wj] # service dansguardian restart

Shutting down Web Content Filter (dansguardian): [OK]

Start Web Content Filter (dansguardian): [OK]

2) use the client browser to search sex and find that the web page cannot be opened

9. Filter downloads

1) modify the configuration file "/ etc/dansguardian/bannedextentsionlist". By default, there are many formats that are forbidden to download. If you want to remove a restriction, add # in front of it.

[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

Shutting down Web Content Filter (dansguardian): [OK]

Start Web Content Filter (dansguardian): [OK]

2) use the client browser to download a file

10. Check the log. You can use the log file "/ var/log/dansguardian/access.log" to analyze what is currently blocked.

[root@localhost wj] # gedit / var/log/dansguardian/access.log

File extension prohibited by Sella&utm_term=wkjxxx0913 * DENIED*: .exe GET 0

August 15, 2018.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

At this point, the study on "the installation and configuration of DansGuardian in the Linux server" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report