install vps

buy a VPS

recommend bandwagonhost

deploy VPS

click Services > My Services > KiwiVM Control Panel > Root shell - interactive
then write code in the presented terminal:

1
2
3
passwd
\\type your passwd
\\type your passwd again

renistall system

  1. stop the VPS

click KiwiVM Control Panel > Main controls > stop(at the right middle of the interface)

  1. install system

click KiwiVM Control Panel > Install new OS

install Shadowsocks Server

click KiwiVM Control Panel > Shadowsocks Server(at the left bottom)

如果vps本身没有提供一键安装功能,也可以自己简单的进行安装

1
2
3
4
5
6
7
8
9
10
11
# 1. 安装shadowsocks
## ubuntu
apt-get install python-pip
pip install setuptools shadowsocks
## centos
yum install python-setuptools && easy_install pip
pip install setuptools shadowsocks
# 2.编辑配置文件
vi /etc/shadowsocks.json
## 输入以下内容

{
“server”:”my_server_ip”,
“server_port”:25,
“local_address”: “127.0.0.1”,
“local_port”:1080,
“password”:”mypassword”,
“timeout”:300,
“method”:”aes-256-cfb”,
“fast_open”: false }

字段含义

server: 服务器ip地址
server_port: 绑定的端口,注意不要设置已经使用了的端口
possword: 密码
timeout: 超时时间
method: 加密方法
fast_open: 如果你的服务器 Linux 内核在3.7+,可以开启 fast_open 以降低延迟
workers: 默认为1

1
2
3
4
# 3. 后台启动shadowsocks,日志会被保存在 /var/log/shadowsocks.log
ssserver -c /etc/shadowsocks.json -d start
# 4. 关闭shadowsocks
ssserver -c /etc/shadowsocks.json -d stop

#accelerate SS

  1. connect remote machine
1
ssh -l root -p port_id ip

your port_id and ip can find in the interface of SS

  1. download Net-Speeder
1
wget https://coding.net/u/njzhenghao/p/download/git/raw/master/net_speeder-installer.sh
  1. compile and install
1
bash net_speeder-installer.sh
  1. accelerate port
1
nohup /usr/local/net_speeder/net_speeder venet0 "ip" >/dev/null 2>&1 &

if a port number is typed on the terminal,you are success.

debug and fix

if your SS speed is very low,maybe your SS is bad.And you can fix by using the codes below:

1
2
3
4
5
6
ssh -l root -p port_id ip
\\reboot VPS
reboot
\\connect VPS again
ssh -l root -p port_id ip
nohup /usr/local/net_speeder/net_speeder venet0 "ip" >/dev/null 2>&1 &

references

reference

科学上网:用 VPS 搭建 shadowsocks 服务器