1. git version control tool
apt-get update
apt install git
2. Clone the source repository from Github.
git clone https://github.com/shadowsocks/shadowsocks-libev.git
cd shadowsocks-libev
3. Install build dependencies.
apt install build-essential autoconf libtool libssl-dev asciidoc
apt-get install libpcre3 libpcre3-dev
4. Configure build environment and compile it.
./configure && make
5. Install shadowsocks-libev
make install
---------------------------------------------
nano /etc/shadowsocks/config.json
......
{
"server":"your_server_ip",
"server_port":9999,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"your_passwd",
"timeout":600,
"method":"aes-256-cfb"
}
---------------------------------------------
Run:
nohup ss-server -c /etc/shadowsocks/config2.json &
Then:
nano /etc/rc.local
Add the ss-server command above exit 0
@reference_1_linuxbabe
@reference_2_cyberciti
-------------------------------------------------
no plan to support multi port configuration. Actually you can use multiple instances instead. For example:
ss-server -c config1.json -f pid1
ss-server -c config2.json -f pid2
ss-server -c config3.json -f pid3
As the best practice we recommend for shadowsocks-libev, it helps to isolate each user in different processes and reconfigure each user's port/password/encyption/timeout without reload/restart the whole service. Furthermore, this approach enables us to manage users with legacy control panels, for example old SSH / VHOST panels with each user's ss-server running in its own space.
Compared to other implementations, shadowsocks-libev uses much fewer resources (about 1MB memory and hundreds of file descriptors in a typical usage) . As a result, this kind of multi processes should only introduce slight overhead and even works well for low end boxes. @reference_3_github
-------------------------------------------
不用多实例,用iptables的端口转发功能,随意设定在多少端口上监听 。
iptables -t nat -A PREROUTING -d <监听地址>/32 -p tcp -m tcp --dport
<起始端口>:<结束端口> -j REDIRECT --to-ports <SS 端口>
@reference_4_plus.google
@reference_5_teddysun
No comments:
Post a Comment