2010年10月14日 星期四

CentOS 安裝 FluxBox + Vnc + firefox 網頁快拍

第一步:安裝 Yum-Priorities

yum install yum-priorities


 

第二步:修改 /etc/yum.repos.d/CentOS-Base.repo 增加以下紅色字串

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#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/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#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/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#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/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2

#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/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2 


 

第三步:下載 RpmForge

32bit :wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm

64bit :wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm 


 

第四步:導入 RPM-GPG-Key

wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt 

rpm  -import ./RPM-GPG-KEY.dag.txt


 

第五步:安裝 RpmForge

32bit :rpm –ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm

64bit :rpm –ivh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm


 

第六步:修改 /etc/yum.repos.d/rpmforge.repo 最後加上 priority=11

### Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/RedHat/el5/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/RedHat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=11

第七步:安裝 vnc vnc-server fluxbox firefox x11-xorg

yum –y install vnc vnc-server fluxbox firefox x11-xorg


 

第八步:設定 vncserver 密碼

vncserver


 

第九步:設定 vnc 登入即啟動 fluxbox

pkill -9 vnc

rm –rf /tmp/.X1*

vim ~/.vnc/xstartup

修改 twn& 為 exec /usr/bin/fluxbox


 

第十步:啟動 vncserver

vncserver


 

第十一步:使用 realvnc 連入 IP:5901


http://www.realvnc.com/cgi-bin/4.0-download.cgi


 

第十二步:安装firefox插件,Pearl Crescent Page Saver 設定截圖後目錄

地址:http://pearlcrescent.com/products/pagesaver/


 

第十三步:設定環境參數, 使用 firefox 截圖

export DISPLAY=:1.0

firefox -saveimage http://tw.yahoo.com


 

以上環境需開啟 fluxbox 才可使用 firefox 截圖, 透過 xvfb-run.sh 可模擬 x-windows 執行 firefox 截圖

wget http://www.flexthinker.com/wp-content/uploads/2009/11/xvfb-run.sh.txt

mv xvfb-run.sh.txt /usr/bin/xvfb-run.sh

chmod u+x /usr/bin/xvfb-run.sh

/usr/bin/xvfb-run.sh /usr/bin/firefox –saveimage http://tw.yahoo.com

/usr/bin/vfb-run.sh --server-args="-screen 0, 1024x768x24" /usr/bin/firefox -saveimage http://www.591.com.tw


 

1 ~ 6 步驟使用以下取代

install rpmforge

website:http://www.rpmrepo.org/RPMforge/Using

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm

rpm -ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm


 

7 ~ 8

install fluxbox firefox xorg-x11-xinit vnc-server

yum -y install fluxbox firefox xorg-x11-xinit vnc-server

沒有留言:

張貼留言