На моент написания поста последняя версия Casperjs соответствовала предыдущему релизу Phantomjs. Так что мне пришлось искать в репозитории версию phantomjs-1.9.8-linux-i686 и устанавливать ее. Здесь подробный лог установки. Надо запомнить прием создания символической ссылки ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
How to install PhantomJS on Ubuntu
Downloads
PhantomJS 1.9 Release Notes
New to PhantomJS? Install it and read the quick start guide.
Install and configure PhantomJS
CasperJS can be installed PhantomJS 1.8.2 or greater, but less than 2.0. Installation instructions can be found here
Плохая новость 1 - для установки под Linux требуется большое количество dev пакетов¶
Среди большого количества мануалов по установке я выбра How to install PhantomJS on Ubuntu. Но просмотреть пришлось несколько. Во всех иодин и тот же перечень необходимых библиотек. Процесс проверки и доустановки из моей консоли я скопировал в приложение "Предварительная установка пакетов для стэка Phantomjs" в конце этого поста. Начинать надо с него.
Плохая новость 2 - ставить надо не последнюю версию¶
Все вот из-за этой строчки в инструкции на сайте Casperjs CasperJS can be installed
PhantomJS 1.8.2 or greater, but less than 2.0. Installation instructions can be found here
Поэтому не ставим последню (сегодня) вторую версию, а ищем репозиторий Downloads. Находим в репозитории версию 1.9.8
root@kali:/home/kiss/Downloads# cd ~
Далее отвлечемся от процесса установки и обратим внимание на изящный прием работы в консоли. Вот адрес ссылки, которую надо использовать для скачивания на 32-разрядный Linux
https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-i686.tar.bz2
Просто скачать пакет - это скучно, мы повторим понт автора How to install PhantomJS on Ubuntu
root@kali:~# export PHANTOM_JS="phantomjs-1.9.8-linux-i686"
Отметим прием $PHANTOM_JS.tar.bz2 - мы задали переменную, в которой соержится имя без расширения, а расширение можно дописать вот таким простым способом:
root@kali:~# wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
--2015-05-30 11:15:17-- https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-i686.tar.bz2
Resolving bitbucket.org (bitbucket.org)... 131.103.20.168, 131.103.20.167
Connecting to bitbucket.org (bitbucket.org)|131.103.20.168|:443... connected.
HTTP request sent, awaiting response... 302 FOUND
Location: https://bbuseruploads.s3.amazonaws.com/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-i686.tar.bz2?Signature=XlukguRKcWLedEwN%2F5025QoPCYI%3D&Expires=1432974737&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82&response-content-disposition=attachment%3B%20filename%3D%22phantomjs-1.9.8-linux-i686.tar.bz2%22 [following]
--2015-05-30 11:15:19-- https://bbuseruploads.s3.amazonaws.com/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-i686.tar.bz2?Signature=XlukguRKcWLedEwN%2F5025QoPCYI%3D&Expires=1432974737&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82&response-content-disposition=attachment%3B%20filename%3D%22phantomjs-1.9.8-linux-i686.tar.bz2%22
Resolving bbuseruploads.s3.amazonaws.com (bbuseruploads.s3.amazonaws.com)... 54.231.18.201
Connecting to bbuseruploads.s3.amazonaws.com (bbuseruploads.s3.amazonaws.com)|54.231.18.201|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13517724 (13M) [application/x-tar]
Saving to: `phantomjs-1.9.8-linux-i686.tar.bz2'
100%[====================================================================================================>] 13,517,724 1.36M/s in 9.8s
2015-05-30 11:15:30 (1.31 MB/s) - `phantomjs-1.9.8-linux-i686.tar.bz2' saved [13517724/13517724]
root@kali:~#
Распакуем тут же
root@kali:~# tar xvjf $PHANTOM_JS.tar.bz2
phantomjs-1.9.8-linux-i686/
phantomjs-1.9.8-linux-i686/bin/
phantomjs-1.9.8-linux-i686/bin/phantomjs
phantomjs-1.9.8-linux-i686/third-party.txt
phantomjs-1.9.8-linux-i686/ChangeLog
phantomjs-1.9.8-linux-i686/LICENSE.BSD
phantomjs-1.9.8-linux-i686/README.md
phantomjs-1.9.8-linux-i686/examples/
phantomjs-1.9.8-linux-i686/examples/loadurlwithoutcss.coffee
phantomjs-1.9.8-linux-i686/examples/ipgeocode.coffee
phantomjs-1.9.8-linux-i686/examples/imagebin.coffee
phantomjs-1.9.8-linux-i686/examples/weather.coffee
phantomjs-1.9.8-linux-i686/examples/echoToFile.coffee
phantomjs-1.9.8-linux-i686/examples/rasterize.coffee
phantomjs-1.9.8-linux-i686/examples/netsniff.coffee
phantomjs-1.9.8-linux-i686/examples/useragent.js
phantomjs-1.9.8-linux-i686/examples/fibo.js
phantomjs-1.9.8-linux-i686/examples/printenv.coffee
phantomjs-1.9.8-linux-i686/examples/arguments.coffee
phantomjs-1.9.8-linux-i686/examples/countdown.js
phantomjs-1.9.8-linux-i686/examples/colorwheel.js
phantomjs-1.9.8-linux-i686/examples/netlog.coffee
phantomjs-1.9.8-linux-i686/examples/tweets.coffee
phantomjs-1.9.8-linux-i686/examples/netsniff.js
phantomjs-1.9.8-linux-i686/examples/seasonfood.js
phantomjs-1.9.8-linux-i686/examples/walk_through_frames.js
phantomjs-1.9.8-linux-i686/examples/run-qunit.js
phantomjs-1.9.8-linux-i686/examples/hello.js
phantomjs-1.9.8-linux-i686/examples/pagecallback.js
phantomjs-1.9.8-linux-i686/examples/sleepsort.js
phantomjs-1.9.8-linux-i686/examples/pagecallback.coffee
phantomjs-1.9.8-linux-i686/examples/rasterize.js
phantomjs-1.9.8-linux-i686/examples/serverkeepalive.js
phantomjs-1.9.8-linux-i686/examples/technews.js
phantomjs-1.9.8-linux-i686/examples/printheaderfooter.coffee
phantomjs-1.9.8-linux-i686/examples/pizza.coffee
phantomjs-1.9.8-linux-i686/examples/render_multi_url.coffee
phantomjs-1.9.8-linux-i686/examples/imagebin.js
phantomjs-1.9.8-linux-i686/examples/direction.coffee
phantomjs-1.9.8-linux-i686/examples/sleepsort.coffee
phantomjs-1.9.8-linux-i686/examples/countdown.coffee
phantomjs-1.9.8-linux-i686/examples/unrandomize.coffee
phantomjs-1.9.8-linux-i686/examples/detectsniff.js
phantomjs-1.9.8-linux-i686/examples/simpleserver.js
phantomjs-1.9.8-linux-i686/examples/run-jasmine.coffee
phantomjs-1.9.8-linux-i686/examples/stdin-stdout-stderr.coffee
phantomjs-1.9.8-linux-i686/examples/arguments.js
phantomjs-1.9.8-linux-i686/examples/version.coffee
phantomjs-1.9.8-linux-i686/examples/module.coffee
phantomjs-1.9.8-linux-i686/examples/printheaderfooter.js
phantomjs-1.9.8-linux-i686/examples/postserver.coffee
phantomjs-1.9.8-linux-i686/examples/follow.js
phantomjs-1.9.8-linux-i686/examples/server.js
phantomjs-1.9.8-linux-i686/examples/phantomwebintro.js
phantomjs-1.9.8-linux-i686/examples/netlog.js
phantomjs-1.9.8-linux-i686/examples/stdin-stdout-stderr.js
phantomjs-1.9.8-linux-i686/examples/module.js
phantomjs-1.9.8-linux-i686/examples/ipgeocode.js
phantomjs-1.9.8-linux-i686/examples/render_multi_url.js
phantomjs-1.9.8-linux-i686/examples/run-jasmine.js
phantomjs-1.9.8-linux-i686/examples/post.coffee
phantomjs-1.9.8-linux-i686/examples/walk_through_frames.coffee
phantomjs-1.9.8-linux-i686/examples/page_events.js
phantomjs-1.9.8-linux-i686/examples/post.js
phantomjs-1.9.8-linux-i686/examples/outputEncoding.js
phantomjs-1.9.8-linux-i686/examples/direction.js
phantomjs-1.9.8-linux-i686/examples/features.coffee
phantomjs-1.9.8-linux-i686/examples/weather.js
phantomjs-1.9.8-linux-i686/examples/seasonfood.coffee
phantomjs-1.9.8-linux-i686/examples/pizza.js
phantomjs-1.9.8-linux-i686/examples/universe.js
phantomjs-1.9.8-linux-i686/examples/tweets.js
phantomjs-1.9.8-linux-i686/examples/serverkeepalive.coffee
phantomjs-1.9.8-linux-i686/examples/phantomwebintro.coffee
phantomjs-1.9.8-linux-i686/examples/detectsniff.coffee
phantomjs-1.9.8-linux-i686/examples/version.js
phantomjs-1.9.8-linux-i686/examples/waitfor.js
phantomjs-1.9.8-linux-i686/examples/features.js
phantomjs-1.9.8-linux-i686/examples/child_process-examples.coffee
phantomjs-1.9.8-linux-i686/examples/child_process-examples.js
phantomjs-1.9.8-linux-i686/examples/printmargins.coffee
phantomjs-1.9.8-linux-i686/examples/unrandomize.js
phantomjs-1.9.8-linux-i686/examples/page_events.coffee
phantomjs-1.9.8-linux-i686/examples/server.coffee
phantomjs-1.9.8-linux-i686/examples/useragent.coffee
phantomjs-1.9.8-linux-i686/examples/loadspeed.js
phantomjs-1.9.8-linux-i686/examples/simpleserver.coffee
phantomjs-1.9.8-linux-i686/examples/colorwheel.coffee
phantomjs-1.9.8-linux-i686/examples/postserver.js
phantomjs-1.9.8-linux-i686/examples/technews.coffee
phantomjs-1.9.8-linux-i686/examples/fibo.coffee
phantomjs-1.9.8-linux-i686/examples/printenv.js
phantomjs-1.9.8-linux-i686/examples/injectme.js
phantomjs-1.9.8-linux-i686/examples/follow.coffee
phantomjs-1.9.8-linux-i686/examples/printmargins.js
phantomjs-1.9.8-linux-i686/examples/modernizr.js
phantomjs-1.9.8-linux-i686/examples/loadurlwithoutcss.js
phantomjs-1.9.8-linux-i686/examples/waitfor.coffee
phantomjs-1.9.8-linux-i686/examples/movies.coffee
phantomjs-1.9.8-linux-i686/examples/echoToFile.js
phantomjs-1.9.8-linux-i686/examples/injectme.coffee
phantomjs-1.9.8-linux-i686/examples/hello.coffee
phantomjs-1.9.8-linux-i686/examples/scandir.coffee
phantomjs-1.9.8-linux-i686/examples/run-qunit.coffee
phantomjs-1.9.8-linux-i686/examples/movies.js
phantomjs-1.9.8-linux-i686/examples/outputEncoding.coffee
phantomjs-1.9.8-linux-i686/examples/scandir.js
phantomjs-1.9.8-linux-i686/examples/loadspeed.coffee
root@kali:~#
Теперь всю папку переместим в /usr/local/share
root@kali:~# mv $PHANTOM_JS /usr/local/share
root@kali:~# ls
Desktop phantomjs-1.9.8-linux-i686.tar.bz2
И создадим символьную ссылку (symlink) на исполняемый файл в директории /usr/local/bin
root@kali:~# ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
Напрашивается сравнение с переменной PATH в Windows, ... теперь Фантом дожен запустится даже из пространста имен этой notebook
!phantomjs --version
!ln --help
Приложение. Предварительная установка пакетов для стэка Phantomjs¶
root@kali:/home/kiss/Downloads# apt-get update
Hit http://dl.google.com stable Release.gpg
Hit http://dl.google.com stable Release
Hit http://dl.google.com stable/main i386 Packages
Ign http://dl.google.com stable/main Translation-en_US
Hit http://http.kali.org kali Release.gpg
Ign http://dl.google.com stable/main Translation-en
Ign http://dl.google.com stable/main Translation-en_GB
Hit http://security.kali.org kali/updates Release.gpg
Hit http://http.kali.org kali Release
Hit http://security.kali.org kali/updates Release
Hit http://http.kali.org kali/main Sources
Hit http://security.kali.org kali/updates/main i386 Packages
Hit http://http.kali.org kali/non-free Sources
Hit http://security.kali.org kali/updates/contrib i386 Packages
Hit http://http.kali.org kali/contrib Sources
Hit http://security.kali.org kali/updates/non-free i386 Packages
Hit http://http.kali.org kali/main i386 Packages
Hit http://http.kali.org kali/non-free i386 Packages
Hit http://http.kali.org kali/contrib i386 Packages
Ign http://security.kali.org kali/updates/contrib Translation-en_US
Ign http://security.kali.org kali/updates/contrib Translation-en
Ign http://security.kali.org kali/updates/contrib Translation-en_GB
Ign http://security.kali.org kali/updates/main Translation-en_US
Ign http://security.kali.org kali/updates/main Translation-en
Ign http://http.kali.org kali/contrib Translation-en_US
Ign http://security.kali.org kali/updates/main Translation-en_GB
Ign http://http.kali.org kali/contrib Translation-en
Ign http://security.kali.org kali/updates/non-free Translation-en_US
Ign http://http.kali.org kali/contrib Translation-en_GB
Ign http://security.kali.org kali/updates/non-free Translation-en
Ign http://http.kali.org kali/main Translation-en_US
Ign http://security.kali.org kali/updates/non-free Translation-en_GB
Ign http://http.kali.org kali/main Translation-en
Ign http://http.kali.org kali/main Translation-en_GB
Ign http://http.kali.org kali/non-free Translation-en_US
Ign http://http.kali.org kali/non-free Translation-en
Ign http://http.kali.org kali/non-free Translation-en_GB
Reading package lists... Done
root@kali:/home/kiss/Downloads# apt-get install build-essential chrpath libssl-dev libxft-devapt-get install build-essential chrpath libssl-dev libxft-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libxft-devapt-get
E: Unable to locate package install
root@kali:/home/kiss/Downloads# apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
build-essential set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@kali:/home/kiss/Downloads# apt-get install chrpath libssl-dev libxft-devapt-get install build-essential chrpath libssl-dev libxft-devReading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libxft-devapt-get
E: Unable to locate package install
root@kali:/home/kiss/Downloads# apt-get install chrpath libssl-dev build-essential chrpath libssl-dev libxft-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
libxft-dev is already the newest version.
libxft-dev set to manually installed.
libssl-dev is already the newest version.
libssl-dev set to manually installed.
The following NEW packages will be installed:
chrpath
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 13.6 kB of archives.
After this operation, 86.0 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://http.kali.org/kali/ kali/main chrpath i386 0.13-2 [13.6 kB]
Fetched 13.6 kB in 5s (2,378 B/s)
Selecting previously unselected package chrpath.
(Reading database ... 431624 files and directories currently installed.)
Unpacking chrpath (from .../chrpath_0.13-2_i386.deb) ...
Processing triggers for man-db ...
Setting up chrpath (0.13-2) ...
root@kali:/home/kiss/Downloads# install build-essential chrpath libssl-dev libxft-dev
install: target `libxft-dev' is not a directory
root@kali:/home/kiss/Downloads# install build-essential chrpath libssl-dev
install: target `libssl-dev' is not a directory
root@kali:/home/kiss/Downloads# apt-get install build-essential chrpath libssl-dev libxft-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
chrpath is already the newest version.
libxft-dev is already the newest version.
libssl-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@kali:/home/kiss/Downloads# apt-get install libfreetype6 libfreetype6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libfreetype6 is already the newest version.
libfreetype6 set to manually installed.
libfreetype6-dev is already the newest version.
libfreetype6-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@kali:/home/kiss/Downloads# apt-get install libfontconfig1 libfontconfig1-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libfontconfig1 is already the newest version.
libfontconfig1 set to manually installed.
libfontconfig1-dev is already the newest version.
libfontconfig1-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@kali:/home/kiss/Downloads# ^C
Посты чуть ниже также могут вас заинтересовать
Комментариев нет:
Отправить комментарий