Squid (transparent proxy), squid Proxy

Source: Internet
Author: User
Tags website server squid proxy

Squid (transparent proxy), squid Proxy

1. squid transparent proxy (one website server and squid Proxy Server)

Vim/etc/squid. conf

Http_port 3128 transparent # transparent proxy keyword

Visible_hostname host name # If the host name is default, it is not required if it is not modified. Otherwise, you need to add

Cache_mem 64 MB # Cache

Cache_dir ufs/var/spool/squid 100 16 256 # cache directory ufs file format 100 indicates cache size 16 indicates level 1 subdirectory 256 indicates level 2 subdirectory

Service squid restart

Enable iptables

Graphical environment # setup or service iptables start

Iptables-t filter-nL # view filter table rules

Iptables-t filter-F # Clear the default rules of the filter table

Iptables-t nat-A nat PREROUTING-s source CIDR Block-p tcp-dport = 80-j REDIRECT -- to-ports 3128

Iptables-t nat-A nat PREROUTING-s source CIDR Block-p tcp-dport = 443-j REDIRECT -- to-ports 3128

++ ++ ++

2. yum-y install httpd elinks # web Site Server

Service httpd start

Chkconfig httpd on

Echo "1111">/var/www/html/index.html

Elinks -- dump http: // localhost/or curl http: // localhost

++ ++ ++

3. Client settings:

Route-n

Route add default gw squid Server IP # add gateway route add default gw squid Server IP # Delete Gateway

Enter the address of the website server in the firefox address bar.

Use tailf/var/log/squid/access. log # To view logs

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.