Changing the location of the approx cache (symlink)

  Move your cache where you want it, then
  replace the /var/cache/approx directory by a symlink:

      mv /var/cache/approx /somewhere
      ln -s /somewhere/approx /var/cache/approx
      
  The advantage with this method is that the weekly cron job in charge of
  removing old files (/etc/cron.weekly/approx) still works. However, if
  you want multiple config files with multiple cache paths, this approach
  doesn't help.

Changing the location of the approx cache (configuration)

  Use the $cache parameter in /etc/approx/approx.conf. Make sure the
  specified location exists and is owned by the approx user and group.
  Use a subdirectory for the cache, not a top-level filesystem with a
  lost+found directory in it.

  Note that this will break the weekly cron job (/etc/cron.weekly/approx),
  you will have to edit this file and adjust the cache path. See #930328
  for more details.

Changing the temporary directory used by approx

  The TMPDIR environment variable can be used to specify the temporary
  directory used by approx. Please see the section on
  "Passing environment variables to approx", below.

Using approx with xinetd

  An example configuration file is provided in
  /usr/share/doc/approx/examples/approx.xinetd

Exporting a local package repository

  This is supported with file URLs. Note that the syntax for file URLs
  requires 3 leading slashes (two for the URL syntax, and one for
  the root of the pathname). So you can add something like this
  to /etc/approx/approx.conf:

      local   file:///my/local/repo

  The repo must have the structure that apt expects, including a
  Packages.bz2 index. You can maintain a local repo with a tool like
  dpkg-scanpackages or reprepro.

Changing the TCP port on which approx listens

  Modify the "ListenStream" line in approx.socket file.

Changing the IP addresses on which approx listens

  Modify the "ListenStream" line in approx.socket file (see systemd.socket(5)
  manual page for more information).

Controlling access to approx using TCP wrappers (hosts.allow and hosts.deny)

  The /etc/hosts.allow and /etc/hosts.deny files can be used for
  host-based control of the approx service.

  After adding the appropriate entries (see the hosts_access(5) manual page),
  add the line
      OPTIONS="-l"
  to the file /etc/default/openbsd-inetd and then restart openbsd-inetd.

Making approx use a proxy for its downloads

  Since approx uses the curl(1) command to download files from
  remote repositories, you can use the http_proxy environment variable
  (or one of the others documented in the curl(1) manual page).
  Please see the section on "Passing environment variables to approx", below.

Handling high client load

  The openbsd-inetd version of inetd limits the rate of requests by default.
  See the inetd(8) man page for ways to change the limit.

Passing environment variables to approx

  The openbsd-inetd version of inetd passes only certain environment
  variables to servers. Here are some workarounds:

  1. Modify the inetd.conf entry for approx to run an executable wrapper
     script instead of the /usr/sbin/approx binary. You can use something
     like this for the wrapper:

         #!/bin/sh
         export MY_ENVIRONMENT_VARIABLE=...
         exec /usr/sbin/approx

  2. Modify the inetd.conf entry for approx to run the "/usr/bin/env" command,
     with the desired environment variable settings and "/usr/sbin/approx"
     as arguments.

Passing options to the curl(1) command used by approx

  Use the above method to pass the CURL_HOME environment variable to approx,
  and use the file $CURL_HOME/.curlrc to specify the desired curl options.

  For example, adding the line "--ipv4" to this file will force curl to
  resolve hostnames to IPv4 addresses only.
