Basic Configuration

Previous | Contents | Next

- Chapter 3: Basic Configuration
  - 3.1 Server Configuration
  - 3.2 Client Configuration

# Chapter 3: Basic Configuration

## 3.1 Server Configuration

Unlike some rumors on the internet claim, there should be no need for exhausting configuration work to just test apt-cacher-ng and run it with default parameters. It's actually designed to bootstrap most of its working environment without additional help.

The package setup scripts used by distributions should already prepare working initial settings for apt-cacher-ng. Check the file `/etc/apt-cacher-ng/acng.conf` file where most settings are explained. For the beginning they should not be changed, the only interesting setting present there is the TCP port. See Advanced Server Configuration for details.

There is also a daily cron job which executes some maintenance work. Additional automated control commands can be added by administrator.

## 3.2 Client Configuration

From the client side, apt-cacher-ng can be used as a drop-in replacement for apt-cacher. The same rules apply, e.g. Debian/Ubuntu users should EITHER:

- Specify the caching machine as HTTP Proxy for APT, e.g. putting a line like the following into a file like /etc/apt/apt.conf.d/02proxy:

      Acquire::http { Proxy "http://CacheServerIp:3142"; };

OR:

- Replace all mirror hostnames with cachinghost/hostname in sources.list, so

      deb http://ftp.uni-kl.de/debian etch main

  should now become:

      deb http://192.168.0.17:3142/ftp.uni-kl.de/debian etch main

(assuming that CacheServerIp is 192.168.0.17 and the service port is 3142).

Mixing both configuration methods is not recommended and will lead to obscure APT failures in most cases.

Additionally, leading path component containing "apt-cacher/" or "apt-cacher?/" might be ignored by the server during the URL processing. This is intended behavior and exists to maintain backwards compatibility to sources.list entries configured for early versions of Apt-Cacher (based on CGI technology).