1. 下载、安装
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 $proc -c $config_dir/config_1.json -f /var/run/shadowsocks-libev_1.pid $args
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多端口配置。