/etc/auto.master 有個預設設定"/net -hosts",啟用時系統會將 key (主機名稱)拋給 /etc/auto.net 來掛載 NFS 磁碟,詳細運作方式可以看一下 /etc/auto.net 這個腳本程式
假設我們有個 NFS 磁碟,利用 showmount 可查出以下資訊
shell># showmount -e 192.168.1.100
Export list for 192.168.1.100
/volume1/project 192.168.1.1
假設這個 NFS 主機名稱為 mike,在 /etc/hosts 新增以下設定
shell># echo "192.168.1.100 mike" >> /etc/hosts
在 /net 下建立 mike 目錄,若無法建立目錄時,請確認autofs服務是否有啟動,若有就先停掉避免服務咬住無法建立
shell># mkdir /net/mike
啟動 autofs 及掛載NFS等相關服務
shell># service rpcbind start
shell># service autofs start
然後切換目錄到 /net/mike/volume1/project 時,可以發現 autofs 自動將NFS磁碟掛起來了
shell># cd /net/mike
shell># df -h
mike:/volume1/project
28084178816 7826209664 20257969152 28% /net/mike/volume1/project
來源出處
man 5 auto.master
2016年12月17日
2016年10月9日
CentOS7 修改時區(time zone)
CentOS7有個好用指令方便調整時區:timedatectl (systemd-219-19.el7_2.11.x86_64)
列出所有時區
shell> timedatectl list-timezones
設定時區
shell> timedatectl set-timezone Asia/Taipei
列出所有時區
shell> timedatectl list-timezones
設定時區
shell> timedatectl set-timezone Asia/Taipei
2016年1月7日
蒐集系統資訊工具 sosreport
在 RedHat / CentOS 下有個蒐集系統資訊的指令:sosreport
sosreport 是模組設計,可以根據你想要的模組進行資料的蒐集
安裝
shell># yum install sos
列出支援的模組:
shell># sosreport -l
蒐集指定的模組資訊
shell># sosreport -o postfix
蒐集所有的模組資訊
shell># sosreport -a
執行後會將蒐集到的資訊打包成壓縮檔及一個md5檢核檔
解壓縮後請找 sos_reports 目錄內有個 sosreport.html 可以方便讀取
sosreport 是模組設計,可以根據你想要的模組進行資料的蒐集
安裝
shell># yum install sos
列出支援的模組:
shell># sosreport -l
蒐集指定的模組資訊
shell># sosreport -o postfix
蒐集所有的模組資訊
shell># sosreport -a
執行後會將蒐集到的資訊打包成壓縮檔及一個md5檢核檔
解壓縮後請找 sos_reports 目錄內有個 sosreport.html 可以方便讀取
2015年2月3日
CentOS 5/6 編譯安裝 ffmpeg
由於我需要 ffmpeg +faststart 的參數,讓 flash player 播放 mp4 時能馬上播放影片,但該參數只有在新版上才支援,看了一下 FFMpeg 官網的編譯手冊,決定自己編譯一套來用
※以下筆記是編譯 h264 、Theora 的影像編碼及 mp3、aac、ogg、libvorbis 聲音編碼格式,若有其他編碼需求的話就需要額外編譯套件
必要套件
shell># yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
shell># mkdir ~/ffmpeg_source
shell># cd ~/ffmpeg_source
編譯 yasm
shell># git clone --depth 1 git://github.com/yasm/yasm.git
shell># cd yasm
shell># autoreconf -fiv
shell># ./configure --prefix=/usr/local/ffmpeg
shell># make && make install
※若是 CentOS5 這種比較舊的系統會因為 autoconf 版本太舊無法用 git 下載的版本
請到 http://www.tortall.net/projects/yasm/releases 下載 tarball 編譯
編譯x264
設定環境變數,否則編譯 x264 會有問題
shell># export PATH="$PATH:/usr/local/ffmpeg/bin"
shell># cd ~/ffmpeg_source
shell># git clone --depth 1 git://git.videolan.org/x264
shell># cd x264
shell># ./configure --prefix=/usr/local/ffmpeg --enable-static
shell># make && make install
編譯 libfdk_aac
shell># cd ~/ffmpeg_source
shell># git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
shell># cd fdk-aac
shell># autoreconf -fiv
shell># ./configure --prefix=/usr/local/ffmpeg --disable-shared
shell># make && make install
※CentOS5 會出現 ./configure: line 3399: LT_INIT: command not found 錯誤
請下載 tarball 編譯
下載點:http://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-0.1.4.tar.gz
編譯 libmp3lame
shell># cd ~/ffmpeg_source
shell># curl -L -O http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
shell># tar xzvf lame-3.99.5.tar.gz
shell># cd lame-3.99.5
shell># ./configure --prefix=/usr/local/ffmpeg --disable-shared --enable-nasm
shell># make && make install
※若連結失效請到 http://sourceforge.net/projects/lame 下載
編譯 libogg
shell># cd ~/ffmpeg_source
shell># curl -L -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
shell># tar xzvf libogg-1.3.2.tar.gz
shell># cd libogg-1.3.2
shell># ./configure --prefix=/usr/local/ffmpeg --disable-shared
shell># make && make install
※若連結失效請到 http://downloads.xiph.org/ 下載
編譯 libvorbis
shell># cd ~/ffmpeg_source
shell># curl -L -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
shell># tar xzvf libvorbis-1.3.4.tar.gz
shell># cd libvorbis-1.3.4
shell># ./configure --prefix=/usr/local/ffmpeg --disable-shared
shell># make && make install
編譯 libtheora
shell># cd ~/ffmpeg_source
shell># curl -O http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
shell># tar xzvf libtheora-1.1.1.tar.gz
shell># cd libtheora-1.1.1
shell># ./configure --prefix=/usr/local/ffmpeg --with-ogg=/usr/local/ffmpeg --disable-examples --disable-shared --disable-sdltest --disable-vorbistest
shell># make && make install
編譯 ffmpeg
shell># cd ~/ffmpeg_source
shell># git clone --depth 1 git://source.ffmpeg.org/ffmpeg
shell># cd ffmpeg
PKG_CONFIG_PATH="/usr/local/ffmpeg/lib/pkgconfig" ./configure --prefix=/usr/local/ffmpeg --extra-cflags="-I/usr/local/ffmpeg/include" --extra-ldflags="-L/usr/local/ffmpeg/lib" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libtheora
shell># make && make install
測試轉檔
shell># ffmpeg -i test-orig.mp4 -c:v libx264 -preset veryfast -b:v 250k -c:a libfdk_aac -b:a 64k -movflags +faststart test-output.mp4
※以下筆記是編譯 h264 、Theora 的影像編碼及 mp3、aac、ogg、libvorbis 聲音編碼格式,若有其他編碼需求的話就需要額外編譯套件
必要套件
shell># yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
shell># mkdir ~/ffmpeg_source
shell># cd ~/ffmpeg_source
編譯 yasm
shell># git clone --depth 1 git://github.com/yasm/yasm.git
shell># cd yasm
shell># autoreconf -fiv
shell># ./configure --prefix=/usr/local/ffmpeg
shell># make && make install
※若是 CentOS5 這種比較舊的系統會因為 autoconf 版本太舊無法用 git 下載的版本
請到 http://www.tortall.net/projects/yasm/releases 下載 tarball 編譯
編譯x264
設定環境變數,否則編譯 x264 會有問題
shell># export PATH="$PATH:/usr/local/ffmpeg/bin"
shell># cd ~/ffmpeg_source
shell># git clone --depth 1 git://git.videolan.org/x264
shell># cd x264
shell># ./configure --prefix=/usr/local/ffmpeg --enable-static
shell># make && make install
編譯 libfdk_aac
shell># cd ~/ffmpeg_source
shell># git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
shell># cd fdk-aac
shell># autoreconf -fiv
shell># ./configure --prefix=/usr/local/ffmpeg --disable-shared
shell># make && make install
※CentOS5 會出現 ./configure: line 3399: LT_INIT: command not found 錯誤
請下載 tarball 編譯
下載點:http://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-0.1.4.tar.gz
編譯 libmp3lame
shell># cd ~/ffmpeg_source
shell># curl -L -O http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
shell># tar xzvf lame-3.99.5.tar.gz
shell># cd lame-3.99.5
shell># ./configure --prefix=/usr/local/ffmpeg --disable-shared --enable-nasm
shell># make && make install
※若連結失效請到 http://sourceforge.net/projects/lame 下載
編譯 libogg
shell># cd ~/ffmpeg_source
shell># curl -L -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
shell># tar xzvf libogg-1.3.2.tar.gz
shell># cd libogg-1.3.2
shell># ./configure --prefix=/usr/local/ffmpeg --disable-shared
shell># make && make install
※若連結失效請到 http://downloads.xiph.org/ 下載
編譯 libvorbis
shell># cd ~/ffmpeg_source
shell># curl -L -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
shell># tar xzvf libvorbis-1.3.4.tar.gz
shell># cd libvorbis-1.3.4
shell># ./configure --prefix=/usr/local/ffmpeg --disable-shared
shell># make && make install
編譯 libtheora
shell># cd ~/ffmpeg_source
shell># curl -O http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
shell># tar xzvf libtheora-1.1.1.tar.gz
shell># cd libtheora-1.1.1
shell># ./configure --prefix=/usr/local/ffmpeg --with-ogg=/usr/local/ffmpeg --disable-examples --disable-shared --disable-sdltest --disable-vorbistest
shell># make && make install
編譯 ffmpeg
shell># cd ~/ffmpeg_source
shell># git clone --depth 1 git://source.ffmpeg.org/ffmpeg
shell># cd ffmpeg
PKG_CONFIG_PATH="/usr/local/ffmpeg/lib/pkgconfig" ./configure --prefix=/usr/local/ffmpeg --extra-cflags="-I/usr/local/ffmpeg/include" --extra-ldflags="-L/usr/local/ffmpeg/lib" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libvorbis --enable-libx264 --enable-libtheora
shell># make && make install
測試轉檔
shell># ffmpeg -i test-orig.mp4 -c:v libx264 -preset veryfast -b:v 250k -c:a libfdk_aac -b:a 64k -movflags +faststart test-output.mp4
2015年1月13日
query rpm package name only
列出系統安裝的rpm套件名稱,但不要版本資訊
shell>#rpm -qa --qf "%{NAME}\n"
openldap
curl
gzip
db4-utils
e2fsprogs-libs
libselinux-utils
libgcrypt
ethtool
openssl
python-libs
稍微變化一下可排程將套件列表備份起來,之後系統災難復原的時候可以一行指令裝好套件
新增一筆排程到 crontab
shell># crontab -e
@monthly /bin/rpm -qa --qf "%{NAME} " > /root/rpmList.txt
若系統要重安裝時把列表拿出來用
shell># cat /root/rpmList.txt | xargs yum install -y
shell>#rpm -qa --qf "%{NAME}\n"
openldap
curl
gzip
db4-utils
e2fsprogs-libs
libselinux-utils
libgcrypt
ethtool
openssl
python-libs
稍微變化一下可排程將套件列表備份起來,之後系統災難復原的時候可以一行指令裝好套件
新增一筆排程到 crontab
shell># crontab -e
@monthly /bin/rpm -qa --qf "%{NAME} " > /root/rpmList.txt
若系統要重安裝時把列表拿出來用
shell># cat /root/rpmList.txt | xargs yum install -y
2014年6月24日
samba as wins server
設定SAMBA為WINS伺服器
注意
- SAMBA官方手冊上提到, 因為WINS Replication沒有實做完成, 所以不建議同時啟動兩台SAMBA 作為 WINS server
- 不建議同時與MS伺服器同時作為WINS伺服器
- 編輯 /etc/samba/smb.conf, 取消 wins support = yes 的註解, 特別注意到 wins support 與 wins server 這兩個參數不得同時存在, 否則會無法啟動 nmb
- 若有 static wins 的需求, 請編輯 /var/lib/samba/wins.dat
加上 "NETBIOS_NAME#03" 0 192.168.xxx.xxx 66R
※注意編輯wins.dat時要先停止nmb服務 - 啟動 nmb
參考文獻
2014年2月5日
修改檔名的編碼工具
在Linux下有個很方便的指令工具,可以轉換檔名的語系編碼,就我的案例是在 big5 與 utf-8 之間轉換,使用方式也很簡單,適合用script撰寫批次處理大量檔案使用,另外此工具也能處理檔名的大小寫
#安裝 convmv
shell># yum install convmv
#查看系統支援哪些語系
shell># convmv -list
#查看使用說明
shell># convmv --help
#轉換工作目錄下的檔案,包含子目錄
shell># convmv -f utf-8 -t big5 -r --notest *
#安裝 convmv
shell># yum install convmv
#查看系統支援哪些語系
shell># convmv -list
#查看使用說明
shell># convmv --help
#轉換工作目錄下的檔案,包含子目錄
shell># convmv -f utf-8 -t big5 -r --notest *
2013年10月13日
Linux 安裝 tomcat 筆記
安裝JDK或JRE
到 Oracle JAVA 下載 JDK,請根據系統環境下載安裝程式,我選用 tarball 安裝。
shell># jdk-6u42-linux-x64.tar.gz
shell># chmod 700 jdk-6u42-linux-x64.bin
shell># ./jdk-6u42-linux-x64.bin
shell># chmod 700 jdk-6u42-linux-x64.bin
shell># ./jdk-6u42-linux-x64.bin
執行後會安裝於 /usr/java 下,安裝程式會自動建立符號連結 /usr/java/latest 到最新一版的目錄,若要設定使用者的 JAVA_HOME 環境,請依如下設定
shell># vim ~/.bash_profile
新增JAVA_HOME=/usr/java/latest
export JAVA_HOME
安裝Tomcat
step1:
下載Tomcat 7版二進位安裝檔,解壓縮後放在 /volume/apache-tomcat-7.0.42 ( 安裝路徑端看你想安裝於哪個目錄下 ),並建立符號連結到該目錄,目的是為了日後升級 tomcat 時,所有的環境設定都統一設定為 /volume/tomcat
step2:
新增 tomcat 系統帳號,且不允許該帳號登入
shell># useradd tomcat -c “Tomcat service” -u 400 -d /volume/tomcat -M -s /sbin/nologin
step3:
編譯 jsvc 服務管理程式( 需 gcc make autoconf才能編譯 )
shell># cd $CATALINA_HOME/bin ( $CATALINA_HOME 就是 tomcat 家目錄,以我的環境為 /volume/tomcat )
shell># tar xvfz commons-daemon-native.tar.gz
shell># cd commons-daemon-1.0.x-native-src/unix
shell># ./configure --with-java=/usr/java/latest
shell># make
shell># cp jsvc ../..
shell># cd ../..
shell># tar xvfz commons-daemon-native.tar.gz
shell># cd commons-daemon-1.0.x-native-src/unix
shell># ./configure --with-java=/usr/java/latest
shell># make
shell># cp jsvc ../..
shell># cd ../..
step4:
編輯啟動script設定
shell># vim /volume/tomcat/bin/daemon.sh
修改 88 行設定JAVA環境變數,請將註解拿掉
JAVA_HOME=/usr/java/latest
tomcat預設的帳號就是 tomcat,若要更換其他帳號請修改第 86 行
test ".$TOMCAT_USER" = . && TOMCAT_USER=tomcat ← 將最後的 tomcat 換成想要的帳號
啟動服務
shell># /volume/tomcat/bin/daemon start
停用服務
shell># /volume/tomcat/bin/daemon stop
強化Tomcat的資安設定
1.不要使用root帳號啟動Tomcat, 而是用較小權限的帳號執行服務
2.除temp, work及logs目錄權限為tomcat.tomcat外, 其餘目錄權限為root.tomcat, 此外擁有者權限為read/write, 群組權限為read
3.將shutdown port設定為-1來關閉功能或設定密碼限制
4.因Tomcat附帶的webapps曾經發生資安問題, 請直接移除(tomcat/webapps/{docs,ROOT,manager,host-manager}
5.關閉自動佈署功能
強化Tomcat的資安設定
1.不要使用root帳號啟動Tomcat, 而是用較小權限的帳號執行服務
2.除temp, work及logs目錄權限為tomcat.tomcat外, 其餘目錄權限為root.tomcat, 此外擁有者權限為read/write, 群組權限為read
3.將shutdown port設定為-1來關閉功能或設定密碼限制
4.因Tomcat附帶的webapps曾經發生資安問題, 請直接移除(tomcat/webapps/{docs,ROOT,manager,host-manager}
5.關閉自動佈署功能
2013年8月5日
CentOS 監看輸出結果指令
若想持續的觀看某指令的輸出結果,可以用 watch 達成。
例如每隔5秒顯示一次 drbd 的狀態
shell> # watch -n 5 cat /proc/drbd
他還有一個我覺得可能不太會用上的小功能,就是當輸出有變化時就以反白的畫面顯示,指令如下。
shell># watch -n 5 --differences=cumulative ls -l /tmp
特別注意到參數 --differences=cumulative 表示若輸出有改變時,要持續的以反白的方式顯示,否則下一輪輸出時若沒改變,就會取消反白顯示。
2013年7月31日
CentOS Disk Encryption (LUKS) 筆記
LUKS(Linux Unified Key Setup) / dm-crypt 是 CentOS 所使用的 block 層加密技術,其使用 kernel device mapper subsystem 來映對並進行加解密的動作,使用者則透過 cryptsetup 工具進行設定。另外要特別注意到該技術是利用應對的方式處理加解密,所以在讀寫資料時,應讀寫 device-mapping 裝置(Ex: /dev/mapper/luke-UUID),而不是直接讀取實際的裝置(Ex: /dev/sdb1)
功能
基本上這個金鑰檔你可以自己建立,利用編輯器撰寫密碼或用亂數產生,甚至你可以自己建立SSL憑證的private key來使用
例如:
用亂數建立金鑰
shell># dd if=/dev/urandom of=/root/keyfile bs=32 count=1
shell># chmod 600 /root/keyfile
將金鑰新增到 key slot,新增過程你必須輸入 key slot 0 的密碼
shell># cryptsetup luksAddKey /dev/sdb1 /root/keyfile
設定開機讀取金鑰,可避免掉開機手動輸入密碼的程序
shell># vim /etc/crypttab
luks-UUID UUID=UUID /root/keyfile
刪除 key slot
先Dump luks header 的資料以取得 key slot 號碼
shell># cryptsetup luksDump /dev/sdb1
確認要刪除的 key slot 號碼後執行下面的指令即可刪除
shell># cryptsetup luksKillSlot /dev/sdb1 2
功能
- 可使用 passphrase (password) 或 key (金鑰) 方式加解密
- 可加密一般的 partition, LVM physical volumes, LVM logical volumes, software RAID 及 SWAP
- 透過Anaconda安裝時,只能選擇用 passphrase 加密方式
- 可設定多組key或密碼 (key slot)
手動建立加密磁區
- 需求套件 cryptsetup-luks, device-mapper, util-linux
- 利用 fidsk 或 parted 建立磁碟分割,以/dev/sdb1為例
- 清除磁碟上原有的資料(Option)
shell># dd if=/dev/urandom of=/dev/sdb1 - 初始化加密磁區並設定加密方式,此步驟可選擇使用 passphrase 或 key 加密
注意此步驟會將硬碟資料清除!
shell># cryptsetup luksFormat /dev/sdb1 - 確認是否成功
shell># cryptsetup isLuks /dev/sdb1 && echo Success - Dump加密格式資料
shell># cryptsetup luksDump /dev/sdb1 - 建立 mapped device,名稱建議使用 luks-UUID較具意義,該指令執行後會建立 /dev/mapper/luks-UUID 的裝置 (UUID請自行帶入磁碟的UUID)
shell># cryptsetup luksOpen /dev/sdb1 luks-`cryptsetup luksUUID /dev/sdb1` - 確認 mapped device資訊
shell># dmsetup info luks-UUID - 格式化磁區
shell># mkfs.ext3 /dev/mapper/luks-UUID - 掛載。因為前面有輸入過密碼,掛載的時候並不會再提示一次
shell># mount /dev/mapper/luks-UUID /mnt - 設定/etc/crypttab
這個檔案用在開機時建立mapped device及加密相關設定,可以透過此設定檔自動載入密碼,詳細設定資訊參閱 man crypttab,下面為該檔的格式:
device-mapping-namedevice password options device 建議使用UUID,格式為 UUID=12345-123456-123122345,也可以用 /dev/sdb1
所以在 /etc/crypttab 裡新增如下一行,none代表開機時要輸入密碼
luks-UUID UUID=UUID none - 設定開機掛載(此步驟看需求)
shell># vim /etc/fstab
新增
/dev/mapper/luks-UUID /mount-point ext3 defaults 1 2 - 重開機測試
建立金鑰檔
基本上這個金鑰檔你可以自己建立,利用編輯器撰寫密碼或用亂數產生,甚至你可以自己建立SSL憑證的private key來使用
例如:
用亂數建立金鑰
shell># dd if=/dev/urandom of=/root/keyfile bs=32 count=1
shell># chmod 600 /root/keyfile
將金鑰新增到 key slot,新增過程你必須輸入 key slot 0 的密碼
shell># cryptsetup luksAddKey /dev/sdb1 /root/keyfile
設定開機讀取金鑰,可避免掉開機手動輸入密碼的程序
shell># vim /etc/crypttab
luks-UUID UUID=UUID /root/keyfile
刪除 key slot
先Dump luks header 的資料以取得 key slot 號碼
shell># cryptsetup luksDump /dev/sdb1
確認要刪除的 key slot 號碼後執行下面的指令即可刪除
shell># cryptsetup luksKillSlot /dev/sdb1 2
2013年6月5日
HP DL360 gen8 with B120i 或 B320i Raid card 導致 Linux CPU 使用率異常
最近在HP DL360 gen8 伺服器上安裝 CentOS6.4 x86_64
安裝好之後發現CPU負載異常的高,如下圖(節錄自 HP Support Document)

原因是磁碟陣列卡(B120i 或 B320i)驅動 hpvsa 版本1.2.4-3及1.2.4-4有問題,請改用 1.2.4-7以後的版本,新版驅動程式可以到 HP Support Document ID c03652332 下載。
若已經安裝好作業系統,可下載 RPM 版本驅動,重新安裝即可修正。RPM安裝的過程會比較久,是正常狀況別以為安裝上去系統就掛了,務必耐心等待。
安裝好之後發現CPU負載異常的高,如下圖(節錄自 HP Support Document)

原因是磁碟陣列卡(B120i 或 B320i)驅動 hpvsa 版本1.2.4-3及1.2.4-4有問題,請改用 1.2.4-7以後的版本,新版驅動程式可以到 HP Support Document ID c03652332 下載。
若已經安裝好作業系統,可下載 RPM 版本驅動,重新安裝即可修正。RPM安裝的過程會比較久,是正常狀況別以為安裝上去系統就掛了,務必耐心等待。
2013年6月3日
設定 CentOS Yum 套件庫鏡像站台
CentOS 的套件庫預設由 mirror list 決定下載站台位置,為了加快 Yum 的速度,可以直接設定使用台灣的鏡像站台,做法如下:
shell># vim /etc/yum.repos.d/CentOS-Base.repo
完成後執行 yum 你會發現系統直接使用設定的站台
shell># vim /etc/yum.repos.d/CentOS-Base.repo
2012年2月29日
nis slave 架設
當架設好 NIS Master 時,最好要有一台 NIS Slave,此話怎說? 若你的系統服務是靠 NIS 帳號執行時,一旦 NIS 伺服器故障會導致服務無法啟動或執行,所以 NIS Slave 在整個系統上也是很重要的一環。
NIS Slave 有兩種方式同步資料,一種是透過 ypxfrd 方式,由 NIS Slave 定時(透過 crond)跟 Master 取得資料同步,另一種是 NIS Master 更新資料時,利用 yppush 把異動的資料送給 NIS Slave。說到 yppush 就一定要看一下 /var/yp/Makefile ,每當我們透過 Makefile 重新編譯資料時,Makefile 會呼叫 yppush 送到 NIS Slave,請看下方紅色字體的部份
shell># ls /var/yp
shell># make hosts
shell># cd /var/yp/nistest
shell># rm -f hosts.*
shell># make -f ../Makefile hosts
shell># cat /var/yp/ypservers
shell># make ypservers
shell># ypcat ypservers
/* 以下資訊在 NIS Master 執行 */
1. 啟動 ypxfrd 好讓 NIS Slave 可以透過此服務同步資料
shell># service ypxfrd start
shell># chkconfig ypxfrd on
/* 以下資訊在 NIS slave 執行 */
1. 安裝 yp 套件
shell># yum install ypserv ypbind yp-tools
2. 架設 NIS slave 前,先利用 ypbind 跟 NIS Master 完成整合,可以參考 NIS 安裝筆記
3. 執行 ypinit,若失敗的話大概是你沒在 NIS Master 啟動 ypxfrd 服務,或者 ypbind 整合 NIS 有問題
shell># /usr/lib/yp/ypinit -s nisserver1
shell># service ypserv start
shell># ypcat -h localhost services
在 /usr/lib/yp 下有三隻 script ,分別是 ypxfr_1perday, ypxfr_2perday, ypxfr_1perday,其實這三隻 script 內容都一樣,是用 shell 寫的迴圈呼叫 ypxfr 進行更新,要注意到他的 MAP_TO_GET 的列表並不完全,記得依自己的需求更新一下,下面紅字是我修改的部份
shell># cat /usr/lib/yp/ypxfr_1perhour
shell># cat /etc/crontab
/* 參考文獻 */
man(8) yppush
man(8) ypinit
/var/yp/Makefile
http://www.linux-nis.org/
NIS Slave 有兩種方式同步資料,一種是透過 ypxfrd 方式,由 NIS Slave 定時(透過 crond)跟 Master 取得資料同步,另一種是 NIS Master 更新資料時,利用 yppush 把異動的資料送給 NIS Slave。說到 yppush 就一定要看一下 /var/yp/Makefile ,每當我們透過 Makefile 重新編譯資料時,Makefile 會呼叫 yppush 送到 NIS Slave,請看下方紅色字體的部份
netgroup: $(NETGROUP) $(YPDIR)/Makefile特別注意到 $(NOPUSH) ,在 Makefile 裡面有一行 NOPUSH 的變數,用來決定是否要用 yppush 傳送資料,當然我們需要 yppush 所以請把他改為
@echo "Updating $@..."
@$(AWK) '{ if ($$1 != "" && $$1 !~ "#" && $$1 != "+") \
print $$0 }' $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \
-o $(YPMAPDIR)/$@ - $@
-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
NOPUSH=false那另一個 $(DOMAIN) 如何來的呢? 一樣看 Makefile,裡面有個變數是利用 basename 及 pwd 指令取得網域,老實說我覺得這設計不是很好,我花了不少時間才找到這個資訊
DOMAIN = `basename \`pwd\``所以執行 make 時,shell所在的工作目錄就很重要了,不然 yppush 同步會失敗,錯誤訊息大概會跟下面那堆訊息很接近
shell># ls /var/yp
nistest binding Makefile nicknames ypserversshell># cd /var/yp
shell># make hosts
Updating hosts.byname...所以正確的方式應如下(nistest 是我的 NIS 網域)
YPBINDPROC_DOMAIN: Domain not bound
Could not read ypservers map: 3 Can't bind to server which serves this domain
YPPUSH: Cannot open /var/yp/yp/hosts.byname
make: [hosts.byname] Error 1 (ignored)
Updating hosts.byaddr...
YPBINDPROC_DOMAIN: Domain not bound
Could not read ypservers map: 3 Can't bind to server which serves this domain
YPPUSH: Cannot open /var/yp/yp/hosts.byaddr
make: [hosts.byaddr] Error 1 (ignored)
shell># cd /var/yp/nistest
shell># rm -f hosts.*
shell># make -f ../Makefile hosts
Updating hosts.byname...再來 yppush 要如何知道我有哪些 NIS Slave 伺服器需要更新,答案就在 /var/yp/ypservers ,每當要執行 yppush 時,yppush 會到 /var/yp/domain/ypservers 找尋 NIS slave,然後將資料 push 給他們,/var/yp/ypservers 的格式長這樣,一行一筆資料。
Updating hosts.byaddr...
shell># cat /var/yp/ypservers
ypserver1一旦你更新了 ypservers 要記得 make ,不然不會生效
ypserver2
192.168.1.1
shell># make ypservers
make: `ypservers' is up to date.你可以透過 ypcat 來確認是否已經更新
shell># ypcat ypservers
ypserver1OK! 到這邊開始進行 NIS Slave 的設定
ypserver2
192.168.1.1
/* 以下資訊在 NIS Master 執行 */
1. 啟動 ypxfrd 好讓 NIS Slave 可以透過此服務同步資料
shell># service ypxfrd start
shell># chkconfig ypxfrd on
/* 以下資訊在 NIS slave 執行 */
1. 安裝 yp 套件
shell># yum install ypserv ypbind yp-tools
2. 架設 NIS slave 前,先利用 ypbind 跟 NIS Master 完成整合,可以參考 NIS 安裝筆記
3. 執行 ypinit,若失敗的話大概是你沒在 NIS Master 啟動 ypxfrd 服務,或者 ypbind 整合 NIS 有問題
shell># /usr/lib/yp/ypinit -s nisserver1
We will need a few minutes to copy the data from db2.4. 啟動 ypserv 後確認資料是否已經同步
Transferring protocols.byname...
Trying ypxfrd ... success
Transferring auto.home...
Trying ypxfrd ... success
Transferring ypservers...
Trying ypxfrd ... success
... 略
shell># service ypserv start
shell># ypcat -h localhost services
nsc-posa 2605/udp5. 定時跟 Master 同步資料
proactivesrvr 2722/tcp
ats 2201/udp
ds-srvr 4401/tcp
msp-os 4686/tcp
gdbremote 2159/udp
ibridge-mgmt 2276/tcp
adi-gxp-srvprt 6769/tcp
imip-channels 11320/udp
vocaltec-wconf 22555/tcp
.... 略
在 /usr/lib/yp 下有三隻 script ,分別是 ypxfr_1perday, ypxfr_2perday, ypxfr_1perday,其實這三隻 script 內容都一樣,是用 shell 寫的迴圈呼叫 ypxfr 進行更新,要注意到他的 MAP_TO_GET 的列表並不完全,記得依自己的需求更新一下,下面紅字是我修改的部份
shell># cat /usr/lib/yp/ypxfr_1perhour
YPBINDIR=/usr/lib/yp6. 設定 crond 去觸發執行
MAPS_TO_GET="group.byname group.bygid protocols.byname protocols.bynumber networks.byname networks.byaddr rpc.byname rpc.bynumber services.byname ypservers"
for map in $MAPS_TO_GET
do
$YPBINDIR/ypxfr $map
done
shell># cat /etc/crontab
@hourly root /usr/lib/yp/ypxfr_1perhour > /dev/null 2>&17. 最後記得到各台 NIS client 設定 yp.conf 把 NIS Slave 加進去
/* 參考文獻 */
man(8) yppush
man(8) ypinit
/var/yp/Makefile
http://www.linux-nis.org/
2011年12月16日
CentOS errata mail list
CentOS 的套件修正是透過 Mail List 發佈,若想知道最新發佈的漏洞或Bug fix,可以訂閱 mail list來獲得最新訊息,若想查看以前發佈的訊息,可以透過 The CentOS-announce Archives 查閱。
首先依照年月點選,例如我要查看 2011年12月份的紀錄

若是以 CESA 發佈的就是有關 Security 的修正,而 CEBA 是有關 Bug fix的消息
首先依照年月點選,例如我要查看 2011年12月份的紀錄

若是以 CESA 發佈的就是有關 Security 的修正,而 CEBA 是有關 Bug fix的消息
2011年10月25日
在 Linux 解析 Netbios 名稱
因自己身處在充滿 Windows 系統的公司,RD的測試機全都用 NetBios 名稱,為了讓我的小企鵝能夠適應這樣的環境生存下去,做了些調整
環境: CentOS 5.6
#首先安裝 samba
shell># yum install samba3x-common samba3x-client samba3x
#設定 smb.conf, 小小修改一下設定
shell># vim /etc/samba/smb.conf
[global]
#設定自己的主機名稱
netbios name = linux-desktop
#若啟用win server參數,表示nmb要作為 wins client
win server = 192.168.121.12
# 設定開機啟動服務
shell># service nmb start; chkconfig nmb on
#修改 nsswitch.conf 的 hosts ,新增 wins,一定要加上,不然啟動nmb也沒用
shell># vim /etc/nsswitch.conf
hosts: files wins dns
#測試看看解析的狀況
shell># ping server1
PING server1 (192.168.100.112) 56(84) bytes of data.
64 bytes from 192.168.100.112: icmp_seq=1 ttl=127 time=0.666 ms
ps. 主機一定要有 libnss_wins.so
環境: CentOS 5.6
#首先安裝 samba
shell># yum install samba3x-common samba3x-client samba3x
#設定 smb.conf, 小小修改一下設定
shell># vim /etc/samba/smb.conf
[global]
#設定自己的主機名稱
netbios name = linux-desktop
#若啟用win server參數,表示nmb要作為 wins client
win server = 192.168.121.12
# 設定開機啟動服務
shell># service nmb start; chkconfig nmb on
#修改 nsswitch.conf 的 hosts ,新增 wins,一定要加上,不然啟動nmb也沒用
shell># vim /etc/nsswitch.conf
hosts: files wins dns
#測試看看解析的狀況
shell># ping server1
PING server1 (192.168.100.112) 56(84) bytes of data.
64 bytes from 192.168.100.112: icmp_seq=1 ttl=127 time=0.666 ms
ps. 主機一定要有 libnss_wins.so
- 在 CentOS 是隨附在 samba3x-common 套件
- 在Debian squeeze隨附於 winbind 套件
- ubuntu18.0.3 LTS版,隨附於 libnss-winbind 套件
2011年7月4日
CentOS5 設定 Intel(R) PRO/Wireless 2915ABG (ipw2200) 網卡筆記
驅動程式下載點
Intel® PRO/Wireless 2200BG Driver Firmware - 下載點
Intel(R) PRO/Wireless 2915ABG Network Connection driver for Linux -下載點
確認網卡資訊
shell># lspci
01:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] Network Connection (rev 05)
安裝 Kernel-devel( 2.6.8+)
shell># yum install kernel-devel
確認核心支援autoconf
shell># ls /lib/modules/`uname -r`/build/include/linux/autoconf.h
/lib/modules/`uname -r`/build/include/linux/autoconf.h
確認掛載 SYSFS
shell># mount
編譯 ipw 模組
shell># tar xzvf ipw2200-1.2.0.tgz
shell># cd ipw2200-1.2.0
shell># make IEEE80211_INC=/usr/src/kernels/2.6.18-238.12.1.el5-i686/include/
註:變數 IEEE80211_INC 讓 Makefile 可以找到 ieee80211.h
shell># make install
註:安裝到現行核心的模組目錄
安裝 firmware
shell># tar xzvf ipw2200-fw-3.0.tgz
shell># cp ipw2200-fw-3.0/* /lib/firmware/
使用模組
shell># modprobe ipw
shell># lsmod | grep ipw
設定 modprobe.conf
shell># vim /etc/modprobe.conf
加入
alias eth1 ipw
接下來就可以利用 iwconfig 或 wpa_supplicant 連線(wpa_supplicant設定可以參考這裡)
Intel® PRO/Wireless 2200BG Driver Firmware - 下載點
Intel(R) PRO/Wireless 2915ABG Network Connection driver for Linux -下載點
確認網卡資訊
shell># lspci
01:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] Network Connection (rev 05)
安裝 Kernel-devel( 2.6.8+)
shell># yum install kernel-devel
確認核心支援autoconf
shell># ls /lib/modules/`uname -r`/build/include/linux/autoconf.h
/lib/modules/`uname -r`/build/include/linux/autoconf.h
確認掛載 SYSFS
shell># mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
編譯 ipw 模組
shell># tar xzvf ipw2200-1.2.0.tgz
shell># cd ipw2200-1.2.0
shell># make IEEE80211_INC=/usr/src/kernels/2.6.18-238.12.1.el5-i686/include/
註:變數 IEEE80211_INC 讓 Makefile 可以找到 ieee80211.h
shell># make install
註:安裝到現行核心的模組目錄
安裝 firmware
shell># tar xzvf ipw2200-fw-3.0.tgz
shell># cp ipw2200-fw-3.0/* /lib/firmware/
使用模組
shell># modprobe ipw
shell># lsmod | grep ipw
ipw 12869 0
usbserial 33065 1 ipw
ipw2200 136808 0
ieee80211 34313 1 ipw2200
設定 modprobe.conf
shell># vim /etc/modprobe.conf
加入
alias eth1 ipw
接下來就可以利用 iwconfig 或 wpa_supplicant 連線(wpa_supplicant設定可以參考這裡)
2011年7月3日
安裝 CentOS 5 於 X61 筆記
這篇筆記是我用CentOS 5 安裝 X61 成桌機的步驟,趁現在還有印象時快點紀錄下來
1. 系統採用最小安裝,可以參考這篇,安裝完成後記得利用 Yum update 套件
2. 安裝套件:群組套件分別是X視窗系統,XFCE及中文支援(包含酷音輸入法),若不喜歡用XFCE的人可以換成 KDE 或 GNOME,自己用 yum grouplist 去看
shell># yum groupinstall "X Window System" "XFCE-4.4" "Chinese Support" "Sound and Video"
shell># yum install gdm NetworkManager-gnome readahead
註: 啟用readahead_early服務可以解決 firefox 觀看 flash 影片 CPU 爆衝問題
3. 安裝 FireFox4,下載之後的特殊處理參考這篇
4. 下載螢火飛字型
網站:http://cle.linux.org.tw/fonts/FireFly/
shell># wget http://cle.linux.org.tw/fonts/FireFly/fireflysung-1.3.0.tar.gz
安裝字型
shell># tar xzvf fireflysung-1.3.0.tar.gz
shell># cp fireflysung/fireflysung.ttf /usr/share/fonts/zh_TW/TrueType
shell># fc-cache
裝好之後在各個應用軟體選擇使用 AR PL New Sung 或文鼎新宋字型
5. 設定無線網路
X61的無線網卡軔體可於 ELREPO 下載
shell># yum install iwl4965-firmware
6. 安裝 flash player 及 Adobe PDF Reader
到 adobe 下載,下載版本選擇『Yum for Linux』,點選下載後會得到一個 RPM 檔,其實這個 RPM 就是 Adobe 提供的 repo,安裝後除了 flash player 以外還能下載 PDF Reader
shell># rpm -ivh adobe-release-i386-1.0-1.noarch.rpm
shell># yum install flash-plugin AdobeReader_cht
7. 設定支援讀寫 NTFS
請參考這篇進行設定
8. 安裝 fileZilla (RPMForge repo)
shell># yum install filezilla
9.安裝 JAVA RunTime
到這裡下載 Oracle JAVA,然後參考 JAVA 網站所提供的指示進行安裝,最後請到這裡驗證
10. 安裝 rdesktop 及 tsclient,用來遠端連線到 Windows 平台
11.設定X61小紅點中鍵
shell># vim /etc/X11/xorg.conf
新增如下設定,完成後記得重啟Xwindow
1. 系統採用最小安裝,可以參考這篇,安裝完成後記得利用 Yum update 套件
2. 安裝套件:群組套件分別是X視窗系統,XFCE及中文支援(包含酷音輸入法),若不喜歡用XFCE的人可以換成 KDE 或 GNOME,自己用 yum grouplist 去看
shell># yum groupinstall "X Window System" "XFCE-4.4" "Chinese Support" "Sound and Video"
shell># yum install gdm NetworkManager-gnome readahead
註: 啟用readahead_early服務可以解決 firefox 觀看 flash 影片 CPU 爆衝問題
3. 安裝 FireFox4,下載之後的特殊處理參考這篇
4. 下載螢火飛字型
網站:http://cle.linux.org.tw/fonts/FireFly/
shell># wget http://cle.linux.org.tw/fonts/FireFly/fireflysung-1.3.0.tar.gz
安裝字型
shell># tar xzvf fireflysung-1.3.0.tar.gz
shell># cp fireflysung/fireflysung.ttf /usr/share/fonts/zh_TW/TrueType
shell># fc-cache
裝好之後在各個應用軟體選擇使用 AR PL New Sung 或文鼎新宋字型
5. 設定無線網路
X61的無線網卡軔體可於 ELREPO 下載
shell># yum install iwl4965-firmware
6. 安裝 flash player 及 Adobe PDF Reader
到 adobe 下載,下載版本選擇『Yum for Linux』,點選下載後會得到一個 RPM 檔,其實這個 RPM 就是 Adobe 提供的 repo,安裝後除了 flash player 以外還能下載 PDF Reader
shell># rpm -ivh adobe-release-i386-1.0-1.noarch.rpm
shell># yum install flash-plugin AdobeReader_cht
7. 設定支援讀寫 NTFS
請參考這篇進行設定
8. 安裝 fileZilla (RPMForge repo)
shell># yum install filezilla
9.安裝 JAVA RunTime
到這裡下載 Oracle JAVA,然後參考 JAVA 網站所提供的指示進行安裝,最後請到這裡驗證
10. 安裝 rdesktop 及 tsclient,用來遠端連線到 Windows 平台
11.設定X61小紅點中鍵
shell># vim /etc/X11/xorg.conf
新增如下設定,完成後記得重啟Xwindow
Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/input/mice" Option "Protocol" "ExplorerPS/2" Option "Emulate3Buttons" "on" Option "Emulate3TimeOut" "50" Option "EmulateWheel" "on" Option "EmulateWheelTimeOut" "200" Option "EmulateWheelButton" "2" Option "YAxisMapping" "4 5" Option "XAxisMapping" "6 7" Option "ZAxisMapping" "4 5" EndSection 12. 安裝 Dia 繪圖軟體 shell># yum --enablerepo=rpmforge install dia 13. 安裝 Thunderbird shell># yum install thunderbird 14. 設定可以解析 netbios 名稱 參考這篇
2011年6月11日
CentOS 5 安裝 firefox 4
在 CentOS5 下載 firefox4 後,執行時會因為缺少libstdc++.so.6而出現下面的錯誤訊息:
libstdc++.so.6: version GLIBCXX_3.4.9 not found
解決方法(X86):
1. 首先先確定系統有以下套件
shell># yum install alsa-lib atk cairo dbus-libs expat fontconfig freetype glib2 glibc gtk2 libcap libgcc libICE libjpeg libpng libSM libX11 libXau libXcursor libXdmcp libXext libXfixes libXi libXinerama libXrandr libXrender libXt pango xulrunner zlib
2. 下載 firefox4 及 libstdc++-4.3.0-8
shell># wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-4.0/linux-i686/en-US/firefox-4.0.1.tar.bz2
shell># wget http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/9/Fedora/i386/os/Packages/libstdc++-4.3.0-8.i386.rpm
3. 安裝
解壓縮 firefox4
shell># tar jxvf firefox-4.0.1.tar.bz2
現行目錄會多出一個名稱為 firefox 的目錄
shell># ls
firefox
libstdc++-4.3.0-8.i386.rpm
firefox-4.0.1.tar.bz2
將libstdc++.so.6.0.10 從 RPM 檔解出來放到 firefox4 目錄裡
shell># rpm2cpio ../libstdc++-4.3.0-8.i386.rpm | cpio -idv
shell># cp usr/lib/libstdc++.so.6.0.10 firefox
將 firefox 目錄搬到 /usr/local
shell># mv firefox /usr/local
編輯 /etc/ld.so.conf 讓系統可以找到 /usr/local/firefox下的動態程式庫
shell># vim /etc/ld.so.conf
新增
/usr/local/firefox
shell># ldconfig
4 執行 firefox4
/usr/local/firefox/firefox &
若執行後一直出現 firefox3 的話,請先重新開機就會正常了
5. 若你的CentOS為64位元,請參考CentOS wiki
6. 設定 firefox 偏好語系為中文(zh-TW),否則看中文網站時字體會糊湖的
libstdc++.so.6: version GLIBCXX_3.4.9 not found
解決方法(X86):
1. 首先先確定系統有以下套件
shell># yum install alsa-lib atk cairo dbus-libs expat fontconfig freetype glib2 glibc gtk2 libcap libgcc libICE libjpeg libpng libSM libX11 libXau libXcursor libXdmcp libXext libXfixes libXi libXinerama libXrandr libXrender libXt pango xulrunner zlib
2. 下載 firefox4 及 libstdc++-4.3.0-8
shell># wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-4.0/linux-i686/en-US/firefox-4.0.1.tar.bz2
shell># wget http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/9/Fedora/i386/os/Packages/libstdc++-4.3.0-8.i386.rpm
3. 安裝
解壓縮 firefox4
shell># tar jxvf firefox-4.0.1.tar.bz2
現行目錄會多出一個名稱為 firefox 的目錄
shell># ls
firefox
libstdc++-4.3.0-8.i386.rpm
firefox-4.0.1.tar.bz2
將libstdc++.so.6.0.10 從 RPM 檔解出來放到 firefox4 目錄裡
shell># rpm2cpio ../libstdc++-4.3.0-8.i386.rpm | cpio -idv
shell># cp usr/lib/libstdc++.so.6.0.10 firefox
將 firefox 目錄搬到 /usr/local
shell># mv firefox /usr/local
編輯 /etc/ld.so.conf 讓系統可以找到 /usr/local/firefox下的動態程式庫
shell># vim /etc/ld.so.conf
新增
/usr/local/firefox
shell># ldconfig
4 執行 firefox4
/usr/local/firefox/firefox &
若執行後一直出現 firefox3 的話,請先重新開機就會正常了
5. 若你的CentOS為64位元,請參考CentOS wiki
6. 設定 firefox 偏好語系為中文(zh-TW),否則看中文網站時字體會糊湖的
2010年11月24日
CentOS 安裝 PHP PEAR
若不知道PEAR是什麼的,可以參考 What is PEAR,PEAR目前也可以用來安裝PECL套件
YUM已經有PEAR套件了
shell># yum install php-pear
下載完成後,更新channel資料
shell># pear channel-update pear.php.net
Retrieving channel.xml from remote server
Channel pear.php.net channel.xml is up to date
安裝pear套件
shell># pear install Net_Ping
downloading Net_Ping-2.4.5.tgz ...
Starting to download Net_Ping-2.4.5.tgz (9,600 bytes)
.....done: 9,600 bytes
install ok: channel://pear.php.net/Net_Ping-2.4.5
列出目前系統安裝的pear套件庫
shell># pear list
若只想下載套件的話
shell># pear download Net_Ping
到PEAR PACKAGES尋找你要的套件
http://pear.php.net/manual/en/packages.php
參考文獻
http://pear.php.net
YUM已經有PEAR套件了
shell># yum install php-pear
下載完成後,更新channel資料
shell># pear channel-update pear.php.net
Retrieving channel.xml from remote server
Channel pear.php.net channel.xml is up to date
安裝pear套件
shell># pear install Net_Ping
downloading Net_Ping-2.4.5.tgz ...
Starting to download Net_Ping-2.4.5.tgz (9,600 bytes)
.....done: 9,600 bytes
install ok: channel://pear.php.net/Net_Ping-2.4.5
列出目前系統安裝的pear套件庫
shell># pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.1 stable
Console_Getopt 1.2 stable
Net_Ping 2.4.5 stable
PEAR 1.4.9 stable
XML_RPC 1.5.0 stable
若只想下載套件的話
shell># pear download Net_Ping
到PEAR PACKAGES尋找你要的套件
http://pear.php.net/manual/en/packages.php
參考文獻
http://pear.php.net
2010年11月10日
CentOS 安裝 EPEL (Extra Packages for Enterprise Linux) 套件庫
CentOS的套件庫除了 rpmforce 以外,現在還多了 Fedora Project 的 EPEL 囉,EPEL是由社群贊助的套件庫,主要用於 RedHat Entereprise Linux 及其他相似的系統,當然CentOS也包含在內。
要使用套件庫,只要下達一個指令就完成了
接下來只要用yum就可以安裝EPEL的套件了
參考資料
Fedora wiki
要使用套件庫,只要下達一個指令就完成了
shell># rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
※使用CentOS 4的人,可透過參考資料的連結到fedora wiki取得rpm的連結點
接下來只要用yum就可以安裝EPEL的套件了
shell># yum info mod_securityLoaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: ftp.tcc.edu.tw
* base: ftp.tcc.edu.tw
* centosplus: ftp.tcc.edu.tw
* contrib: ftp.tcc.edu.tw
* epel: mirror01.idc.hinet.net
* extras: ftp.tcc.edu.tw
* updates: ftp.tcc.edu.tw
Available Packages
Name : mod_security
Arch : i386
Version : 2.5.12
Release : 1.el5
Size : 1.0 M
Repo : epel
Summary : Security module for the Apache HTTP Server
URL : http://www.modsecurity.org/
License : GPLv2
Description: ModSecurity is an open source intrusion detection and prevention engine
: for web applications. It operates embedded into the web server, acting
: as a powerful umbrella - shielding web applications from attacks.
參考資料
Fedora wiki
訂閱:
文章 (Atom)