Skip to content

Instantly share code, notes, and snippets.

@masaki
Created September 23, 2011 17:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save masaki/1238005 to your computer and use it in GitHub Desktop.
Save masaki/1238005 to your computer and use it in GitHub Desktop.
PhantomJS on CentOS-5
# SEE: http://d.hatena.ne.jp/shim0mura/20110730/1312046133
# SEE: https://gist.github.com/1031961
# SEE: http://atrpms.net/documentation/install/
# 1. prepare
$ cat /etc/yum.repos.d/atrpms.repo
[atrpms-stable]
name=ATrpms RHEL5 stable
baseurl=http://dl.atrpms.net/el5-$basearch/atrpms/stable/
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1
[atrpms-testing]
name=ATrpms RHEL5 testing
baseurl=http://dl.atrpms.net/el5-$basearch/atrpms/testing/
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1
$ wget http://packages.atrpms.net/RPM-GPG-KEY.atrpms
$ sudo rpm --import RPM-GPG-KEY.atrpms
$ sudo yum install qt47-webkit qt47-webkit-devel qt47-devel sqlite sqlite-devel
# 2. build
$ wget http://phantomjs.googlecode.com/files/phantomjs-1.3.0-source.tar.gz
$ tar zxvf phantomjs-1.3.0-source.tar.gz
$ cd phantomjs-1.3.0
$ qmake-qt47 && make
# 3. run
$ sudo yum install xorg-x11-server-Xvfb xorg-x11-fonts*
$ Xvfb :2 -screen 0 1024x768x24 2> /dev/null &
$ export DISPLAY=:2.0
$ bin/phantomjs example.js
@eneko
Copy link

eneko commented Dec 22, 2011

Nice script, very useful. Any ideas how to run Xvfb as a service, so it can be accessible any time?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment