From 37b67dd45eda1d3d1924e6d1dc670c5b50a2aa76 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Sun, 15 Jun 2014 11:05:01 -0700 Subject: [PATCH] =?UTF-8?q?Created=20=E7=94=A8=20Supervisor=20=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=20Shadowsocks=20(markdown)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 用-Supervisor-运行-Shadowsocks.md | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 用-Supervisor-运行-Shadowsocks.md diff --git a/用-Supervisor-运行-Shadowsocks.md b/用-Supervisor-运行-Shadowsocks.md new file mode 100644 index 0000000..d04c08d --- /dev/null +++ b/用-Supervisor-运行-Shadowsocks.md @@ -0,0 +1,51 @@ +如果你想在后台运行 Shadowsocks,可以使用 supervisor。 + +以 Debian 7.0 为例: + +执行 +``` +apt-get update +apt-get install python-pip python-m2crypto supervisor +pip install shadowsocks +``` + +编辑 `/etc/shadowsocks.json` + +``` +{ + "server":"my ip", + "server_port":8388, + "local_port":1080, + "password":"my password", + "timeout":600, + "method":"aes-256-cfb" +} +``` + +编辑 `/etc/supervisor/conf.d/shadowsocks.conf` + +``` +[program:shadowsocks] +command=ssserver -c /etc/shadowsocks.json +autorestart=true +user=nobody +``` + +在 `/etc/default/supervisor` 最后加一行: + +``` +ulimit -n 51200 +``` + +执行 +``` +service supervisor start +supervisorctl reload +``` +就好了。 + +你可以检查日志或者控制 Shadowsocks 的运行: +``` +supervisorctl tail -f shadowsocks stderr +supervisorctl restart shadowsocks +``` \ No newline at end of file