linux 服务器安装cutycapt,抓取网页快照
1、安装svn
yuminstall-ysubversion
2、安装qt47
增加qt47的下载源
#vi/etc/yum.repos.d/atrpms.repo
输入如下内容
[atrpms]
name=CentOS$releasever–$basearch–ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1
[atrpms-testing]
name=CentOS$releasever–$basearch–ATrpmstesting
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1
安装qt47
#yuminstall-yqt47
#yuminstall-yqt47-devel
如果提示有冲突
yumremovelibX11-1.0.3-11.el5.i386
再执行yuminstallqt47-devel
继续安装如下两个工具
#yuminstall-yqt47-webkit
#yuminstall-yqt47-webkit-devel
3、更新sqllite
yumupdatesqlite
4、更新/etc/profile,将下面代码加入profile中
exportQTDIR=/usr/lib64/qt47
exportQTLIB=/usr/lib64/qt47/lib
exportQTINC=/usr/lib64/qt47/include
exportLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
exportPATH=$QTDIR/bin:$PATH
4.1刷新当前缓存
source/etc/profile
5、安装g++
yuminstallgccgcc-c++
6、编译
cd/home/cloud/cutycapt/CutyCapt
qmake
make
7、安装xserver
yumgroupinstall"XWindowSystem"-y
如果遇到冲突卸载冲突的包
yumremovelibX11-1.1.3-4.el5.x86_64
此时会将刚才安装的qt47的包全删除掉
再重新安装qt47yuminstallqt47*
8、安装server模拟环境
yuminstall-yXvfb
9、下载模拟环境命令
wgethttp://www.flexthinker.com/wp-content/uploads/2009/11/xvfb-run.sh.txt
mv./xvfb-run.sh.txt./xvfb-run.sh
chmodu+x./xvfb-run.sh
10、安装中文字体
yuminstall-yfonts-chinese
11、执行测试
/home/cloud/cutycapt/CutyCapt/xvfb-run.sh/home/cloud/cutycapt/CutyCapt/CutyCapt--url=http://www.miercn.com/--out=163.jpg
出现错误:
CutyCapt:xcb_xlib.c:82:xcb_xlib_unlock:断言“c->xlib.lock”失败。
执行exportLIBXCB_ALLOW_SLOPPY_LOCK=1
重新测试后成功生成图片,将exportLIBXCB_ALLOW_SLOPPY_LOCK=1更新至/etc/profile