0%

搬瓦工shadowsocks安装配置

一键安装:

虽然最新搬瓦工控制面板里去掉了一键安装选项,但是可以通过以下链接一键安装:
shadowsocks
shadowsocksr

手动安装

1.登录服务器

ssh -p 21 root@104.224.132.44

2.安装shadowsocks

1
2
3
4
5
6
7
8
9
10
11
12
yum update
yum install gcc
yum install wget

wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar -jxvf Python-2.7.3.tar.bz2
cd Python-2.7.3
./configure
make all
make install
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python

yum不支持Python 2.7,所以,按下面的操作,指定yum的python版本:

1
vi /usr/bin/yum

将文件头部的
1
#!/usr/bin/python

改成
1
2
3
4
#!/usr/bin/python2.6.6

wget https://pypi.python.org/packages/source/p/pip/pip-6.0.8.tar.gz#md5=2332e6f97e75ded3bddde0ced01dbda3 --no-check-certificate
easy_install pip-6.0.8.tar.gz

3.配置shadowsocks

1
2
3
4
5
6
7
8
9
10
11
vi /etc/shadowsocks.json

{
"server":"104.224.132.44",
"server_port":110,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"password",
"timeout":600,
"method":"rc4-md5"
}

配置开机自动启动

打开rc.local文件

1
vi /etc/rc.local

输入下面的代码
1
2
3
4
5
6
7
8
9
10
11
ssserver -c /etc/shadowsocks.json -d start
shadowsocks服务相关命令
启动shadowsocks服务

ssserver -c /etc/shadowsocks.json -d start
关闭shadowsocks服务

ssserver -c /etc/shadowsocks.json -d stop
重启shadowsocks服务

ssserver -c /etc/shadowsocks.json -d restart

赞赏是最好的支持