bimoe

#教程# SSPanel-V3-mod 搭建教程(宝塔)
教程迁移至 https://imoe.dev/部署后端登录面板,点击管理面板:添加节点:填写「节点名称」与「节点地...
扫描右侧二维码阅读全文
05
2018/08

#教程# SSPanel-V3-mod 搭建教程(宝塔)

教程迁移至 https://imoe.dev/

部署后端

登录面板,点击管理面板:
image026.png

添加节点:
image027.png

填写「节点名称」与「节点地址」,其他项目按提示填写,然后点击添加:
image028.png

节点添加成功后,牢记节点ID,稍后用到:
image029.png

搭建后端

【可选】安装 BBR 加速(不支持 OpenVZ):

wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh

【可选】安装 libsodium(更多加密方式):

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

安装 shadowsocks-manyuser:

cd /root 
yum -y install python-setuptools wget unzip
easy_install pip
wget https://files.re/codes/shadowsocks.zip && unzip -q shadowsocks.zip
cd shadowsocks
pip install -r requirements.txt
cp apiconfig.py userapiconfig.py
cp config.json user-config.json
chmod +x run.sh stop.sh

关闭 CentOS 7 的防火墙并禁用:

systemctl stop firewalld.service
systemctl disable firewalld.service

编辑节点:

vi userapiconfig.py

按键盘 i 键,进入编辑模式

只需修改以下三项即可:
NODE_ID 是添加节点的 ID
WEBAPI_URL 填写前端面板的域名
WEBAPI_TOKEN 填写的是 /config/.config.php 配置文件内的 muKey
image030.png
image031.png
按键盘 esc 键退出编辑模式,输入 :wq 保存并退出。

调试运行:

python server.py

回显以下内容即对接成功:
image032.png
Ctrl + c 退出调试。

后台运行:

./run.sh
最后修改:2019 年 04 月 08 日 12 : 02 AM

发表评论

27 条评论

  1. jian

    后端看到在线ip异常,突然发现有不认识的异地ip连接了,然后过几分钟又消失了,是我装的有后门不。。。
    忘了哪里的教程装的了。。。

    1. bimoe
      @jian

      提示什么错误信息?

  2. biezhi

    File "/soft/shadowsocks/auto_block.py", line 45, in auto_block_thread

    data = webapi.getApi('nodes')

    File "/soft/shadowsocks/webapi_utils.py", line 39, in getApi

    raise Exception('network issue or server error!')

    Exception: network issue or server error!

    2019-03-31 06:04:03 INFO connectionpool.py:696 Starting new HTTPS connection (6): supervpn.tw
    2019-03-31 06:04:03 ERROR webapi_utils.py:38 Traceback (most recent call last):
    File "/soft/shadowsocks/webapi_utils.py", line 23, in getApi

    timeout=10)

    File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 395, in get

    return self.request('GET', url, **kwargs)

    File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 383, in request

    resp = self.send(prep, **send_kwargs)

    File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 486, in send

    r = adapter.send(request, **kwargs)

    File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 385, in send

    raise SSLError(e)

    SSLError: hostname 'supervpn.tw' doesn't match 'vi.biezhi.art'

    2019-03-31 06:04:03 ERROR web_transfer.py:672 Traceback (most recent call last):
    File "/soft/shadowsocks/web_transfer.py", line 660, in thread_db

    ping = webapi.getApi('func/ping')

    File "/soft/shadowsocks/webapi_utils.py", line 39, in getApi

    raise Exception('network issue or server error!')

    Exception: network issue or server error!

  3. Carl

    那个shadowsocks.zip下载不了

    1. bimoe
      @Carl

      脚本迁移到新博客,看顶部

      1. Carl
        @bimoe

        你这评论系统有点问题,刚刚一直点发表评论提示我内容不符合规定,刷新一下就这么多条, 哈哈

      2. Carl
        @bimoe

        完美运行,谢谢。

      3. Carl
        @bimoe

        完美运行,谢谢,我还想问下我想做多个节点话,是不是要其他节点的服务器也一样搭建sspanel前后端,,然后共用数据库。

      4. Carl
        @bimoe

        完美运行,谢谢, 我还想问下我想做多个节点话, 是不是要其他节点的服务器也一样搭建sspanel前后端, 然后共用数据库。

  4. w3e

    不行了,这个脚本是不是出问题了。

    1. bimoe
      @w3e

      脚本迁移到新博客,看顶部

  5. 123456

    同样的问题,都显示webapi的错误,和楼上的几位相同的问题

    1. bimoe
      @123456

      后端那个程序有点问题,过两天等我更新教程

  6. chaof

    请问搭建完在线ip功能,封禁ip这几个功能报错,提示数据库错误是什么情况。
    Datatables waring: table id=tabl_1 anvalid JSON

  7. 大鹏

    SSR报错:ImportError: No module named cymysql

  8. 22334

    你知道这是什么原因吗
    这个改怎么解决
    loaded collections.OrderedDict
    IPv6 support
    INFO: ShadowsocksR 3.4.0 mod by esdeathlove
    INFO: current process RLIMIT_NOFILE resource: soft 512000 hard 512000
    ERROR: Traceback (most recent call last):
    File "/root/shadowsocks/webapi_utils.py", line 23, in getApi
    timeout=10)
    File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
    File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
    File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
    File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 333, in connect
    cert = self.sock.getpeercert()
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 343, in getpeercert
    'subjectAltName': get_subj_alt_name(x509)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 219, in get_subj_alt_name
    for name in ext.get_values_for_type(x509.DNSName)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 175, in _dnsname_to_stdlib
    name = idna_encode(name)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 167, in idna_encode
    import idna
    ImportError: No module named idna

    ERROR: Traceback (most recent call last):
    File "/root/shadowsocks/web_transfer.py", line 660, in thread_db
    ping = webapi.getApi('func/ping')
    File "/root/shadowsocks/webapi_utils.py", line 39, in getApi
    raise Exception('network issue or server error!')
    Exception: network issue or server error!

    ERROR: Traceback (most recent call last):
    File "/root/shadowsocks/webapi_utils.py", line 23, in getApi
    timeout=10)
    File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
    File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
    File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
    File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 333, in connect
    cert = self.sock.getpeercert()
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 343, in getpeercert
    'subjectAltName': get_subj_alt_name(x509)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 219, in get_subj_alt_name
    for name in ext.get_values_for_type(x509.DNSName)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 175, in _dnsname_to_stdlib
    name = idna_encode(name)
    File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 167, in idna_encode
    import idna
    ImportError: No module named idna

    ERROR: Traceback (most recent call last):
    File "/root/shadowsocks/auto_block.py", line 289, in thread_db
    db_instance.auto_block_thread()
    File "/root/shadowsocks/auto_block.py", line 45, in auto_block_thread
    data = webapi.getApi('nodes')
    File "/root/shadowsocks/webapi_utils.py", line 39, in getApi
    raise Exception('network issue or server error!')
    Exception: network issue or server error!

  9. ddf1312

    请问这个问题该怎么解决?OωO

  10. ddf1312

    节点对接好后,用5分钟就不能上了,前端图标一直都是绿色的,但是就是用不了ss

    1. bimoe
      @ddf1312

      防火墙

  11. 兵工厂

    什么是宝塔

  12. tangspoon

    后端连接失败了。

    root@node1:~/shadowsocks# python server.py
    loaded collections.OrderedDict
    IPv6 support
    INFO: ShadowsocksR 3.4.0 mod by esdeathlove
    INFO: current process RLIMIT_NOFILE resource: soft 1024 hard 1048576
    ERROR: Traceback (most recent call last):
    File "/root/shadowsocks/webapi_utils.py", line 23, in getApi

    timeout=10)

    File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 501, in get

    return self.request('GET', url, **kwargs)

    File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 488, in request

    resp = self.send(prep, **send_kwargs)

    File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 609, in send

    r = adapter.send(request, **kwargs)

    File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 479, in send

    raise ConnectTimeout(e, request=request)

    ConnectTimeout: HTTPSConnectionPool(host='ss.tangspoon.cn', port=443): Max retries exceeded with url: /mod_mu/nodes?key=glzjin (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4375579e50>, 'Connection to ss.tangspoon.cn timed out. (connect timeout=10)'))

    1. bimoe
      @tangspoon

      userapiconfig.py 看一下

      1. duke
        @bimoe

        调试信息如下,不知怎么解决?
        [root@izj6cf1r2pkhons0nyknrjz shadowsocks]# python server.py
        loaded collections.OrderedDict
        IPv6 not support
        INFO: ShadowsocksR 3.0.0
        INFO: current process RLIMIT_NOFILE resource: soft 65535 hard 65535
        ERROR: Error data:{"ret":0,"data":"token or source is invalid"}
        ERROR: request nodes error!wrong ret!
        ERROR: Traceback (most recent call last):
        File "/root/shadowsocks/webapi_utils.py", line 33, in getApi

        raise Exception('wrong ret!')

        Exception: wrong ret!

        ERROR: Traceback (most recent call last):
        File "/root/shadowsocks/auto_block.py", line 289, in thread_db

        db_instance.auto_block_thread()

        File "/root/shadowsocks/auto_block.py", line 45, in auto_block_thread

        data = webapi.getApi('nodes')

        File "/root/shadowsocks/webapi_utils.py", line 39, in getApi

        raise Exception('network issue or server error!')

        Exception: network issue or server error!

        ERROR: Error data:{"ret":0,"data":"token or source is invalid"}
        ERROR: request func/ping error!wrong ret!
        ERROR: Traceback (most recent call last):
        File "/root/shadowsocks/webapi_utils.py", line 33, in getApi

        raise Exception('wrong ret!')

        Exception: wrong ret!

        ERROR: Traceback (most recent call last):
        File "/root/shadowsocks/web_transfer.py", line 660, in thread_db

        ping = webapi.getApi('func/ping')

        File "/root/shadowsocks/webapi_utils.py", line 39, in getApi

        raise Exception('network issue or server error!')

        Exception: network issue or server error!

        ^CTraceback (most recent call last):
        File "server.py", line 78, in main

        threadMain.join(10.0)

        File "/usr/lib64/python2.7/threading.py", line 962, in join

        self.__block.wait(delay, balancing)

        File "/usr/lib64/python2.7/threading.py", line 362, in wait

        _sleep(delay)

        KeyboardInterrupt
        INFO: loading config from user-config.json
        2018-12-26 22:13:59 INFO util.py:49 loading libcrypto from libcrypto.so.10
        2018-12-26 22:13:59 INFO asyncdns.py:324 dns server: [('100.100.2.136', 53), ('100.100.2.138', 53)]
        2018-12-26 22:13:59 INFO asyncdns.py:324 dns server: [('100.100.2.136', 53), ('100.100.2.138', 53)]

        1. bimoe
          @duke

          mukey 填对了吗

          1. duke
            @bimoe

            是哪个文件中的mukey?

            1. bimoe
              @duke

              部署后端教程那个 .config.php

              1. duke
                @bimoe

                那个值我没有改,所以userapiconfig.py文件中的mukey跟config.php是一样的呀