Beginner's Squid Reverse proxy

Source: Internet
Author: User

System version: CentOS 6.6 32-bit

1, installation Squid:yum install Squid-y



2. Configuration file:

Cache_effective_user Squid #用户

Cache_effective_group Squid #组


Http_port 121.42.40.26:80 Accel Vhost #设置启动端口 accel for acceleration mode, vhost to forward requests

Dns_nameservers 8.8.8.8 #DNS服务器设置


Visible_hostname localhost #服务器名 for error page display

cache_mgr [email protected] #管理员邮箱 for error page display

Cache_mem MB #内存缓存大小

Maximum_object_size 4 MB #单文件最大缓存

Cache_dir ufs/var/cache/squid 4096 16 256 # Cache directory size is 4g,16 2 levels, each 2-level directory has 256 subdirectories

Cache_swap_high #控制缓存大小, over 90% clean up

Cache_swap_low #到80% Stop


Logfile_rotate 7 #日志保留七天, with Crontab


Cache_access_log/var/log/squid/access.log #访问日志

Cache_log/var/log/squid/cache.log #缓存日志, the boot information can be seen here.

Cache_store_log/var/log/squid/store.log #网页缓存日志



Cache_peer 121.42.40.26 Parent Bayi 0 originserver name=www #这里把后端web服务器设置为81端口了 alias www

Cache_peer_domain www www.squid.com #实现代理这个web服务器, can proxy multiple servers

Cache_peer_access www. All #允许所有人访问



3. Initialization: Squid-z


4. Starting Squid:/etc/init.d/squid Start


5, 0 3 * * * */usr/sbin/squid-k rotate crontab Add a sentence this, every night three o'clock log cutting


6, to test their own squid is effective



Beginner's Squid Reverse proxy

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.