Chapter 9. Mirrors and proxies

lpm uses libwww to access primary repositories published on the web. All ancillary libwww features are available. Example: set the http_proxy to access remote repositories through an HTTP proxy:

export http_proxy
lpm options

Accessing remote repositories involves multiple HTTP requests. The first request is always If lpm receives an HTTP redirect to this first request, lpm continues to use the new URL for all remaining requests. This makes it possible to mirror a repository in one of two ways.

  1. Configure's web server to redirect all requests for to a randomly selected

  2. Use DNS-based load balancing, in addition to a local redirect script. Note that this approach distributes all HTTP requests with the same domain name, not just lpm's requests. Here's a hypothetical example with three mirrors:

    www          IN    A
    www          IN    A
    www          IN    A
    mirror1      IN    A
    mirror2      IN    A
    mirror3      IN    A

    mirror1's web server must be configured to respond with a redirect request for any URL to, for any pathname. Similarly, mirror2 must redirect any URL to, and mirror3 must redirect

    The repository's published URL is Each access to the remote repository goes to one of the three servers, at random, which responds with a redirect to its actual hostname. The benefit of this approach is that it avoids burdening a single server with redirect requests from all clients.