This section briefly introduces the configuration of the proxy server squid, which has previously recorded the reverse proxy configuration, but is more widely used in the production environment for proxy and forward transparent proxy, this is also the focus of the RHCE test [root @ localhost ~] # Yum-yinstallsquid [root @ localhost ~] # Grep-v '^ #'/etc/squid. conf | uniq // view the squid after removing the comment line
This section briefly introduces the configuration of the proxy server squid, which has previously recorded the reverse proxy configuration, but is more widely used in the production environment for proxy and forward transparent proxy, this is also the focus of the RHCE examination.
[Root @ localhost ~] # Yum-y install squid
[Root @ localhost ~] # Grep-v '^ #'/etc/squid. conf | uniq // view the squid configuration file after removing the comment line
Acl all src 0.0.0.0/0.0.0.0 // define the acl range
Acl manager proto cache_object
Acl localhost src 127.0.0.1/255.255.255.255
Acl to_localhost dst 127.0.0.0/8
Acl SSL_ports port 443
Acl Safe_ports port 80 # http
Acl Safe_ports port 21 # ftp
Acl Safe_ports port 443 # https
Acl Safe_ports port 70 # gopher
Acl Safe_ports port 210 # wais
Acl Safe_ports port 1025-65535 # unregistered ports
Acl Safe_ports port 280 # http-mgmt
Acl Safe_ports port 488 # gss-http
Acl Safe_ports port 591 # filemaker
Acl Safe_ports port 777 # multiling http
Acl CONNECT method CONNECT
Http_access allow manager localhost // defines the acl for which access is allowed or denied. Pay attention to the policy sequence. If the policy sequence is matched, allow
Http_access deny manager
Http_access deny! Safe_ports
Http_access deny CONNECT! SSL_ports
Http_access allow localhost
Http_access deny all // reject all at the end of the policy
Icp_access allow all
Http_port 3128 // define the enabled Port
Hierarchy_stoplist cgi-bin?
Access_log/var/log/squid/access. log squid // location where access logs are stored
Acl QUERY urlpath_regex cgi-bin \?
Cache deny QUERY
Refresh_pattern ^ ftp: 1440 20% 10080
Refresh_pattern ^ gopher: 1440 0% 1440
Refresh_pattern. 0 20% 4320
Acl apache rep_header Server ^ Apache
Broken_vary_encoding allow apache
Coredump_dir/var/spool/squid