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

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

问题描述

tl;博士

当我不能以Linux服务器为根时,如何解决version 'GLIBCXX_3.4.15' not found?


我想在OpenShift上使用PhantomJS.正如本文(PhantomJS)中所述GhostDriver仅在本地主机上绑定,而在OpenShift上,您不能在本地主机上绑定任何内容(您需要指定计算机IP地址). Paolo Bernardi (本文的作者)分享了修复编译PhantomJS,感谢 PhantomJS文档:

 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
 

在已编译的二进制文件上运行./phantomjs -v时,我得到1.9.8:它有效.

在OpenShift上复制此二进制文件并运行./phantomjs -v时,出现错误:

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

有什么办法解决这个问题吗?此错误的原因是什么?请原谅我缺乏系统已知的知识:)


更新(和解决方案):

由于 moleculartear ,我在RHEL操作系统上编译了补丁二进制文件:不再出错!

有效的PhantomJS二进制文件: https://github.com/jrestful/server/blob/master/seo/phantomjs-1.9.8-patched.tar.gz?raw=true


更多详细信息:

由于我无法成为root用户,所以我无法在OpenShift上更新GLIBC版本(除非有一些解决方法).

我无法在OpenShift上直接编译PhantomJS,因为我没有足够的空间容纳 $ 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

在我的OpenShift服务器上:

 $ 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
 

由于OpenShift Online在RHEL上运行,因此您应该能够将CentOS安装到本地计算机上的VM(或在本地的云中运行)并编译版本的PhantomJS及其补丁,然后将其上传到您的OpenShift服务器并使用.

如果无法执行此操作,请使用help.openshift.com上的与我们联系"表单,并参考此stackoverflow问题.

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天全站免登陆