ToroLiu
8/8/2017 - 7:09 AM

In order to install casper in CentOS

In order to install casper in CentOS

#!/bin/sh

## Preconditions

# phantomjs prerequisites, see https://www.bonusbits.com/wiki/HowTo:Install_PhantomJS_on_CentOS
yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++
# for bunzip2 
yum install bzip2
# for git
yum install git

# PhantomJS version
# See http://phantomjs.org/download.html, for Linux 64-bit
target=phantomjs-2.1.1-linux-x86_64

## Install PhantomJS
wget https://bitbucket.org/ariya/phantomjs/downloads/${target}.tar.bz2
bunzip2 ${target}.tar.bz2 
tar xf ${target}.tar 
mv ${target} /opt/
ln -s /opt/${target}/ /opt/phantomjs
ln -s /opt/phantomjs/bin/phantomjs /usr/local/bin/

#check what you've just done
which phantomjs
phantomjs --version

## Install casperJS
#start installing casperjs
git clone https://github.com/n1k0/casperjs.git 
mv casperjs/ /opt/casperjs
ln -s /opt/casperjs/bin/casperjs  /usr/local/bin/

#check what you've just done
which casperjs
casperjs --version

# Based on https://gist.github.com/florinel-chis/6173221