Configure Squid Proxy Server for RHCE notes

Source: Internet
Author: User
Tags gopher squid proxy
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.