Article title: implement the Internet "filter function" in Linux ". Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
At present, many schools have built campus networks and connected to the Internet, but there are a lot of bad information on the internet. how can we filter out websites to prevent the impact of unhealthy websites on students? Based on the principle of zero cost and high efficiency, let's talk about how to implement Internet filtering in free Linux.
Set proxy server
The campus network accesses the Internet through Linux and uses Squid to build proxy servers on the Gateway.
First, install Linux. I use RedHat Linux 7, which is easy to install and use. 2. when installing RedHat Linux 7.2, Squid has been installed at the same time. you only need to configure it.
After RedHat Linux 7.2 is installed, Apache is not running by default. Therefore, you should enable Squid to ensure that the Squid proxy server works properly. Modify the/etc/squid. conf configuration file.
Http_port 3128 (defines the port for Squid to listen to HTTP client requests)
Cache_mem 10 MB (Squid can use an ideal memory value, usually set to 1/3 of the physical memory)
Cache_swap_low 95
Cache_swap_low 90
Maximum_object_size 4096 KB (objects larger than this value will not be stored)
Cache_dir ufs/var/spool/squid/cache 200 16 256 (specify Squid to store the swap space of the object and its directory structure)
Acl all src 192.168.1.1/24 (defined as 192.168.1.1 network segment)
Http_acceaa allow all (clients in the 192.168.1.1 network segment can use the Squid proxy to access the Internet)
Cache_inclutive_user squid (user and user group used)
Cache_effective_group squid (use the default value for other parameters)
[Root @ squid bin] # chmod 777/var/spool/squid/cache (set the/var/spool/squid/cache directory to a Noboay user with write permission)
[Root @ squid bin] # squid-z (manually create the Squid cache directory/var/spool/squid/cache)
[Root @ squid bin] #/etc/rc. d/init. d/squid start (start Squid, stop Squid with/etc/rc. d/init. d/squid stop)
Test on the client. take Windows as an example. Run IE, click "tools", click "Internet Options", click the "connection" tab, and click "LAN settings". in the "LAN settings" window, fill in the IP address of the Squid server in "address": 192.168.1.16, fill in "3128" in "port", and then exit. In this case, the client should be able to browse the Internet, indicating that Squid is running properly.
[1] [2] [3] Next page