Use squid to speed up your web

Source: Internet
Author: User
Tags squid proxy

From kwang.cn

Yesterday I introduced to you how to use tmpfs to accelerate your linux server. I think it is not enough. Today, I continue to learn the best way to use squid to accelerate your web site, if you are not satisfied with the speed of your web site, try the method I recommend below.
First, you have to have the squid proxy server. I won't talk about how to install it. Just use her rpm for redhat installation.
Configure the squid configuration file to support the httpd accelerator working mode.
Edit the "squid. conf" file (vi/etc/squid. conf) and add the following content:
Http_port 80
Icp_port 0
Acl QUERY urlpath_regex cgi-bin?
No_cache deny QUERY
Cache_mem 16 MB
Cache_dir ufs/tmp 256 16 256
Log_icp_queries off
Buffered_logs on
Emulate_httpd_log on
Redirect_rewrites_host_header off
Half_closed_clients off
Acl all src 0.0.0.0/0.0.0.0
Http_access allow all
Cache_mgr admin
Cache_inclutive_user squid
Cache_paitive_group squid
Httpd_accel_host 210.51.0.124
Httpd_accel_port 81

The http_port parameter specifies the port number that Squid listens to browser client requests. Of course, 80 is used here.
Cache_dir ufs/tmp 256 16 256
The cache_dir parameter sets the type of the storage system used. Generally, the data type should be ufs and the directory should be "/tmp". The buffer value used in this directory is 256 MB, the number of first-level sub-directories allowed to be created under "/tmp" is 16, and the number of second-level sub-directories that can be created under each first-level sub-directory is 256

The options "httpd_accel_host" and "httpd_accel_port" define the Real Web server host name and port number. In the configuration, the real HTTP server runs on the host with the IP address 210.51.0.124 (www.5ilinux.com) and the running port is 81.
OK. squid settings are complete.
Next, set apache. You only need to set your httpd listening port to 81, and then restart apache.
Restart your squid service. Now you have used squid's http acceleration mode to access your web site. You can view squid's log to view its running status.
I still haven't figured out how to use the VM together. The above method only implements one domain name. I wonder if you have done squid acceleration for the VM. Please refer to it.
Frank posted on January 14,200 | Reply (11) | reference (1)


Reply


It is very easy to configure the virtual host with squid. Read the instructions carefully.


1. httpd_accel_host virtual


2. httpd_accel_uses_host_header on (For details, refer to it carefully !!!)


The most important thing is to change something in apache :)


1. port 8080 (because squid occupies 80, or just for example)


2. NameVirtualHost x. x: 8080)


Correct the error. I have been using it for a long time and have no problems.

 

 

 

 

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.