2011年2月18日 星期五

CentOS Testing repo

http://dev.centos.org/centos/5/CentOS-Testing.repo
這可以用yum來升級一些套件, 例如PHP 5.2 (yum update php)
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing

強化 yum 的功能

yum install yum-protectbase
yum install yum-fastestmirror yum-priorities

備份原有的 CentOS-Base.repo
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

修改 CentOS-Base.repo 設定 Priority
vim /etc/yum.repos.d/CentOS-Base.repo
在 [base]、[addons]、[updates]、[extras] 項目下新增 priority=1
在 [centosplus]、[contrib] 項目下新增 priority=2

重開 yum 的服務
/etc/rc.d/init.d/yum-updatesd restart

接著安裝 rpmforge
先匯入 rpmforge 的 Key
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

接著下載並安裝
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm


other:
http://wiki.centos.org/AdditionalResources/Repositories

2011年2月10日 星期四

webmin

linux的管理工具 web GUI
可以設定非常多東西
http://www.webmin.com/
裝好會開在port10000
http://localhost:10000/

http://www.webmin.com/rpm.html

DNS

DNS就是hostname + domain 對應到IP的轉換
透過DNS的查找, 就能知道host.domain所對應到的IP位置

要在Internet上有合法的domain,必須要到相關單位申請, 並擁有一個domain, 必須告訴該單位你所要掌管的domain的server IP, 或是domain託管

一個domain有一筆domain record是放在上層的DNS server上(google.com這個domain的domain record放在.com的DNS server上, google.com是.com的一個host), www.google.com是google.com的一個host

A record : host與IP address對應
MX record: 指定mail server的位置
CNAME record: Alias設定

http://www.aboutdebian.com/dns.htm

2011年1月20日 星期四

CentOS下vnc與local畫面同步 & xrdp (可用Windows遠端桌面連線)

1. 確認vnc-server已安裝

2. 用vncpasswd產生/root/.vnc/passwd

3. 編輯/etc/X11/xorg.conf
增加Section "Module"
Section "Module"
Load "vnc"
EndSection

在Section "Screen"增加此行
Option "passwordFile" "/root/.vnc/passwd"

4. 把port 5900打開

==================
xrdp安裝設定 (可用Windows遠端桌面連線)

1. 安裝EPEL repositories (以下link search EPEL)
http://wiki.centos.org/AdditionalResources/Repositories
a. download rpm
>wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
b. install rpm
> rpm -ivh epel-release-5-4.noarch.rpm

2. install xrdp
>yum install xrdp

3. 設定/etc/xrdp/xrdp.ini, 新增此session
[xrdp2]
name=Desktop
lib=libvnc.so
ip=127.0.0.1
port=5900
username=
password=ask

4. 把Firewall port 3389打開

5. restart xrdp & vncserver
>service vncserver restart
>service xrdp restart

6. 在Remote windows測試
開啟"Winodws遠端桌面連線" mstsc.exe
IP:remtoe端的IP

7.連進去後Module欄, 下拉選"Desktop"
keyin密碼就OK了!

參考資料:
1. http://it-specialists.org/pages/posts/howto-installation-of-xrdp-under-centos-5.5-10.php
2. http://blog.yam.com/linkatzelda/article/27398655
3. http://www.vixual.net/blog/archives/tag/xrdp

2011年1月13日 星期四

2010年12月1日 星期三

customize LiveCD

1. put LiveCD iso to home directory


3. make a temporal directory for mount ISO
# mkdir /tmp/LiveCD/

4. mount LiveCD ISO
# mount -o loop ~/CentOS-5.5-x86_64-LiveCD.iso /tmp/LiveCD/

5. make a tempral directory for custom LiveCD (for pack back into ISO)
# mkdir -p ~/livecd/cd

6. copy all file except squashfs.img
# rsync --exclude=/LiveOS/squashfs.img -a /tmp/LiveCD/ ~/livecd/cd/

7. make a temporal directory for mounting squashfs.img
# mkdir /tmp/squashfs/

8. mount squashfs.img
# mount -t squashfs -o loop /tmp/LiveCD/LiveOS/squashfs.img /tmp/squashfs/

9. make a temporal directory for ext3fs
# mkdir ~/livecd/ext3fs/

10. copy all file of squashfs.img to ext3fs (there is an ext3fs.img)
# rsync -a /tmp/squashfs/ ~/livecd/ext3fs/

11. make a temporal directory for custom LiveCD's /
# mkdir ~/livecd/custom/

12. mount ext3fs.img
# mount -t ext3 -o loop ~/livecd/ext3fs/LiveOS/ext3fs.img ~/livecd/custom/

13. chroot to ~/livecd/custom
# chroot ~/livecd/custom

14. mount /proc and /sys
# mount -t proc none /proc/
# mount -t sysfs none /sys/

15. you can customize your new LiveCD Now!!

16. umount /proc and /sys and exit
# umount /proc/
# umount /sys/
# exit

17. create a new empty ext3fs file and import all files in custom/
# dd if=/dev/zero of=~/livecd/ext3fs.img bs=1M count=4096
# mkfs.ext3 ~/livecd/ext3fs.img
# mkdir ~/livecd/newfs
# mount -o loop ~/livecd/ext3fs.img ~/livecd/newfs
cp -dpR ~/livecd/custom/* ~/livecd/newfs

18. umount ext3fs and newfs
# umount ~/livecd/custom
# umount ~/livecd/newfs

19. replace original ext3fs to new ext3fs file
# cp -f ~/livecd/ext3fs.img ~/livecd/ext3fs/LiveOS/ext3fs.img

20. umount squashfs
# umount /tmp/squashfs

21. umount ISO
# umount /tmp/LiveCD/

22. pack squashfs.img
# mksquashfs ~/livecd/ext3fs ~/livecd/cd/LiveOS/squashfs.img

23. pack iso
# cd ~/livecd/cd
# mkisofs -r -V "CentOS-5.5-x86_64-LiveCD-Custom" -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/CentOS-5.5-x86_64-LiveCD-Custom.iso .

Congratulation! you did it.

參考資料:
http://osdir.com/ml/linux.redhat.fedora.livecd/2008-07/msg00003.html
http://jeffreywt.com/open-source/linux/modifying-a-livecd-with-squashfs-tools