357全球通 357全球通

用宝塔安装ss-panel-v3魔改版|后端

in 学姿势 read (1213) 文章转载请注明来源!

后端部署CentOS

Centos可以完全按照这个来

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
cd /root
yum -y install python-setuptools
easy_install pip
git clone -b manyuser https://github.com/glzjin/shadowsocks.git
cd shadowsocks
pip install -r requirements.txt
cp apiconfig.py userapiconfig.py
cp config.json user-config.json

一个个复制即可。

关闭CentOS7的防火墙:

systemctl stop firewalld.service

编辑后端配置文件,填写你的节点对应ID和数据库信息:

vi userapiconfig.py

注:宝塔路径在/root/shadowsocks,可以直接找到userapiconfig.py并编辑

# Config
NODE_ID = 3  //这个ID就是后台看到的
SERVER_PUB_ADDR = '127.0.0.1'  # mujson_mgr need this to generate ssr link
API_INTERFACE = 'glzjinmod'  # glzjinmod, modwebapi   //改为glzjinmod

WEBAPI_URL = 'https://xxr.tooyoungtoosimple.club'  //改成你自己的
WEBAPI_TOKEN = 'mupass'   //**要与前端保持一致!!!**
# Mysql
MYSQL_HOST = '127.0.0.1'
MYSQL_PORT = 3306
MYSQL_USER = 'sspanel'   //这几个都要于前端一致
MYSQL_PASS = 'sspanel'   //这几个都要于前端一致
MYSQL_DB = 'sspanel'   //这几个都要于前端一致

确定都填写正确后,用调试模式先启动后端:

python server.py

正确的话,会返回用户的连接信息,否则自己根据报错修改

root@www:~/shadowsocks# python server.py
loaded collections.OrderedDict
IPv6 support
INFO: Read hosts.deny from line 17
INFO: ShadowsocksR 3.4.0 mod by esdeathlove
INFO: current process RLIMIT_NOFILE resource: soft 1024 hard 1048576
INFO: loading config from user-config.json
2018-09-02 23:25:01 INFO     util.py:49 loading libcrypto from libcrypto.so.1.1
2018-09-02 23:25:01 INFO     asyncdns.py:324 dns server: [('8.8.8.8', 53), ('8.8.4.4', 53)]
2018-09-02 23:25:01 INFO     asyncdns.py:324 dns server: [('8.8.8.8', 53), ('8.8.4.4', 53)]
2018-09-02 23:25:02 INFO     db_transfer.py:820 db start server at port [1025] pass [N1ssWe] protocol [origin] method [rc4-md5] obfs [plain]
2018-09-02 23:25:02 INFO     server_pool.py:146 starting server at [::]:1025
2018-09-02 23:25:02 INFO     server_pool.py:176 starting server at 0.0.0.0:1025
####这里显然是配置正确了

确定没问题后,Ctrl+C退出来,输入如下命令将程序放到后台运行

./run.sh

此时我们回到面板的节点列表这里,可以看到节点是在线状态

其他配置,看荒岛博客原文


后端部署-其他系统

1、依赖安装

CentOS:

yum install epel-release -y
yum install python-pip git wget -y

Feroda:

dnf install git wgetpython-pip -y

Debian:

apt install git wget python-setuptools -y
easy_install pip

2、libsodium 安装

Fedora: dnf install libsodium -y

↑其实 Fedora 这样就够了(不过版本得跟随源,大多数情况比楼下旧

CentOS/Fedora: yum -y groupinstall "Development Tools"

Debian: apt install build-essential -y

接着编译安装

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
cd ../ && rm -rf libsodium*

3、下载源代码并安装依赖

git clone -b manyuser https://github.com/esdeathlove/shadowsocks.git
cd shadowsocks
pip install -r requirements.txt

4、配置文件

cp apiconfig.py userapiconfig.py
cp config.json user-config.json
vi userapiconfig.py

配置文件说明如下:

# Config
#节点ID

NODE_ID = 1

#自动化测速,为0不测试,此处以小时为单位,要和 ss-panel 设置的小时数一致

SPEEDTEST = 6


#云安全,自动上报与下载封禁IP,1为开启,0为关闭

CLOUDSAFE = 1 

#自动封禁SS密码和加密方式错误的 IP,1为开启,0为关闭

ANTISSATTACK = 0

#是否接受上级下发的命令,如果你要用这个命令,请参考我(此处指 glzjin )之前写的东西,公钥放在目录下的 ssshell.asc

AUTOEXEC = 1

#单端口多用户设置,看重大更新说明

MU_SUFFIX = 'zhaoj.in'
MU_REGEX = '%5m%id.%suffix'

#不明觉厉

SERVER_PUB_ADDR = '127.0.0.1' # mujson_mgr need this to generate ssr link

#访问面板方式

API_INTERFACE = 'modwebapi' #glzjinmod (数据库方式连接),modwebapi (http api)

#mudb,不要管
MUDB_FILE = 'mudb.json'

# HTTP API 的相关信息,看重大更新说明。

# 面板地址,区分https和http
WEBAPI_URL = 'https://zhaoj.in'

# 此处为.config.php中的muKey
WEBAPI_TOKEN = 'glzjin'

# Mysql 数据库连接信息

MYSQL_HOST = '127.0.0.1'

MYSQL_PORT = 3306

MYSQL_USER = 'ss'

MYSQL_PASS = 'ss'

MYSQL_DB = 'shadowsocks'

# 是否启用SSL连接,0为关,1为开

MYSQL_SSL_ENABLE = 0

# 客户端证书目录
MYSQL_SSL_CERT = '/root/shadowsocks/client-cert.pem'

MYSQL_SSL_KEY = '/root/shadowsocks/client-key.pem'

MYSQL_SSL_CA = '/root/shadowsocks/ca.pem'

# API,不用管

API_HOST = '127.0.0.1'

API_PORT = 80

API_PATH = '/mu/v2/'

API_TOKEN = 'abcdef'

API_UPDATE_TIME = 60

# Manager 不用管

MANAGE_PASS = 'ss233333333'

#if you want manage in other server you should set this value to global ip

MANAGE_BIND_IP = '127.0.0.1'

#make sure this port is idle

MANAGE_PORT = 23333

参考自安装魔改后端

jrotty WeChat Pay

微信打赏

jrotty Alipay

支付宝打赏

文章二维码

扫描二维码,在手机上阅读!

本文基于《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
文章链接:http://www.357global.com/archives/ss-panel-v3-mod-backend.html (转载时请注明本文出处及文章链接)

学姿势
发表新评论
已有 2 条评论
  1. JohnYin
    JohnYin 10Chrome 67
    回复

    ?

  2. hhh
    hhh LQQ浏览器 7
    回复

    2333

PREVIOUS NEXT
雷姆
拉姆