我正在安装rfc5766-转服务器。但它无法启动并出现错误:
error while loading shared libraries: libevent_core-2.0.so.5: cannot open shared object file: No such file or directory
这是我如何进行安装的复制粘贴:
$ cd /var/tmp;
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz; tar xvfz libevent-2.0.21-stable.tar.gz; cd libevent-2.0.21-stable; ./configure; make; make install;
wget http://rfc5766-turn-server.googlecode.com/files/turnserver-1.8.6.3.tar.gz ; tar xvfz turnserver-1.8.6.3.tar.gz; cd turnserver-1.8.6.3; ./configure; make; make install;
/var/tmp/turnserver-1.8.6.3/bin/turnserver;
我尝试了这个,但没有帮助(同样的错误):
$ ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5;
/var/tmp/turnserver-1.8.6.3/bin/turnserver ;
编辑:(如果我按如下方式运行,则无需更改即可运行它,但是当我使用客户端进行测试时,它不会显示 TURN 正在命中或客户端到达的任何类型的日志)
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/;
PATH="bin:../bin:../../bin:${PATH}" turnserver -L 176.34.x.x -a -b /usr/local/etc/turnuserdb.conf -f -r 176.34.x.x
1371111272: RFC 5389/5766/5780/6062/6156 STUN/TURN Server, version Citrix-1.8.6.3 'Black Dow'
1371111272: Config file found: /usr/local/etc/turnserver.conf
1371111272: Listener address to use: 176.34.x.x
1371111272: Config file found: /usr/local/etc/turnserver.conf
1371111272: WARNING: cannot find certificate file: turn_server_cert.pem (1)
1371111272: WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
1371111272: WARNING: cannot find private key file: turn_server_pkey.pem (1)
1371111272: WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
1371111272: Relay address to use: 176.34.x.x
1371111272: IO method (listener thread): epoll
1371111272: WARNING: I cannot start alternative services of RFC 5780 because only one IP address is provided
1371111272: IO method: epoll
1371111272: IPv4. UDP listener opened on : 0.0.0.0:0
1371111272: IPv4. TCP listener opened on : 0.0.0.0:39227
1371111272: IO method (auth thread): epoll
1371111272: IO method (relay thread): epoll
答案1
首先,一个明显的问题:该库是否已安装?
还有安装了吗为了正确的架构? (例如,32 位可执行文件需要 32 位库,64 位可执行文件需要 64 位库。)
如果您刚刚将库添加到系统库路径中的目录中,则需要运行ldconfig
作为根。有已安装库的缓存,并ldconfig
重建该缓存。如果某个库存在于目录中但不在缓存中,则不会使用它。
我看到您将库添加到了/usr/local/lib
.大多数发行版将其包含在默认库路径中,但 Red Hat 没有。将其添加到/etc/ld.so.conf
然后运行ldconfig
。
运行ldd /path/to/excecutable
以查看可执行文件在哪里找到其库。当找不到库时,strace /path/to/executable
会告诉您程序在哪里寻找它。