From Squid User's Guidebook Note: This details is outdated as of 2.6.
one Accelerator Mode 1.1 When to work with Accelerator Mode one.1.one Acceleration of the slow server
1.one.two Replacing a combination cacheweb server with Squid
1.1.3 Transparent CachingProxy
1.one.4 Security one.2 Accelerator Configuration Possible choices one.two.one The httpd_accel_host opportunity
one.two.2 The httpd_accel_port choice
one.2.3 The httpd_accel_with_proxy selection
one.two.4 The httpd_accel_uses_host_header option
one.2.5 Preference replacements in Squid 2.six 1.2.5.one httpd_accel_* for transparent proxy
one.2.five.2 httpd_accel_host
one.2.five.3 httpd_accel_port
1.two.five.four httpd_accel_uses_host_header
1.two.5.5 Squid Edition two.6 one.3 Related Configuration Alternatives one.3.one The redirect_rewrites_host_header possibility
one.3.two Refresh patterns
1.3.3 Access Manage 1.four Example Configurations 1.four.1 Accelerating Requests to a Slow Server
1.4.2 Replacing a mixture WebCache serverxx Accelerator Mode Some cache servers can act as web servers (or vice versa). These servers accept requests in both equally the common web-request format (wherever only the path and filename are provided), and from the proxy-specific format (where by the entire URL is provided).
The Squid designers have made the decision not to let Squid be configured in this way. This avoids diverse complicated concerns, and reduces code complexity, creating Squid additional reputable. All in all, Squid may be a web site cache, not a web site server.
By adding a translation layer into Squid, we could accept (and fully grasp) web site requests, seeing as the format is basically a similar. The further layer can re-write incoming net requests, transforming the vacation spot server and port. This re-written request is then handled being a typical request: the remote server is contacted, the information requested plus the final results cached. This helps you to get Squid to pretend to become a world wide web server, re-writing requests to ensure they are passed on to some other internet server.
When to work with Accelerator Mode Accelerator mode shouldn't be enabled except you'll need it. You can find a limited set of conditions by which it is necessary, so if amongst the subsequent setups applies for you, it is advisable to possess a have a look at the remainder of this chapter.cc
Acceleration of a slow server Squid can sit before a slow server, caching the server's outcomes and passing the info on to customers. This really is fairly useful when the origin server (the server that is truly serving the original information) is very slow, or is across a slow line). When the origin server is across a slow line, you could potentially just move the origin server closer on the clientele, but this may well not be likely for administrative factors. Do not use Squid to cache web server on the very same machine for speed up, as present day web site server (e.g. httpd) is faster than Squid in serving static contents typically.
Changing a mixture cacheweb server with Squid When you are within the approach of changing a mixture cacheweb server, your consumer devices may very well be configured to discuss for the cache on port eighty. Somewhat than reconfiguring all of you clientele, you will get Squid to pay attention for incoming connections on port 80 (shifting the real server to one more port or server.) When Squid finds that it really is received a web request, it will forward the request towards the origin server, to ensure the machine continues to purpose as the two a world wide web and cache server.
Transparent CachingProxy Squid is usually configured to magically intercept outgoing net requests and cache them. Simply because the outgoing requests are in web-server format, it needs to translate them to cache-format requests. Transparent caching is coated in detail during the following segment.
Security Squid may be placed before an insecure website server to guard it from the exterior world: not merely to prevent undesirable purchasers from accessing the machine, but in addition to avoid persons from exploiting bugs inside server code.
Accelerator Configuration Methods Be sure to be aware as of Squid two.6 these alternatives are already replaced with parameters which have been stated inside the http_port section of your squid.conf file. Their use in Squid 2.6 has become deprecated, be sure to go through beneath for his or her replacements.
The listing of accelerator methods is brief, and setup is relatively basic. After we've a operating accelerator cache, you will have to build the suitable access-list rules. (Due to the fact you probably want individuals outdoors your neighborhood network to be ready to access your server, you can not relatively easy use source-IP tackle rulesets any longer.)
The httpd_accel_host method You will need to set the hostname on the accelerated server right here. It is only conceivable to get an individual location server,
Office Professional 2010, so you can only have one particular occurence of this line. When you're going accelerate over a person server,
Windows 7 64 Bit, or transparently cache traffic (as described inside the upcoming chapter), you'll really need to make use of the word virtual as a substitute of the hostname right here.
The httpd_accel_port option Accelerated requests can only be forwarded to a single port: there's no table that associates accelerated hosts plus a vacation spot port. Squid will connect to your port which you set the httpd_accel_port worth to. When acting being a front-end for a web site server around the community machine, you will definitely set up the internet server to listen for connections on the varied port (8000, for example), and set this squid.conf solution to match similar price. If, about the other hand, that you're forwarding requests to a set of slow backend servers, they may nearly clearly be listening to port 80 (the default web-server port), and this solution will will need to be set to 80.
The httpd_accel_with_proxy choice For those who make use of the httpd_accel_host option, Squid will end recognizing cache requests. In order that your cache can purpose each as an accelerator and being a net cache, you'll need to set the httpd_accel_with_proxy opportunity to on.
The httpd_accel_uses_host_header method A common HTTP request consists of three values: the type of transfer (generally a GET, which is used for downloads); the route and filename to be retrieved (or executed, in the scenario of the cgi system); as well as the HTTP version.
This layout is good if you ever only have one particular website on the machine. On systems where by you've got greater than one web-site, nevertheless, it helps make everyday living difficult: the request will not incorporate plenty of info, as it doesn't involve details about the location domain. Most working programs enable you to have IP aliases, wherever you have got a lot more than a single IP handle per network card. By allocating 1 IP per hosted web-site, you may run a single world wide web server per IP address. After the plans have been developed a great deal more efficient, one running system could act as a server for many websites: the one requirement was you had 1 IP handle per domain. Server applications would track down out which of your IP addresses clients were connected to, and would serve info from completely different directories for each IP.
There's a minimal variety of IP addresses, and they are extremely fast operating out. Some systems also possess a constrained number of IP aliases, meaning that you just can not host over a (pretty arbitrary) variety of websites on machine. If your consumer have been to pass the location host title coupled with the route and filename, the web server could pay attention to just one IP address, and would discover the appropriate destination directores by browsing inside a hassle-free hostname table.
From edition 1.one on, the HTTP conventional involves a unique Host header, which can be passed coupled with each individual outgoing request. This header also would make transparent caching and acceleration less complicated: by pulling the host price from the headers, Squid can translate a ordinary HTTP request to a cache-specific HTTP request,
Windows 7 64 Bit, which may then be dealt with by the typical Squid code. Turning about the httpd_accel_uses_host_header alternative allows this translation. You will need to use this option when performing transparent caching.
It can be imperative to notice that acls are checked before this translation. You have got to merge this possibility with stringent source-address checks, which means you can not use this method to speed up many different backend servers (this can be selected to alter in a later on version of Squid).
Solution replacements in Squid 2.six Within this portion with the Squid documentation only the option replacements and their correlation with the now deprecated options shall be listed, make sure you refer towards the text previously mentioned regarding what just about every opportunity does. Be sure to be aware that a great deal of this is certainly taken instantly through the Squid two.6 Alterations document.
almost certainly, most setup migration from two.5 to 2.six must commence rewriting this par from the conf from scratch :
httpd_accel_* for transparent proxy This has all been replaced by a parameter called transparent that acheives this, please refer towards the segment on Transparent ProxyCache for further information and facts
httpd_accel_host Replaced by defaultsite http_port opportunity and cache_peer originserver choice.
httpd_accel_port No longer necessary. Server port defined by the cache_peer port.
httpd_accel_uses_host_header Replaced by vhost http_port solution
Squid Version 2.six http_port 3128 transparent And transparent
always_direct permit all You'll must locate the proper put and add this line.This replaces the 4 lines above.
Configuration for acceleration of a backend host
http_port eighty defaultsite=<backend ip>
acl port80 port 80
http_access make it easy for port80
always_direct permit all
Connected Configuration Methods So significantly, we've got only coated the Config possible choices that instantly relate to accelerator mode.
The redirect_rewrites_host_header method Refresh patterns Accelerating a slow internet server is only invaluable if the cache can keep copies of returned pages (in order that it could evade contacting the back-end server.) Considering that you know with regards to the backend server, you may specify refresh patterns that suit the machine exactly. Refresh patterns aren't covered right here (they can be covered in-depth in Chapter 11), but it really is value trying at how your webpage improvements, and tuning your refresh patterns to match.
If,
Office 2010 Professional Plus, about the other hand, you might be making use of just implementing accelerator mode to replace a mixture cache (or to act as a secure front-end for an alternative server), you’re able to disable caching of that web page altogether: otherwise you just finish up duplicating information (after about the origin blog, once for your cached copy) with no benefit.
Entry Management Presumably you are going to want individuals from outside your network to be in a position to access the world wide web server that Squid is accelerating. Any time you have based your accessibility lists about the examples during this book, you will uncover that machines on the exterior are unable to accessibility the web site currently being accelerated. The accelerated request is handled specifically like a standard http request, so consumers accesing the blog through the outdoors entire world would be rejected considering your acl rules deny accessibility from IPs which might be not on your network. By utilising the dst acl variety, you'll be able to add certain exclusions to your access lists to allow for requests to your accelerated host.
With the subsequent example,
Windows 7 Serial, we have now changed the config in order that the first rule matches (and permits) any request to your machine at IP 10.0.0.five, the accelerated machine. If we did not have the port acl inside under policies, someone could request a URL having a several port number which has a request that explicitly specifies a non-standard port. If we were to leave out this rule, it could allow a product cracker poke around the procedure with requests for issues like
Illustration Configurations Let's cover two illustration setups: a person, exactly where you happen to be just employing Squid's accelerator function to ensure that the machine has equally a world wide web server along with a cache server on port eighty; two, wherever you are working with Squid as an accelerator to pace up a slow machine.
Accelerating Requests to a Slow Server When accelerating a slow server, you might find that communicating with peer caches is faster than communicating together with the accelerated host. Inside following illustration, we remove all of the selections that quit Squid from caching the server's effects. We also assume that the accelerated host is listening on port 80, considering you can find no conflict with Squid attempting to pay attention to the same exact port. When you have got tested that connecting to Squid brings up the proper pages, you may really have to improve the DNS entry to point in your cache server..
Changing a combination WebCache serverxx First, let's cover the most standard utilization of accelerator mode: replacing a mixture webcache server with Squid. When Squid is acting as an accelerator (speeding up a slow web site server), Squid will accept requests on port eighty (on any IP tackle) and pass them to a cache server on a totally different machine (also on port 80). Seeing that it is unlikely that you simply want to work with two devices where by you can actually use a person (until that you're altering to Squid due to server overload), we'll really need to configure Squid to pass requests to the local machine. Squid will will need to accept incoming requests on port eighty (employing the http_port possibility), and pass the requests on on the web site server on one other port (simply because just one process can listen for requests on port 80 at a time). I typically get website servers to pay attention for requests on port 8000. Seeing that you want Squid to purpose both equally as an accelerator and as a cache server, you will need to implement the httpd_accel_with_proxy selection. The cache with this illustration is the regional machine: there's more or less absolutely no reason to cache benefits from this server. I could have put into use an incredibly conservative refresh_pattern from the under instance, but rather I decide to make use of the no_cache tag: in this way I could make use of my predefined acl. The always_direct tag within the under illustration would be particularly invaluable for those who have a peer cache: you never want the request handed on to a peer machine.