最近conoha改版了,支持中文界面、支付宝付款,感觉还不错就买了个玩玩,试用下来觉得速度和配置相当不错就想在上面部署一个vpn用用,这篇文章记录一下大致的摸索过程。通过注册后充值500日元以上可获1000日元优惠券。
我先是新建了一个centos7.1系统的服务器,按照 shadowsocks搭建教程: 【倾力原创】史上最详尽Shadowsocks从零开始一站式翻墙教程(需翻墙) 这篇教程来进行部署的,但是全部部署好后,客户端也能够连接上,却无法上网,后来在其他教程中发现了可能原因,就是centos默认的iptables中可能有一条0.0.0.0的记录会与shadowsocks的配置产生冲突。
懒得折腾centos于是我就新建了一个ubuntu的服务器。
apt-get install python-pip pip install shadowsocks |
通过以上命令安装成功后,
ssserver -p 443 -k password -m aes-256-cfb |
运行该命令进行测试,发现这回能正常科学上网了,接下来就是配置开机启动了。
mkdir /etc/shadowsocks vim /etc/shadowsocks/config.json |
在config.json中复制入以下配置:
{ "server":"0.0.0.0", "server_port":8388, "local_address": "127.0.0.1", "local_port":1080, "password":"yourpassword", "timeout":300, "method":"aes-256-cfb" } |
其中端口和密码可按需进行修改。运行一下命令进行测试:
ssserver -c /etc/shadowsocks/config.json |
接下来安装supervisor:
apt-get install -y supervisor |
编辑配置文件:
vim /etc/supervisor/conf.d/shadowsocks.conf |
输入以下内容:
[program:shadowsocks] command=ssserver -c /etc/shadowsocks/config.json autostart=true autorestart=true user=nobody |
如果上面填写的服务器端口号小于 1024,第五行改为 user=root 。
重启 supervisor 使对配置文件的修改生效
service supervisor restart supervisorctl status |
最后输出
shadowsocks RUNNING pid XXXXX, uptime X:XX:XX |
表示配置成功,可以正常使用了。