                       apt-proxy README
                    http://apt-proxy.sf.net

              Chris Halls <halls@debian.org>

This is part of the Debian GNU/Linux package for apt-proxy.

If you have installed apt-proxy using the Debian package, you now need to
do the following:

1. Edit apt-proxy.conf to select the nearest backend servers for you.  See
   the apt-proxy.conf(5) manpage and the supplied apt-proxy.conf for details.
2. Point your apt clients to the proxy.  See the apt-proxy(8) manpage for
   details.  The supplied apt-proxy.conf contains example lines for
   sources.list along with the backend examples.
3. run apt-get update on a client, to initialise the archive directories and
   filelists.
4. If you have an apt cache directory full of .debs, you can use
   apt-proxy-import(8) to copy them into the apt-proxy archive.  You must have
   completed steps 1-3 first.

If you are installing from the source tar.gz, for example on a non-Debian
machine, have a look at INSTALL for manual installation instructions.

Version 1.x of apt-proxy is now in maintainence mode only - new features and
improvements are going into version 2, which is implemented in Python using the
Twisted.net framework.  See the web page for more details and how to download
version 2.

Using apt-proxy with Debian Potato
----------------------------------
Since I modified the build scripts to use debhelper 3, it is no longer possible
to build this package on Potato.  However, you can still install and use a
package that has been built on a Woody system, or downloaded from the Woody
archives.  (Thanks to Thorsten Gunkel for testing this and other aspects of the
package.)

Frequently Asked Questions
--------------------------
Here are some of the issues that have been raised about apt-proxy:

- Initial configuration of the apt-proxy server -

Q: How do I start apt-proxy?

A: You don't need to - it is run by inetd, which is configured when apt-proxy
   is installed.  Just point your apt clients at HOSTNAME:9999 and inet will
   start apt-proxy on demand.  This also means configuration files changes take
   effect immediately.

Q: Which is the most efficient backend protocol to use?

A: Use http for all backends.  Backends which have large Packages files (i.e.
   the main Debian and non-US archives) can benefit from using the rsync
   protocol to transfer uncompressed Packages files (if available) using the
   special '+' prefix.  See the BACKEND SERVERS section of apt-proxy.conf(5)
   for more details.

Q: apt-proxy refuses to serve files and apt reports 500 Bad Configuration

A: There is a problem with the syntax in an add_backend line in apt-proxy.conf.
   One common mistake is to try to comment out a line which is continued from
   the last line:
   
   add_backend /main/                 \
   $APT_PROXY_CACHE/debian/           \
   #       ftp.us.debian.org::debian/ \    <---- This does not work
           ftp.de.debian.org::debian/ 

   You should either delete the line, or move it further down to follow a line
   that does not end in a backslash.

- Client setup -

Q: A connection cannot be established with apt-proxy on a remote machine.
   Nothing appears in the apt-proxy.log file.

A: apt-proxy is run by tcpd, which may deny connections depending on how it is
   set up.  If a connection is denied by tcpd, you will find a log message in
   /var/log/daemon.log such as:
       apt-proxy[nnnn]: refused connect from <hostname>

   You should check /etc/hosts.allow and hosts.deny.  For example, the standard
   ALL: PARANOID in /etc/hosts.deny will deny acess to clients whose hostname
   cannot be looked up.

Q: Is apt-proxy really a proxy or is it an HTTP server?

A: Strictly speaking, apt-proxy behaves like an HTTP server, not a proxy.  It
   is very similar in concept to a proxy, because it sits between the client
   and the backend server, forwarding requests to remote servers.  With a true
   proxy, such as Squid, apt sends a request to the proxy for a file from
   another site, such as ftp.debian.org.  Yet this doesn't make sense for
   apt-proxy, because it decides itself which backend to use depending on
   availablilty and type of file requested.  It also has the advantage that all
   the apt clients do not have to be reconfigured whenever there is a change to
   the backend server that is to be used.

Q: My web proxy does not know about the apt-proxy machine (for example, you are
   using a proxy at your ISP), and I can't get apt to contact apt-proxy, even
   though I have added this to apt.conf: 
   
       Acquire::http::Proxy::<host> "DIRECT";

A: Have you got http_proxy set?  From the apt.conf manpage:
      "The http_proxy environment variable will override all settings."
   
   So you must unset http_proxy before running apt.

- apt-proxy-import -

Q: apt-proxy-import reports 'No backend filelists found' and won't import anything.

A: You must have at least one apt client visit your brand new, empty cache to
   initialise it.  This client must have lines in its sources.list that point
   to the apt-proxy and sucessfully run 'apt-get update' or equivalent.

- Using apt-proxy with other clients -

Q: What else is apt-proxy known to work with?  How do I configure it?

A1: wget.  For example, to get the Woody Release file:
         wget http://localhost:9999/main/dists/woody/Release
    
    If you normally use a proxy, and that proxy is not aware of the machine that
    apt-proxy is running, on you may need to specify --proxy=off.

A2: debootstrap, which uses wget.  This means you can easily install new
    machine using the packages out of your apt-proxy cache.  In boot floppies,
    specify http://APTPROXY:9999/main as your debian mirror (replacing APTPROXY
    with the name or IP address of the machine where apt-proxy is running).

A3: rootstrap, a tool for making root images for user-mode-linux.  Assuming
    that you are running rootstrap on the same machine as apt-proxy and have
    used the default network addresses 192.168.10.x, put this in
    rootstrap.conf:

        mirror=http://192.168.10.1:9999/main

    [Note: during testing, we encountered a strange problem where rootstrap
    thought the architecture was i386-none, so we had to add --arch=i386 to the
    deboostrap call in /usr/lib/rootstrap/modules/debian.]

A4: pbuilder, which also uses debootstrap.  Add this to /etc/pbuilderrc:

        MIRRORSITE=http://APTPROXY:9999/main
        NONUSMIRRORSITE=http://APTPROXY:9999/non-US

September 2002
