Install and configure Squid for AutoQA

= Introduction =

Squid is a caching proxy. Its purpose it to speed up repeated access to Internet resources by caching data and then providing them to its clients using a fast LAN instead of slower Internet access. In AutoQA we after download a lot of large files (RPM packages, ISO images, etc). Several tests may need the same data. When developing the test, we may need to run the same test (using the same data) over and over again. You can considerably speed up test execution time by keeping the files locally (on the proxy) instead of re-downloading them from web server all the time. This guide will help you install Squid proxy and configure it for AutoQA use.

This guide supposes you already have AutoQA installed.

= Install and configure Squid =

 Install Squid proxy: # yum install squid  Edit  Uncomment directive and set the allowed max size of the cache dir. Example: cache_dir ufs /var/spool/squid 20000 16 256 sets the max cache dir size to 20 GB. Add directive and set its value to the largest file size you want to cache. Example: maximum_object_size 5 GB allows to cache DVD-sized files. Optional: Disable caching from some domains. If you have some files/mirrors already on your local network and you don't want to cache those files (the access is already fast enough), you can specify it using and  directives. This example disables caching of all traffic coming from  domain: acl redhat dstdomain .redhat.com cache deny redhat  Start Squid service: # service squid start  Enable Squid service on boot: # chkconfig squid on  Make sure iptables or SELinux do not block Squid operating on port 3128 (the default value).</li> </ol>

Test Squid
Confirm that Squid is working by executing following commands from localhost and a remote machine: $ export http_proxy=http://your_proxy:3128 $ wget http://server/file $ wget http://server/file

Wget output should indicate that it has connected to your proxy. The second request for the same file should be much faster. (Note: https requests can't be cached.)

The cache dir size should be growing with every new request. Confirm by: $ du -sh /var/spool/squid

You should see all the proxy requests by inspecting the log.

= Configure AutoQA =

We will now set your Squid proxy as the default proxy for all requests on your test clients:


 * 1) On your server with AutoQA installed edit
 * 2) Set   variable: http_proxy = http://your_proxy:3128

All your future test runs should download files using this proxy (you can confirm that by inspecting the proxy log).