ข่าว: ข่าวประกาศ

  • 25 เมษายน 2024, 20:01:49

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ผู้เขียน หัวข้อ: ขั้นตอนการสร้าง Ubuntu Mirror Server ด้วย apt-mirror  (อ่าน 9804 ครั้ง)

admin

  • Administrator
  • Hero Member
  • *****
  • กระทู้: 3820
    • ดูรายละเอียด
    • อีเมล์
ขั้นตอนการสร้าง Ubuntu Mirror Server ด้วย apt-mirror
« เมื่อ: 26 สิงหาคม 2010, 11:33:15 »
สำหรับผู้ที่ต้องการสร้าง ubuntu mirror server ไว้เป็นของตัวเอง หรือไว้บริการคนอื่น ๆ ก็สามารถทำไ้ด้ โดยใช้ apt-mirror ดังนี้

1. ทำการติดตั้ง apt-mirror

apt-get install apt-mirror

2. ทำการแก้ไขไฟล์  /etc/apt/mirror.list  เพื่อปรับแต่งค่า ๆ และ Server ที่ต้องการจะดึงมา

#
# set base_path    /var/spool/apt-mirror
#
# if you change the base path you must create the directories below with write privileges
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

deb http://archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse

clean http://archive.ubuntu.com/ubuntu

3. ทำการเรียกคำสั่ง  apt-mirror เพื่อทำการ download ขนาดประมาณ 60G สำหรับ ubuntu 9.10 (karmic)

Downloading 84 index files using 20 threads...
Begin time: Thu Aug 26 03:39:14 2010
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]...
  • ...

End time: Thu Aug 26 03:39:23 2010

Proceed indexes: [SSSPPP]

59.6 GiB will be downloaded into archive.
Downloading 79126 archive files using 20 threads...
Begin time: Thu Aug 26 03:39:30 2010
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]...
  • ...

End time: Thu Aug 26 04:27:56 2010

0.0 bytes in 0 files and 0 directories can be freed.
Run /var/spool/apt-mirror/var/clean.sh for this purpose.

Running the Post Mirror script ...
(/var/spool/apt-mirror/var/postmirror.sh)

/bin/sh: Can't open /var/spool/apt-mirror/var/postmirror.sh

Post Mirror script has completed. See above output for any possible errors.

4. เมื่อ download เสร็จเราก็จะได้ mirror อยู่ใน folder ที่เรา set ไว้ใน base_path

5. สร้าง config สำหรับ apache เพื่อปล่อยให้ผู้อื่นสามารถมาใช้งาน mirror ผ่าน http

ตัวอย่างไฟล์  /etc/apache2/conf.d/mirror

Alias "/ubuntu" "/var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/"
<Location "/ubuntu/">
Order Allow,Deny
Allow from all
Options +Indexes

</Location>

6. ทำการ restart  apache2

7. เราจะได้  apt  sources.list เป็นของตัวเอง คือ

deb http://your-ip-server/ubuntu karmic main restricted universe multiverse
deb http://your-ip-server/ubuntu karmic-security main restricted universe multiverse
deb http://your-ip-server/ubuntu karmic-updates main restricted universe multiverse

deb-src http://your-ip-server/ubuntu karmic main restricted universe multiverse
deb-src http://your-ip-server/ubuntu karmic-security main restricted universe multiverse
deb-src http://your-ip-server/ubuntu karmic-updates main restricted universe multiverse

<a href="http://www.hadyaiinternet.com/images/inetcafe.swf" target="_blank" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">http://www.hadyaiinternet.com/images/inetcafe.swf</a>


There are no comments for this topic. Do you want to be the first?