แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - golfreeze

Pages: 1 ... 132 133 [134] 135 136 ... 146
1996
Setting up bounding is easy with RHEL v4.0.

Step #1: Create a bond0 configuration file

Red Hat Linux stores network configuration in /etc/sysconfig/network-scripts/ directory. First, you
need to create bond0 config file:

# vi /etc/sysconfig/network-scripts/ifcfg-bond0   ###Append following lines to it: DEVICE=bond0
IPADDR=192.168.1.20
NETWORK=192.168.1.0
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes     ####Replace above IP address with your actual IP address. Save file and exit to shell prompt.

Step #2: Modify eth0 and eth1 config files:

Open both configuration using vi text editor and make sure file read as follows for eth0 interface

#vi  /etc/sysconfig/network-scripts/ifcfg-eth0    ##Modify/append directive as follows: DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=noneOpen eth1 configuration file using vi text editor:

# vi /etc/sysconfig/network-scripts/ifcfg-eth1

###Make sure file read as follows for eth1
interfaceEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=noneSave file and exit to shell prompt.

Step # 3: Load bond driver/module

Make sure bonding module is loaded when the channel-bonding interface (bond0) is brought up. You
need to modify kernel modules configuration file:

# vi /etc/modprobe.confAppend following two
lines:alias bond0 bonding
options bond0 mode=balance-alb miimon=100Save file and exit to shell prompt. You can learn more
about all bounding options in kernel source documentation file (click here to read file online).

Step # 4: Test configuration

First, load the bonding module:# modprobe bondingRestart networking service in order to bring up
bond0 interface:# service network restartVerify everything is working:# less
/proc/net/bonding/bond0Output:

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:59

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:63

List all interfaces:# ifconfigOutput:

bond0 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:2804 errors:0 dropped:0 overruns:0 frame:0
TX packets:1879 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:250825 (244.9 KiB) TX bytes:244683 (238.9 KiB)

eth0 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec6:be59/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:2809 errors:0 dropped:0 overruns:0 frame:0
TX packets:1390 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:251161 (245.2 KiB) TX bytes:180289 (176.0 KiB)
Interrupt:11 Base address:0x1400

eth1 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec6:be59/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:258 (258.0 b) TX bytes:66516 (64.9 KiB)
Interrupt:10 Base address:0x1480

1997
#ถ้าเราจะ check mounting nfs server

#showmount -e

ครับ

1998
พอดี วันก่อน เครื่อง nfs server ได้ reboot ใหม่ครับเพราะ remote เข้าไม่ได้ แล้วก็ reboot เครื่อง nfs
client ตาม

เมื่อ nfs client boot มาแล้วจะทำการ mount ไปที่ path ของ nfs server แล้วเกิด error แบบนี้ครับ
Mounting NFS file systemsNFS Portmap: RPC: Program not registered
เป็นเพราะ socket มันค้างครับเลย ทำให้ client mount ไม่ได้
ก็สามารถแก้ได้โดย
รัน command ที่เครื่อง server ก่อนครับ
#killall -TERM nfsd
#killall -hup mountd
#nfsd -u -t -n 4

-----------------------------------------------
รัน command ที่เครื่อง client
#mount hybird.local:/usr/local/www/apache22/data /usr/local/www/apache22/data
#mount hybird.local:/usr/local/www/apache22/data/www /usr/local/www/apache22/data/www

แล้วทำการ restart service squid 1 ครั้งครับ
#/usr/local/etc/rc.d/squid restart

1999
###เหอๆ ทำการ recovery root password ใน freebsd 6.2

วันนี้ พอดีมีเครื่องที่ต้องลงใหม่ครับ แต่ว่าจะเปลี่ยนจาก
freebsd 6.2 ไปเป็น debian

ก็เลยลอง recovery ดูซึ่งปกติ ของ freebsd ก็คงเป็นรูปแบบเดิมครับ
ไม่ได้ยากอะไรก็เริ่มแรก boot เข้าเป็น แบบ single mode ใน menu ครับ

แล้วเมื่อมันถามว่า
When prompted Enter full pathname of shell or RETURN for /bin/sh:
เป็นการถามว่าจะใช้ shell /bin/sh หรือเปล่าก็ให้กด Enter ไปครับ

สั่งให้ mount path / ครับ
#mount -t /
#mount -a

แล้วสั่ง เปลี่ยน pass root เลยโดย
#passwd

แค่นี้ก็เรียบร้อยครับ

golfreeze[at]packetlove.com

2000
ถ้าสมมติมี error ว่าไม่เจอ CDROM ตอนสั่ง write แผ่นให้ทำการตรวจสอบ

ชื่อ device ว่าถูกหรือเปล่า ดังนี้

#wodim -scanbus

ควรใส่ device ให้ตรงด้วยครับ สมตติ os detect เจอ

1,1,0 101) 'HL-DT-ST' 'CDRW/DVD GCCT20N' 'A103' Removable CD-ROM

ก็สั่ง write เป็น

#cdrecord dev=1,1,0 driveropts=burnfree -dao -overburn -v debian-40r3-i386-CD-1.iso

ครับ อิอิ

2001
พอดีวันนี้ ว่าจะลง debian ใหม่ เลยใช้ server linux โหลดมาครับ
#wget ftp.freedebain.com/debian-40r3-i386-CD-1.iso
ลง ตัว write packet ใน linux ผมใช้
#apt-get install cdrecord

เริ่ม write
#cdrecord dev=0,0,0 driveropts=burnfree -dao -overburn -v debian-40r3-i386-CD-1.iso

เสร็จแล้วก็ mount มาดูไฟล์ครับ
#mkdir -p /mnt/cdrom
#mount -t iso9660 /dev/cdrom /mnt/cdrom

เหอๆ เรียบร้อย อิอิ

any problems feel free to contact
golfreeze[at]packetlove.com

2002
iptables -t nat -I PREROUTING -p <protocol> --dport <destination port> -j DNAT
--to-destination <destination IP>:<destination port>

2003
## ถ้ามี map port ด้วยก็

#iptables -t nat -A PREROUTING -i eth0 -j DNAT -s globalip -p tcp --dport 80 --to privateip:80

2004
พอดีมี โจทย์มาให้ก็คือ ทำเป็น nat server ครับโดยที่

10.x.x.6 forward packet ทุกport ไปที่ 192.x.x.6
10.x.x.7 forward packet ทุกport ไปที่ 192.x.x.7

แล้วตัว load balance ก็ให้ส่ง packet เข้า
10.x.x.52 ส่ง load ไปที่ 192.x.x.52

เราก็ set ได้ดังนี้
เริ่มต้น ต้องสร้าง ip aliase ไว้ก่อนครับ ผมเลือกใช้เป็น debian เพราะเป็น linux ซึ่งมันใช้งานพวก
network ดีมากๆ อยู่แล้ว
#ifconfig eth0:0 10.x.x.6 netmask x.x.x.x up
#ifconfig eth0:0 10.x.x.7 netmask x.x.x.x up

เสร็จแล้วก็ทำ การเขียน rule ของ nat โดยใช้ iptables ครับ
##ขาเข้ามา
#iptables -t nat -A PREROUTING -j DNAT -i eth0 -d 10.x.x.6 --to 192.x.x.6
#iptables -t nat -A PREROUTING -j DNAT -i eth0 -d 10.x.x.7 --to 192.x.x.7

##ขาออกครับ
#iptables -t nat -A POSTROUTING -j SNAT -o eth0 -s 192.x.x.6 --to 10.x.x.6
#iptables -t nat -A POSTROUTING -j SNAT -o eth0 -s 192.x.x.7 --to 10.x.x.7

ทำการ forward traffic ที่เครื่อง nat server ด้วยนะครับผม
#echo 1 > /proc/sys/net/ipv4/ip_forward
#sysctl -p

2006
SPF (Sender Policy Framework ) เป็นส่วนเสริมของโพรโตคอลรับ-ส่งอีเมล์
ที่ช่วยให้ระบบเมล์ของผู้รับ สามารถตรวจสอบและปฏิเสธการรับเมล์จากแหล่งที่มีการ
ปลอมแปลงชื่อผู้ส่งได้ ซึ่งโดยส่วนใหญ่แล้ว อีเมล์ที่มีการปลอมชื่อผู้ส่งมักจะเป็นสแปม
ทั้งหลายนั่นเอง และเมล์ที่ไม่มีการปลอมแปลงชื่อผู้ส่ง ก็มักจะไม่ใช่สแปม

โดยปกติแล้วโพรโตคอล SMTP จะรับอีเมล์จากผู้ส่งทุกราย ซึ่งง่ายต่อการส่งอีเมล์ขยะ
จากบรรดาผู้ส่งสแปม โดยปลอมแปลงชื่อผู้ส่งเป็นอีกชื่อหนึ่ง ทำให้ยากต่อการตรวจสอบว่า
แท้จริงแล้วเมล์ฉบับนั้นถูกส่งมาจากที่ไหน และสามารถปลอมแปลงชื่อผู้ส่งเป็นบุคคล
ผู้รับให้ความเชื่อถือได้ง่าย เพื่อให้เมล์ฉบับนั้นมีโอกาสถูกเปิดอ่านมากขึ้น

SPF จึงเข้ามามีบทบาทในการกำหนดข้อมูลชนิดพิเศษใน DNS ซึ่งผู้ที่เป็นเจ้าของ
โดเมนสามารถระบุลงไปได้ว่า อีเมล์ที่ส่งจากโดเมนของตน จะถูกส่งออกจากเซิฟเวอร์เครื่องใด
ได้บ้าง เมื่อผู้รับได้รับอีเมล์จากโดเมนดังกล่าว ก็จะตรวจสอบว่าอีเมล์นั้นถูกส่งมาจากหมายเลข
ไอพีที่ระบุไว้จริงหรือไม่ หากไม่อยู่ในรายการไอพีที่ผู้ส่งได้ประกาศไว้
ก็สามารถปฏิเสธการรับเมล์ดังกล่าวได้

ในระบบ Antispam บางระบบอย่าง Spamassassin ไม่ได้ใช้ SPF ในการปฏิเสธการรับอีเมล์
ที่ผิดกฎ SPF โดยทันที แต่ใช้ SPF เป็นเกณฑ์อย่างหนึ่งในการหาค่าความเป็นสแปมของจดหมาย
ซึ่งหากจดหมายฉบับใดตรวจแล้วได้ผลเป็น SPF_PASS ก็จะมีคะแนนความเป็น spam ลดลง
แต่ถ้าจดหมายฉบับได้ได้ผลเป็น SPF_FAIL ก็จะมีคะแนนเพิ่มขึ้น ซึ่งคะแนนนี้จะถูกนำไปรวมกับ
กฎข้ออื่นๆที่ออกแบบไว้ในระบบเพื่อหาคะแนนรวมสุดท้ายเป็นตัวชี้ขาดว่าอีเมล์ฉบับนั้นเป็นสแปมหรือไม่

SPF กำลังเป็นที่นิยมอย่างมากในปัจจุบัน สินค้า Antispam ทั้งในและต่างประเทศต่างก็นำ SPF เข้ามา
ใช้ในระบบ และโฆษณาให้ผู้ซื้อทราบว่าสินค้าของตนมีเทคโนโลยี SPF นี้อยู่ภายใน อย่างไรก็ดี
จากข้อมูลสถิติในระบบ MailCleaner กลับพบว่า อีเมล์ที่ผ่านการตรวจสอบด้วย SPF กลับเป็น
จดหมายขยะจำนวนมากถึง 3800 ฉบับต่อสัปดาห์ จากอีเมล์ที่ผ่านการตรวจสอบด้วย SPF
จำนวน 1 แสนฉบับต่อสัปดาห์ ซึ่งเป็นอัตราที่มากพอสมควรสำหรับกฎที่มีผลถึงขนาดปฏิเสธการรับอีเมล์
สาเหตุที่เป็นเช่นนี้เพราะผู้ส่งสแปมในประเทศไทยจำนวนไม่น้อย ใช้ฟรีอีเมล์ที่มีการกำหนด SPF
ในการส่งสแปม อีเมล์เหล่านี้จึงมาจากเครื่องเซิฟเวอร์ที่ถูกต้องตามหมายเลขไอพีที่ประกาศไว้
ซึ่งพฤติกรรมเช่นนี้แตกต่างกับผู้ส่งสแปมในต่างประเทศที่ใช้วิธีตั้งเมล์เซิฟเวอร์ขึ้นเองเพื่อใช้
ในการส่งสแปมโดยเฉพาะ การใช้ SPF ในต่างประเทศจึงมีประโยชน์ในการป้องกัน spam
ได้มากกว่า ในประเทศไทย นอกจากนี้เมล์ server ในประเทศไทยจำนวนมากก็ยังไม่ได้
ตั้งค่าใน DNS ในส่วนของ SPF ทำให้เมล์ขององค์กรนั้นๆ มีโอกาสถูกตรวจสอบผิดเป็นสแปม
มากขึ้นอีกด้วย

เพื่อให้ SPF สามารถนำมาใช้งานในประเทศไทยอย่างได้ประโยชน์สูงสุด
การรณรงค์ให้เมล์เซิฟเวอร์แต่ละแห่งตั้งค่า SPF ใน DNS เป็นสิ่งที่ควรกระทำควบคู่ไปกับ
การเข้มงวดกวดขันของผู้ให้บริการฟรีอีเมล์ต่างๆ แต่ในมุมมองของผู้ให้บริการป้องกันจดหมายขยะ
ซึ่งอยู่ในฝั่งผู้รับอีเมล์แล้ว การใช้ SPF แบบเต็มที่ตามก้นฝรั่งยังเป็นสิ่งที่ไม่ควรกระทำ
แต่ควรใช้อย่าง ระมัดระวังโดยการปรับลดความสำคัญของกฎที่เกี่ยวข้องกับ SPF ลงมาในระดับหนึ่ง
ให้เหมาะสมกับอัตราความแม่นยำของมัน ณ เวลานี้ หรือเพิ่มข้อกำหนดให้ไม่คิดคะแนน SPF
ให้กับเมล์ที่มาจากฟรีอีเมล์ที่มีผู้ใช้ในการส่งสแปม เป็นต้น

ขอขอบคุณ ข้อมูลจาก เว็บ : http://mailcleaner.in.th/

2007
วันก่อนลง Debian 4.0 เพื่อไปแข่งงาน Airraid ครับ
รายละเอียดที่

http://golfreeze.packetlove.com/guyblog/?p=25#more-25

ขั้นตอนแรกก็ ใส่ sources.list ครับดังนี้

deb http://202.29.6.10/pub/debian/etch main
deb-src http://202.29.6.10/pub/debian/etch main


#deb http://mirror.in.th/debian/etch main
#deb-src http://mirror.in.th/debian/etch main

deb http://202.29.6.10/pub/debian-security/etch/updates main contrib
deb-src http://202.29.6.10/pub/debian-security/etch/updates main contrib

#deb http://ftp.psu.coe.ac.th/debianetch main
#deb-src http://ftp.psu.coe.ac.th/debianetch main

deb http://ftp.thaios.net/debian/etch main
deb-src http://ftp.thaios.net/debian/etch main

----------------------------------------------------------------------------
เริ่มลุยเลย
#apt-get install xorg*
#apt-get install gnome*
#apt-get install xserver-xorg*

เสร็จแล้ว

ถ้าใครได้ใช้ remote-desktop เพื่อจะ remote ต่อไปที่ VNC หรือ remote-desktop ของ window ก็ต้องลง

tsclient ครับ เป็น remote desktop ที่ใช้ใน gnome


#apt-get install tsclient

เลือกใช้ Protocol เป็น RDP สำหรับ remote-desktop ใน window น่ะครับ


และถ้าใครอยากลอง 3ddesktop ที่เป็นหน้าจอ หรูหน่อยก็
#apt-get install 3ddesktop
อิอิ

golfreeze[at]packetlove.com

2008
##Centos by yum

cd /root
wget -nd -vhttp://www.qmailtoaster.org/download/develop/clamav-toaster-0.93.1-1.3.19.src.rpm
yum install rpm-build
yum install bzip2-devel gmp-devel zlib-devel curl-devel libidn-devel
rpmbuild --rebuild --with cnt50 clamav-toaster-0.93.1-1.3.19.src.rpm
mv /usr/src/redhat/RPMS/i386/clamav-toaster-0.93.1-1.3.19.i386.rpm .
rpm -Uhv clamav-toaster-0.93.1-1.3.19.i386.rpm

2009
How to Install Source RPMs

Sometimes the packages you want to install need to be compiled in order to match your kernel
version. This requires you to use source RPM files:

* Download the source RPMs or locate them on your CD collection. They usually have a file
extension ending with (.src.rpm)
* Run the following commands as root:

Compiling and installing source RPMs with Fedora can be done simply with the rpmbuild command

[root@bigboy tmp]# rpmbuild --rebuild filename.src.rpm

Here is an example in which we install the tacacs plus package.

[root@bigboy rpm]# rpmbuild --rebuild tac_plus-4.0.3-2.src.rpm
Installing tac_plus-4.0.3-2.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.61594
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf tac_plus-4.0.3
+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/tac_plus-4.0.3.tgz
+ tar -xvvf -
...
...
...
+ umask 022
+ cd /usr/src/redhat/BUILD
+ rm -rf tac_plus-4.0.3
+ exit 0
[root@bigboy rpm]#

The compiled RPM file can now be found in one of the architecture subdirectories under
/usr/src/redhat/RPMS directory. For example, if you compiled an i386 architecture version of the RPM
it will placed in the i386 subdirectory.

You will then have to install the compiled RPMs found in their respective subdirectories as you
normally would.


RPM Installation Errors

Sometimes the installation of RPM software doesn't go according to plan and you need to take
corrective actions. This section shows you how to recover from some of the most common errors
you'll encounter.


Failed Dependencies

Sometimes RPM installations will fail giving Failed dependencies errors which really mean that a
prerequisite RPM needs to be installed. In the next example we're attempting to install the MySQL
database server application, which fails because the mysql MySQL client RPM, on which it depends,
needs to be installed beforehand:

[root@bigboy tmp]# rpm -Uvh mysql-server-3.23.58-9.i386.rpm
error: Failed dependencies:
libmysqlclient.so.10 is needed by mysql-server-3.23.58-9
mysql = 3.23.58 is needed by mysql-server-3.23.58-9
[root@bigboy tmp]#

Installing the MySQL client also fails because it requires the perl-DBD-MySQL package.

[root@bigboy tmp]# rpm -Uvh mysql-3.23.58-9.i386.rpm
error: Failed dependencies:
perl-DBD-MySQL is needed by mysql-3.23.58-9
[root@bigboy tmp]# rpm -Uvh perl-DBD-MySQL-2.9003-4.i386.rpm
error: Failed dependencies:
libmysqlclient.so.10 is needed by perl-DBD-MySQL-2.9003-4
[root@bigboy tmp]#

Strangely enough, the installation of the perl-DBD-MySQL package fails because it needs the mysql
client package. To get around this problem you can run the rpm command with the --nodeps option to
disable dependency checks. In the next example we install the MySQL client ignoring dependencies,
followed by successful installation of perl-DBD-MySQL and mysql-server.

[root@bigboy tmp]# rpm -Uvh --nodeps mysql-3.23.58-9.i386.rpm
Preparing... ####################### [100%]
1:mysql ####################### [100%]
[root@bigboy tmp]# rpm -Uvh perl-DBD-MySQL-2.9003-4.i386.rpm
Preparing... ####################### [100%]
1:perl-DBD-MySQL ####################### [100%]
[root@bigboy tmp]# rpm -Uvh mysql-server-3.23.58-9.i386.rpm
Preparing... ####################### [100%]
1:mysql-server ####################### [100%]
[root@bigboy tmp]#

Note: If all the installation RPMs are located in the same directory, the rpm command can
automatically install all the prerequisite RPMs using the --aid option. One of the advantages of
using the yum facility is that you don't have to worry about this dependency process as much
because the dependency RPMs are always downloaded and installed automatically also.
Signature Keys

Fedora digitally signs all its RPM files, so it's best to import their public encryption key
beforehand so that the RPM installation program will be able to verify the validity of the RPM
file.

This is usually done automatically in newer versions of Fedora, but will need to be done manually in
legacy versions. The manual method uses the rpm command as seen in the next example, but locate the
key files first as their locations can vary between Fedora distributions. It is a good idea to
import both the RedHat and Fedora keys:


[root@bigboy tmp]# locate RPM-GPG-KEY
/usr/share/rhn/RPM-GPG-KEY
/usr/share/rhn/RPM-GPG-KEY-fedora
[root@bigboy tmp]# rpm --import /usr/share/rhn/RPM-GPG-KEY
[root@bigboy tmp]# rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
[root@bigboy tmp]#

If you don't install the keys you'll get a DSA signature warning that alerts you to the fact
that the RPM file might be bogus:

[root@bigboy tmp]# rpm -Uvh dhcp-3.0pl2-6.16.i386.rpm
warning: dhcp-3.0pl2-6.16.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing... #################################### [100%]
1:dhcp #################################### [100%]
[root@bigboy tmp]#

It is always good to install the key files. If they are not there, the RPMs will install with only a
warning message. If the RPM's digital signature doesn't match that in the key file, the rpm
installation program also alerts you and fails to install the RPM package at all:

[root@bigboy tmp]# rpm -Uvh dhcp-3.0pl2-6.16.i386.rpm
error: dhcp-3.0pl2-6.16.i386.rpm: V3 DSA signature: BAD, key ID 4f2a6fd2
error: dhcp-3.0pl2-6.16.i386.rpm cannot be installed
[root@bigboy tmp]#

Signatures are therefore useful because they help protect you against tampered and otherwise
corrupted RPMs being installed.

2010
วันนี้ มี ทริปเรื่องการใช้ งาน tool ในการลง package มาฝากเพื่อนๆ ครับ

เริ่มตั้งแต่ tool ที่ใช้กับ CentOS และ Redhat Enterprise version ต่างๆ น่ะครับ

ซึ่ง tool มีตั้งแต่ Yum , up2date , apt-get สำหรับตัวที่ผมชอบใช้ก็ คือ yum ครับ สำหรับการติดตั้ง
ก็อย่างข้างบน และสำหรับ การลง link นั้นก็คือ
เราต้องหา link ที่เขาเปิดให้เราไป update package มาไว้ในเครื่องครับ ซึ่งเป็นหลักการ ของการ round
robin คล้ายๆ apt-get ใน debian นั่นเอง

เริ่มต้น ก็

#cd /etc/yum.repos.d

สร้างไฟล์ สักตัวขึ้นมา ลงท้ายด้วย .repo

#vi list.repo

ใส่ค่า ในไฟล์ดังนี้ครับ

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.centos.org/centos/4/os/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#released updates
[update]
name=CentOS-$releasever - Updates

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror.centos.org/centos/4/updates/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://mirror.centos.org/centos/4/addons/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror.centos.org/centos/4/extras/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

baseurl=http://mirror.centos.org/centos/4/centosplus/i386/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror.centos.org/centos/4/contrib/i386/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

----------------------------------------------------------------------------------------

ถ้าใครใช้เป็น RHEL5 ก็เปลี่ยน 4 เป็น 5 ด้วยน่ะครับ
แล้วก็ ให้มัน update และลง package ใหม่ โดย
#yum update

ทำการค้นหา package ดังนี้
#yum search

ทำการ update เฉพาะ package xxx ก็
#yum update xxx*

อิอิ
golfreeze[at]packetlove.com

Pages: 1 ... 132 133 [134] 135 136 ... 146