Article title: Squid implements reverse proxy and has intranet proxy. 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.
All files on my site are static html. to further speed up the webpage, squid is used to implement reverse proxy caching.
@ Install squid
To be lazy, use ports directly for installation. because I have installed all the server systems in the/s partition, I set the PREFIX to/s/squid.
# Cd/usr/ports/www/squid
# Setenv PREFIX/s/squid
# Make install clean
After the installation is complete, edit/s/squid/etc/squid. conf. the configuration content is as follows:
########## Base control ##########
Cache_mgr webmaster
Cache_inclutive_user squid
Cache_paitive_group squid
Visible_hostname sleepcat.3322.org
Http_port 127.0.0.1: 3128
Icp_port 0
Cache_dir ufs/usr/cache 300 16 256
Cache_access_log/dev/null
Cache_log/dev/null
Cache_store_log/dev/null
Error_directory/s/squid/etc/squid/errors/Simplify_Chinese
Icon_directory/s/squid/etc/squid/icons
Mime_table/s/squid/etc/squid/mime. conf
Coredump_dir/s/squid/cache
Pid_filename/s/squid/logs/squid. pid
Hosts_file/etc/hosts
Unlinkd_program/s/squid/libexec/squid/unlinkd
########## Performance control ##########
Cache_mem 8 MB
Cache_swap_low 90
Cache_swap_high 95
Maximum_object_size 4096 KB
Minimum_object_size 0 KB
Maximum_object_size_in_memory 8 KB
Ipcache_size 1024
Ipcache_low 90
Ipcache_high 95
Fqdncache_size 1024
Cache_replacement_policy lru
Memory_replacement_policy lru
Emulate_httpd_log off
Log_ip_on_direct on
Log_mime_hdrs off
Dns_timeout 2 minutes
Request_header_max_size 10 KB
Request_body_max_size 0 KB
Refresh_pattern ^ ftp: 1440 20% 10080
Refresh_pattern ^ gopher: 1440 0% 1440
Refresh_pattern. 0 20% 4320
Negative_ttl 5 minutes
Positive_dns_ttl 6 hours
Negative_dns_ttl 1 minute
Connect_timeout 1 minute
Read_timeout 15 minutes
Request_timeout 5 minutes
Client_lifetime 1 day
Half_closed_clients on
Maximum_single_addr_tries 1
Uri_whitespace strip
Ie_refresh off
[1] [2] Next page