1. 下载、安装

  • 下载最新release:Download

  • 安装shadowsocks-libev:

    1
    2
    3
    4
    mkdir -p ~/build-area/
    cp ./scripts/build_deb.sh ~/build-area/
    cd ~/build-area
    ./build_deb.sh
  • 安装最新v2ray-plugin(链接最后添加#artifacts下载对应系统文件):Download

2. 配置服务器设置

config_sample.json,文件命名以config_0.json, config_1.json…

1
2
3
4
5
6
7
8
9
10
11
{
"server":"0.0.0.0",
"mode":"tcp_and_udp",
"server_port":server_port,
"local_port":1080,
"password":"password_here",
"timeout":60,
"method":"method_here",
"plugin":"v2ray-plugin_location",
"plugin_opts":"server;tls;host=domain_here;cert=fullchain_file;key=key_file"
}

3. 配置服务

创建批量启动脚本

/usr/local/bin建立脚本shadowsocks-libev-autostart并添加执行权限,args为全局通用参数。

1
2
3
4
5
6
7
8
9
10
#!/bin/sh

proc=/usr/bin/ss-server
config_dir=/etc/shadowsocks-libev
args="-n 32678 -u --fast-open -v"

$proc -c $config_dir/config_0.json -f /var/run/shadowsocks-libev_0.pid $args #port 0
$proc -c $config_dir/config_1.json -f /var/run/shadowsocks-libev_1.pid $args #port 1

exit 0

创建Systemd服务

/etc/systemd/system下建立shadowsocks-libev.service,内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=Shadowsocks-libev Multi-user Server Service
Documentation=man:shadowsocks-libev(8)
After=network.target

[Service]
Type=forking
User=root
LimitNOFILE=32768
ExecStart=/usr/local/bin/shadowsocks-libev-autostart

[Install]
WantedBy=multi-user.target

启用服务systemctl enable shadowsocks-libev

启动服务systemctl start shadowsocks-libev

部分参考Shadowsocks-libev多端口配置