apt-proxy

最後更新: 2015-04-15

介紹

 

如果有幾架同版本的 Server , 而他們又要安裝同樣的 Security Upgrade

那同一個 .deb 下載幾次又慢, 那有什麼好辦法呢 ??

那用 apt-proxy 吧

它是一個 HTTP-based proxy server 來, 靠 openbsd-inetd 先執行, default port: 9999

homepage: http://apt-proxy.sourceforge.net/

Program: C

 

 

Install

apt-get install approx

/usr/sbin/approx-gc
/usr/sbin/approx-import
/usr/sbin/approx
/usr/sbin/approx-update
 


Usage

 

/etc/inetd.conf

9999            stream  tcp     nowait  approx  /usr/sbin/approx /usr/sbin/approx

/etc/approx/approx.conf

# remote repository

debian          http://ftp.tw.debian.org/debian

# download rate from remote repositories (bytes/s)
$max_rate    unlimited

# facility to use
$syslog    daemon

 

Remark

就算 "$verbose        true" Client Download 過咩都無無 log 到

 

cache 的位置在 /var/cache/approx

dists/
├── squeeze
│   ├── contrib
│   │   ├── binary-i386
│   │   │   └── Packages.gz
│   │   └── i18n
│   ├── main
│   │   ├── binary-i386
│   │   │   └── Packages.gz
│   │   └── i18n
│   ├── non-free
│   │   ├── binary-i386
│   │   │   └── Packages.gz
│   │   └── i18n
│   ├── Release
│   └── Release.gpg
└── squeeze-lts
    ├── contrib
    │   ├── binary-i386
    │   │   └── Packages.gz
    │   └── i18n
    ├── main
    │   ├── binary-i386
    │   │   └── Packages.gz
    │   └── i18n
    ├── non-free
    │   ├── binary-i386
    │   │   └── Packages.gz
    │   └── i18n
    ├── Release
    └── Release.gpg

pool/
└── main
    └── t
        └── tree
            └── tree_1.5.3-1_i386.deb

 


Client setting

 

example:

deb http://server:9999/debian squeeze-lts main contrib non-free
deb http://server:9999/debian squeeze main contrib non-free

 


Mapping

 

repository: http://remote-host/initial/path

Client fetch: http://approx-server/repository/rest/of/URL
Server fetch: http://remote-host/initial/path/rest/of/URL
Cache location: /var/cache/approx/repository/rest/of/URL

 

 

 

 

 

 

Creative Commons license icon Creative Commons license icon