装了个SSR分享面板,轻车熟路在自己的闲置VPS装了后端节点,可启动不成功。明明是轻车熟路,别的机器上也是这么装的,为啥就不成功?百思不得其解

启动时时抛出一堆错误如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[root@xx shadowsocksr]# ./server.py 
IPv6 support
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
self.run()
File "./server.py", line 39, in run
self.obj.thread_db(self.obj)
File "/root/shadowsocksr/db_transfer.py", line 233, in thread_db
ServerPool.get_instance()
File "/root/shadowsocksr/server_pool.py", line 69, in get_instance
ServerPool.instance = ServerPool()
File "/root/shadowsocksr/server_pool.py", line 49, in __init__
self.config = shell.get_config(False)
File "/root/shadowsocksr/shadowsocks/shell.py", line 299, in get_config
check_config(config, is_local)
File "/root/shadowsocksr/shadowsocks/shell.py", line 129, in check_config
encrypt.try_cipher(config['password'], config['method'])
File "/root/shadowsocksr/shadowsocks/encrypt.py", line 46, in try_cipher
Encryptor(key, method)
File "/root/shadowsocksr/shadowsocks/encrypt.py", line 90, in __init__
random_string(self._method_info[1]))
File "/root/shadowsocksr/shadowsocks/encrypt.py", line 119, in get_cipher
return m[2](method, key, iv, op)
File "/root/shadowsocksr/shadowsocks/crypto/sodium.py", line 71, in __init__
load_libsodium()
File "/root/shadowsocksr/shadowsocks/crypto/sodium.py", line 42, in load_libsodium
raise Exception('libsodium not found')
Exception: libsodium not found

之前一直纠结前面的 ...line 812, in __bootstrap_inner... 这些错误,搜索引擎各种查也没答案,倒是有问同样的问题的。
想想自己是在此次把加密方式换成了 chacha20-ietf ,改回去就好了。再返回来看错误,最后已经提示:libsodium not found 。既然是这样,那么解决此问题先:

1
2
3
4
5
6
7
yum install wget m2crypto git libsodium -y
yum -y groupinstall "Development Tools"
wget https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gz
tar xf libsodium-1.0.16.tar.gz && cd libsodium-1.0.16
./configure && make -j2 && make install
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig

解决这个问题的途中可能还会出现其他问题,按提示一一解决即可。libsodium安装完成后再使用chacha20-ietf加密即可正常启动了。

参考文档