In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "how to configure and install Squid3.0 reverse proxy under centos", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to configure and install Squid3.0 reverse proxy under centos" article.
Installation:
The application environment of this tutorial is clean centos 5.5. pre-partition and load / data partition, and close selinux and iptables
First modify the file descriptor and set the temporary port range, which will take effect after restart
The copy code is as follows:
Cat > > / etc/security/limits.conf / etc/sysctl.conf / etc/rc.local
Maintenance section:
Here are the commands commonly used by squid
If the configuration file has been modified, reread the configuration file with the following command (effective immediately)
/ usr/local/squid3/sbin/squid-k reconfigure
Check that the syntax of the configuration file is correct
Note: only "cache_cf.cc (346) squid.conf:14 unrecognized: 'http1_port'" like this is a syntax error.
"warning: use of 'reload-into-ims'." Such tips belong to opinions and suggestions and can be ignored.
/ usr/local/squid3/sbin/squid-k parse
Check the log and process of squid to see if squid is running properly.
Ps-ef | awk'/ ^ squid/'
Cat / data/squidlog/cache.log
/ usr/local/squid3/sbin/squid-k check; echo $?
Close squid
Send a shutdown signal and close completely when the session is over
/ usr/local/squid3/sbin/squid-k shutdown
Turn off squid (higher priority, turn off squid directly)
/ usr/local/squid3/sbin/squid-k interrupt
Turn off squid (highest priority, directly kill the squid process)
/ usr/local/squid3/sbin/squid-k kill
Scroll log file
/ usr/local/squid3/sbin/squid-k rotate
Set the log to scroll automatically at 04:30 every Tuesday morning
Echo "30 4 * * 2 root / usr/local/squid3/sbin/squid-k rotate" > > / etc/crontab
At present, the squid.conf files in the application are directly exported to / dev/null and discarded because the log files are growing rapidly.
The copy code is as follows:
# basic
Cache_effective_user squid
Cache_effective_group squid
Pid_filename / usr/local/squid3/var/logs/squid.pid
Visible_hostname squid.678114.com
Cache_mgr sudu@sudu.us
Error_directory / usr/local/squid3/share/errors/simplify_chinese
Icon_directory / usr/local/squid3/share/icons
Mime_table / usr/local/squid3/etc/mime.conf
Hosts_file / etc/hosts
Acl deipadd dstdom_regex [0-9] $
Http_access deny deipadd
Cache_replacement_policy lru
Memory_replacement_policy lru
Http_port 80 vhost vport
Cache_mem 4024 mb
Maximum_object_size_in_memory 5120 kb
Icp_port 0
#. Cache_dir
Cache_dir aufs / data/cache 50000 64 128
Max_open_disk_fds 0
Maximum_object_size 20 mb
#. Cache_peer
Cache_peer 125.76.225.44 parent 80 0 no-query originserver no-digest name=all
Cache_peer_domain all .678114.com
# acl
Acl safe_ports port 80
Acl ssl_ports port 443
Acl lansrc src 192.168.100.0/24
Acl webdomain dstdomain .678114.com
Acl manager proto cache_object
Acl localhost src 127.0.0.1/255.255.255.255
Acl connect method connect
Http_access allow manager localhost
Http_access deny manager
Http_access deny! safe_ports
Http_access deny connect! ssl_ports
Http_access allow lansrc
Http_access allow webdomain
Http_access deny all
# refresh_pattern
Refresh_pattern-I / $1590% 600 reload-into-ims
Refresh_pattern-I .html $1590% 600 reload-into-ims
Refresh_pattern-I .htm $1590% 600 reload-into-ims
Refresh_pattern-I. shtml $1590% 600 reload-into-ims
Refresh_pattern-I .hml $1590% 600 reload-into-ims
Refresh_pattern-I. gif $1440 129600 reload-into-ims
Refresh_pattern-I. SWF $1440 129600 reload-into-ims
Refresh_pattern-I. jpg $1440 129600 reload-into-ims
Refresh_pattern-I. PNG $1440 129600 reload-into-ims
Refresh_pattern-I. BMP $1440 129600 reload-into-ims
Refresh_pattern-I. js $120 90% 129600 reload-into-ims
Refresh_pattern-I. CSS $120 90% 129600 reload-into-ims
Refresh_pattern-I. WMA $1440 21600 reload-into-ims
Refresh_pattern-I. zip $1440 21600 reload-into-ims
Refresh_pattern-I. MP3 $1440 21600 reload-into-ims
Refresh_pattern-I. rar $1440 21600 reload-into-ims
Refresh_pattern-I. RM $1440 21600 reload-into-ims
Refresh_pattern-I. FLV $1440 21600 reload-into-ims
Refresh_pattern-I. rar $1440 21600 reload-into-ims
Refresh_pattern-I. RM $1440 21600 reload-into-ims
Refresh_pattern-I. Avi $1440 21600 reload-into-ims
Refresh_pattern-I. 3GP $1440 21600 reload-into-ims
Refresh_pattern-I. MP4 $1440 21600 reload-into-ims
Refresh_pattern-I. WMV $1440 21600 reload-into-ims
# keepalived
Client_persistent_connections off
Server_persistent_connections on
# log
Emulate_httpd_log on
Logformat web1 {x-forwarded-for} > h ui un [tl] "rm ru http/%rv" hs
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.