Monday, March 19, 2007

การแก้ Dependency ของ php กับ php-pear ใน CentOS 4.4

จะทำให้ yum update ไม่ผ่าน แก้โดย
yum remove php
หรือ rpm -e php
rm -rf /var/cache/yum/

enable centosplus ใน repo

download php 5 จาก http://www.mirror.in.th/centos/4.4/centosplus/x86_64/RPMS
wget http://www.mirror.in.th/centos/4.4/centosplus/x86_64/RPMS/php-5.1.6-1.2.1.centos.x86_64.rpm

ถ้า install โดยใช้คำสั่ง rpm -ivh php-5.1.6-1.2.1.centos.x86_64.rpm มันจะ error เราต้อง install php-pear พร้อมๆกันเลย โดยเอา php-pear มาเก็บไว้ก่อน
wget http://www.mirror.in.th/centos/4.4/centosplus/x86_64/RPMS/php-pear-1.4.9-1.2.centos.noarch.rpm

แล้วสั่งใหม่ rpm -ivh rpm -ivh php-5.1.6-1.2.1.centos.x86_64.rpm php-pear-1.4.9-1.2.centos.noarch.rpm

เสร็จแล้วสั่ง yum update -y

อีกวิธีสั่ง rpm -Uvh
http://www.mirror.in.th/centos/4.4/centosplus/x86_64/RPMS/php-5.1.6-1.2.1.centos.x86_64.rpm http://www.mirror.in.th/centos/4.4/centosplus/x86_64/RPMS/php-pear-1.4.9-1.2.centos.noarch.rpm

Wednesday, March 14, 2007

Public DNS Server

Google DNS
8.8.8.8
8.8.4.4

OpenDNS
208.67.222.222
208.67.220.220

Level 3
4.2.2.2

True Intenet
203.144.207.29
203.144.207.49

Cat Telecom
61.19.245.245
61.19.245.246
202.129.27.133

KSC
203.155.33.1

Monday, March 12, 2007

Yum Yum

ก่อนที่จะใช้ yum ได้จะต้อง import GPG ก่อน
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
สำหรับ CentOS4 ใช้
rpm --import /usr/share/rhn/RPM-GPG-KEY-centos4

เสร็จแล้วก่อนอื่นสั่ง
yum update -y ก่อนเลย

วิธีการเพิ่ม Repository ให้กับ yum

import gpg key เพื่อตรวจสอบว่าข้อมูลของ package ไม่ได้ถูกแก้ไข
wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt

cd /etc/yum.repos.d
สร้างไฟล์ชื่อ dag.repo แล้วเพิ่มข้อมูลดังนี้เข้าไป

[dag]
name=Dag RPM Repository for CentOS
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

ลองสั่ง yum install pine lynx -y ดู

ถ้าต้องการเอา package ออกให้สั่ง yum remove pine
ถ้าต้องการค้นหา package สั่ง yum search perl*
yum list available
yum list installed <- ดูว่า install อะไรอยู่บ้าง หรือ rpm -q
yum clean all <- clear disk space yum info lynx สั่ง schedule update โดยให้ yum ตอนกลางคืน
chkconfig yum on <- สั่งให้ yum ทำงานที่ run level ไหนบ้าง แต่ยังไม่ได้สั่งให้ทำงานจริงๆ service yum start <- สั่งให้ yum ทำงานNote
ส่วนใหญ่แล้ว Package ของ 3rd party จะใหม่กว่าของ Official แต่เราต้องการความ stable ของ Package จาก official จึงไม่แนะนำให้ update ทับ package ของ Official วิธีการทำแบบนี้ได้ต้องอาศัย pluginyum install yum-plugin-protectbaseแก้ไขไฟล์ /etc/yum.conf เพิ่มบันทัด plugins=1 เข้าไปแก้ไขทุกๆไฟล์ .repo ที่อยู่ใน /etc/yum.repos.d โดยเพิ่ม
protect=1 ให้กับ Official Repository
protect=0 ให้กับ 3rd party Repositaryเพราะว่า protect=0 จะไม่สามารถ update protect=1 ได้ถึงแม้ว่ามันจะใหม่กว่าก็ตามถ้าใน .repo มีการใส่ repository อยู่หลายแห่ง น่าจะต้องใส่เพิ่ม protect=0 ให้กับทุกๆที่Yum 3rd part: List of other repositorieshttp://www.ducea.com/2006/10/22/yum-3rd-part-list-of-other-repositories/

Tuesday, March 06, 2007

OpenVZ VS Xen, Vmware

The operating system level architecture(OpenVZ) has low overhead that helps to maximize efficient use of server resources. Due to a single-kernel approach, this type of virtualization introduces only a negligible overhead and allows running hundreds of virtual private servers on a single physical server. In contrast, approaches such as emulation (like VMware) and paravirtualization (like Xen or UML) cannot achieve such level of density, due to overhead of running multiple kernels. On the other hand, operating system-level virtualization does not allow running different operating systems (i.e. different kernels), although different libraries, distributions etc. are possible

Since there is a single OS kernel which maintains all the partitions, isolation and resource management become very important. Without proper isolation security can be compromised, and without proper resource management an application from one partition can abuse resources and thus cause a denial of service for other partitions. Resources controlled and limited can include: CPU time, disk space, I/O bandwidth, network access, and all the other finite resources like RAM, shared memory, locked pages, number of processes, socket buffers etc. For example, OpenVZ provide a set of more than 20 finite resources that are accounted and limited on a per-partition basis.
Compared to the hardware-assisted virtualization solutions (like IBM's LPAR), OS-level virtualization has the benefit of running on inexpensive commodity hardware

OS level virtualization solutions initially gained popularly with service providers who needed a very low overhead, customizable, cost effective solution to provide hosting services to customers. The technology is now becoming more widely deployed as many different industries and customers are recognizing the benefits and differences between OS virtualization and hardware virtualization. The common uses and scenarios now include server and OS consolidation, business continuity (disaster recovery and high availability) and centralized desktop virtualization.

An owner (root) of OpenVZ physical server (also known as Hardware Node) can see all the VE processes and files. That makes mass management scenarios possible. Consider that VMware or Xen is used for server consolidation: in order to apply a security update to your 10 virtual servers you have to log in into each one and run an update procedure – the same you would do with the ten real physical servers.
In OpenVZ case, you can run a simple shell script which will update all (or just some selected) VEs at once.

http://wiki.openvz.org/Introduction_to_virtualization

http://en.wikipedia.org/wiki/Operating_system-level_virtualization