七月 30, 2014

Ubuntu/debian VPS搭建shadowsocks - Python version

其实作者已经写得很清楚了。我只是备份一下@_@
Shadowsocks 使用说明
用 Supervisor 运行 Shadowsocks
作者推荐使用supervisor后台运行ss。

首先更新下系统
apt-get update
apt-get upgrade
因为是Ubuntu或者debian,所以用apt-get是很方便的。安装pip和m2crypto,pip安装shadowsocks
apt-get install python-pip python-m2crypto supervisor
pip install shadowsocks
建立配置文件 /etc/shadowsocks.json
{
    "server":"服务器 IP 地址",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"mypassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false,
    "workers": 1
}
点我是各个字段的意思
建立/etc/supervisor/conf.d/shadowsocks.conf
[program:shadowsocks]
command=ssserver -c /etc/shadowsocks.json
autorestart=true
user=nobody
如果端口 < 1024,把上面的 user=nobody 改成 user=root。

在 /etc/default/supervisor 最后加一行(优化参数,不一定起作用,不起作用的自行google别的办法):
ulimit -n 51200
重启就好了~

没有评论:

发表评论