Difference between revisions of "Package Proxy Cache"

From ArchWiki
Jump to: navigation, search
(Some cosmetic changes (sentences start with an upper-case and end with a period, etc.))
(Manual Arch Install)
Line 57: Line 57:
 
Now just use /arch/setup to normally install the system, and it should use your proxy. Watch the squid logs to verify this.
 
Now just use /arch/setup to normally install the system, and it should use your proxy. Watch the squid logs to verify this.
  
{{Note|If you want to use the proxy in the installed system, you need to add the http_proxy and/or ftp_proxy variables in an appropriate place.}}
+
{{Note|If you want to use the proxy settings in the installed system, you need to add the http_proxy and/or ftp_proxy variables in an appropriate place on the installed system.}}
  
 
==Automatic Arch Install==
 
==Automatic Arch Install==

Revision as of 14:42, 17 September 2010

Introduction

If you want to install the same Arch packages over and over - like for testing AIF profiles - it could help if you wouldn't have to get the packages every time from the internet. This article shows you how to setup a Squid proxy that only caches arch packages and can be used with aif/pacman/wget/etc with minimal configuration on the client system.

Note: This document is still under testing!

Install Squid

Template:Cli

Configure Squid

This is the minimum configuration to get squid cache arch packages.

Cache Rules

Before defining these rules, remove/comment (if you don't need them) all the default refresh_patterns Template:File That should define that *.pkg.tar.* gets cached, and anything else should not.

Maximum Filesize

Objects larger than this size will NOT be saved on disk: Template:File

Cache Directory

Set the cache dir and its maximum size and subdirs: Template:File

Note:

Every time you change the cache_dir path (and after fresh install), you need to (re)create this directory: Template:Cli and it could be helpful to check the config file before running squid: Template:Cli

Start Squid

Template:Cli or if squid is already running: Template:Cli

Note:

It could be helpful to check the config file before running: Template:Cli

Follow Squid access log

To see the access to squid: Template:Cli You should see this for packages that are directed to original host: Template:Cli and for packages that are delivered from the cache: Template:Cli

Manual Arch Install

Before running /arch/setup, add variables for your proxy. To do so, run on the console: Template:Cli

Now just use /arch/setup to normally install the system, and it should use your proxy. Watch the squid logs to verify this.

Note: If you want to use the proxy settings in the installed system, you need to add the http_proxy and/or ftp_proxy variables in an appropriate place on the installed system.

Automatic Arch Install

After login in the arch install image, setup your network (eg. `dhcpcd eth0`) and get this AIF profile on it.

Warning: This PARTITIONS AND FORMATS the defined device, so please go through the whole file before you run it!

Template:File And install the system according to that profile: Template:Cli Now sit back, and enjoy the automation :)

Tip: Watch the squid logs, specially that on the second run you get TCP_HIT and NONE

After the setup is done, the installed system should use your proxy for pacman/wget/etc.