This is G o o g l e's cache of http://www.debianclub.com/node/26 as retrieved on 15 Feb 2007 23:42:16 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?hl=en&q=cache%3Ahttp%3A%2F%2Fwww.debianclub.com%2Fnode%2F26&btnG=Search


Google is neither affiliated with the authors of this page nor responsible for its content.

User login

Links

debianclub.com
debian.org
ubuntuclub.com
blognone.com

Syndicate

Syndicate content

ทำแคชให้ apt ด้วย apt-proxy

apt-proxy เป็นซอฟต์แวร์ที่ใช้เก็บแพคเกจ apt ใครมีเครื่องลินุกส์ที่ใช้แพคเกจ apt ในหน่วยงานตั้งแต่สองเครื่องขึ้นไป ควรติดตั้งไว้ที่เครื่องเซิร์ฟเวอร์เป็นอย่างยิ่งครับ

เอามาจาก : ThaiLinuxCafe - ทำแคชให้เดเบียนแพคเก็จด้วย apt-proxy
โฮมเพจอยู่ที่ : http://apt-proxy.sourceforge.net/
ขอไว้อาลัยและอุทิศกุศลแด่ : คุณ Manuel Estrada Sainz (ranty) และคุณ Andrés García (ErConde) ผู้พัฒนาด้วยครับ

ที่เครื่องเซิร์ฟเวอร์
สมมุติว่าเซิร์ฟเวอร์ชื่อ server1.example.com ไอพี 192.168.1.5

เริ่มติดตั้งด้วย
# aptitude install apt-proxy

ปรับตั้งแพคเกจนิดหน่อย
# vi /etc/apt-proxy/apt-proxy-v2.conf

...
max_age = 120d        ;; อายุแพคเกจในแคช ผมใช้ 360d
...
[debian]
backends =
        http://ftp.us.debian.org/debian
        ;;http://mirror.in.th/debian
        ...
...
[security]
backends =
        http://security.debian.org/debian-security
        ...
...
[ubuntu]
backends =
        http://th.archive.ubuntu.com/ubuntu        
        http://mirror.in.th/ubuntu/archive
        ...
...
[ubuntu-security]
backends = 
        http://security.ubuntu.com/ubuntu
...

สั่งเริ่มใหม่
# /etc/init.d/apt-proxy restart
ก็สามารถใช้งานได้แล้ว

ที่เครื่องลูกข่าย
เวลาเรียกใช้งานจากเครื่องลูก เราแก้ไขไฟล์ /etc/apt/sources.list ให้มาใช้ของเรา
$ sudo vi /etc/apt/sources.list

ถ้าเป็นเดเบียน

deb     http://server1.example.com:9999/debian/ etch main contrib non-free
deb-src http://server1.example.com:9999/debian/ etch main contrib non-free
deb     http://server1.example.com:9999/security/ etch/updates main contrib non-free
deb-src http://server1.example.com:9999/security/ etch/updates main contrib non-free

ถ้าเป็นอูบุนตู

deb     http://server1.example.com:9999/ubuntu/ edgy main restricted universe multiverse
deb-src http://server1.example.com:9999/ubuntu/ edgy main restricted universe multiverse
deb     http://server1.example.com:9999/ubuntu/ edgy-updates main restricted universe multiverse
deb-src http://server1.example.com:9999/ubuntu/ edgy-updates main restricted universe multiverse
deb     http://server1.example.com:9999/ubuntu-security/ edgy-security main restricted universe multiverse
deb-src http://server1.example.com:9999/ubuntu-security/ edgy-security main restricted universe multiverse

หมายเหตุ

  • ตรง server1.example.com อาจใช้เป็นเลขไอพี 192.168.1.5 ก็ได้
  • สำหรับเครื่องแม่ข่ายเอง อาจใช้ของตัวเองโดยเปลี่ยน server1.example.com เป็น localhost ก็ได้
  • แพกเกจนี้ยังมีข้อผิดพลาดอยู่ เนื่องจากผู้พัฒนาเสียชีวิตไปเสียก่อน เมื่อเครื่องลูกข่ายรอนานผิดปกติ หรือเกิดข้อผิดพลาดขึ้น อาจต้องเริ่มเซอร์วิสที่เซิร์ฟเวอร์ใหม่บ้างเป็นบางครั้ง แต่ผมว่าคุ้มค่ากับการประหยัดแบนวิธครับ
  • ผมเคยใช้เทียบกับ apt-cacher พบว่า apt-proxy ฉลาดกว่า เลยชอบใช้มากกว่า ถึงแม้จะยังมีบั๊กอยู่ ถ้าท่านใดมีประสบการณ์ apt-cacher รบกวนโพสต์เล่าให้ฟังบ้างนะครับ :)


both

เคย ใช้ทั้ง apt-cacher และ apt-proxy ครับ จำไม่ได้ว่าใช้ตัวไหนก่อน แล้วเปลี่ยนไปลองอีกตัว เพราะเจอปัญหาอาการค้างเมื่อดาวน์โหลดแพกเกจใหญ่ๆ แล้วก็ปรากฏว่าไปเจอปัญหาเดียวกันอีกอยู่ดี

แต่โดยทั่วไปมันใช้การได้ดีเลยนะครับ แต่อย่างว่า ชีวิต admin มันห้ามมีปัญหาใดๆ ผมเลยเปลี่ยนมาใช้อีกวิธีหนึ่งแทน คือทำ sub-mirror ด้วย apt-move เตรียมไว้ให้เลย