尝试在 OpenShift 上运行 PhantomJS:无法修补 GhostDriver 以便它可以绑定服务器 IP 地址 [英] Trying to run PhantomJS on OpenShift: cannot patch GhostDriver so that it can bind on the server IP address

查看:26
本文介绍了尝试在 OpenShift 上运行 PhantomJS:无法修补 GhostDriver 以便它可以绑定服务器 IP 地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tl;dr

How to solve version 'GLIBCXX_3.4.15' not found when I cannot be root on the Linux server?


I'm tring to use PhantomJS on OpenShift. As explained in this article, PhantomJS GhostDriver binds on localhost only, while on OpenShift, you cannot bind anything on localhost (you need to specify the machine IP address). Paolo Bernardi (the author of the article) shares a patch that fixes PhantomJS, so that it's possible to bind on an IP address.

The problem is that the provided patch does not work on my OpenShift server: when running ./phantomjs -v on my patched PhantomJS installation, I catch a segmentation fault. So I decided to compile PhantomJS with the fix by myself on a Debian server I have, thanks to PhantomJS documentation:

sudo apt-get install build-essential g++ flex bison gperf ruby perl libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libpng-dev libjpeg-dev python ttf-mscorefonts-installer
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.9
# apply the fix
./build.sh

When running ./phantomjs -v on the compiled binary, I get 1.9.8: it worked.

When copying this binary on OpenShift and running ./phantomjs -v, I catch an error:

./phantomjs: /usr/lib64/libstdc++.so.6: version 'GLIBCXX_3.4.15' not found (required by ./phantomjs)

Any idea how to solve this? What's the reason of this error? Please excuse my lack of system knownledge :)


Update (and solution):

Thanks to moleculartear, I compiled a patched binary on an RHEL OS: no error anymore!

The working PhantomJS binary: https://github.com/jrestful/server/blob/master/seo/phantomjs-1.9.8-patched.tar.gz?raw=true


More details:

I cannot update GLIBC version on OpenShift since I cannot be root (unless there are some workarounds).

I cannot compile PhantomJS on OpenShift directly since I don't have enough space for the sources on that server.

My OpenShift cartridges: Tomcat 7 (JBoss EWS 2.0) + MongoDB 2.4 + RockMongo 1.1.

On my Debian server:

$ uname -a
Linux servername 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux

$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBC_2.2.5
GLIBC_2.3
GLIBC_2.3.2
GLIBCXX_DEBUG_MESSAGE_LENGTH

On my OpenShift server:

$ uname -a
Linux servername 2.6.32-504.3.3.el6.x86_64 #1 SMP Fri Dec 12 16:05:43 EST 2014 x86_64 x86_64 x86_64 GNU/Linux

$ strings /usr/lib/libstdc++.so.6 | grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBC_2.0
GLIBC_2.3
GLIBC_2.4
GLIBC_2.1
GLIBC_2.1.3
GLIBC_2.3.2
GLIBC_2.2
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

解决方案

Since OpenShift Online runs on RHEL, you should be able to install CentOS into a VM on your local machine (or run one in the cloud somewhere) and compile a version of PhantomJS with the patch and then upload it to your OpenShift server and use it.

If you can't do that please use the contact us form at help.openshift.com and reference this stackoverflow question.

这篇关于尝试在 OpenShift 上运行 PhantomJS:无法修补 GhostDriver 以便它可以绑定服务器 IP 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆