Windows Squid Installation Configuration

Source: Internet
Author: User

Squid can do reverse proxies to cache the relatively static pages in the system and to be responsible for equalization,
Improve website access speed, enhance site availability, security.
The user accesses the IP address of the Squid reverse proxy server so that the client's URL request is sent to the reverse proxy server.
If the requested resource is cached in the Squid reverse proxy server, the requested resource is returned directly to the client.
Otherwise, the reverse proxy server requests the resource from the backend Web server and then returns the requested answer to the client.
The answer is also cached locally for use by the next requestor.

It is as follows:

Install squid steps in Windows:
1. Download the installation files for squid windows from http://squid.acmeconsulting.it.
You can also download it from http://download.csdn.net/detail/kkdelta/4474605.
Download and unzip the squid in the C \ Directory (default), you can also put squid to other paths,
However, you need to configure a lot of path information in the Squid configuration file.
2. rename files under the ETC folder
Squid.conf.default ==> squid.conf
Mime.conf.default ==> mime.conf
Cachemgr.conf.default ==> cachemgr.conf
3, simple configuration squid.conf, so that the configuration to achieve the effect of

Visible_hostname squidhost
#设定squid的主机名, no squid will start
Http_port 3128 accel vhost vport
# Set squid to Accel acceleration mode, vhost must be added. Otherwise, the host header cannot be forwarded to the back-end server,
#访问时就会出现无法找到主机头的错误
Cache_peer 147.151.240.234 parent 8080 0 No-query originserver round-robin name=webserver1
Cache_peer 147.151.241.151 parent 8080 0 no-query Originserver Round-robin name=webserver2
cache_peer_domain  webserver1 webserver2 localhost
#将 localhost request via RR The polling method is forwarded to one of the 2 parent nodes.
#http://localhost:3128 requests are forwarded to 147.151.240.234:8080 or 147.151.241.151:8080
ACL all src 0.0.0.0/0.0.0.0
Http_access Allow all

4 to start squid
c:\squid\sbin>squid-z #创建cache目录.
C:\squid\sbin>squid #启动squid

Test:
launches 147.151.240.234 and 147.151.241.151 Tomcat and puts a test.jsp file on it.
The test.jsp output on the 151 machine is the JSP in Tomcat instance 151 
test.jsp output on 234 machines The JSP in Tomcat instance 234
Access http:/ /localhost:3128/xxxweb/test.jsp will output the above results in turn.
access to a JSP is forwarded to the Web server each time: X-cache: miss from squidhost


    1. [Email protected]dora-wls9-1 bin]# curl-i http://147.151.240.52:3128/examples/jsp/test.jsp
    2. http/1.0 OK
    3. server:apache-coyote/1.1
    4. set-cookie:jsessionid=f3c10d53a916b1852d06687e9e581a2f; Path=/examples
    5. Content-type:text/html
    6. content-length:972
    7. DATE:FRI, Geneva 17:51:01 GMT
    8. X-cache:miss from Squidhost
    9. X-cache-lookup:miss from squidhost:3128
    10. via:1.0 squidhost:3128 (SQUID/2.6.STABLE22)
    11. Connection:close

Access to a static HTML is forwarded to the Web server each time: X-cache:hit from Squidhost


    1. [Email protected] bin]# curl-i http://147.151.240.52:3128/examples/jsp/test.html
    2. http/1.0 OK
    3. server:apache-coyote/1.1
    4. Accept-ranges:bytes
    5. etag:w/"26-1343982480000"
    6. LAST-MODIFIED:FRI, Geneva 08:28:00 GMT
    7. Content-type:text/html
    8. Content-length:26
    9. DATE:FRI, Geneva 17:28:54 GMT
    10. age:195
    11. <span style= "color: #FF0000;" ></span>x-cache:hit from Squidhost
    12. X-cache-lookup:hit from squidhost:3128
    13. via:1.0 squidhost:3128 (SQUID/2.6.STABLE22)
    14. Connection:close

Windows Squid Installation Configuration

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.