ububntu 搭建sss服务无法开机自启动

作者:matrix 被围观: 6,227 次 发布时间:2016-12-29 分类:零零星星 | 无评论 »

这是一个创建于 2674 天前的主题,其中的信息可能已经有所发展或是发生改变。

搭建方法:http://www.jianshu.com/p/b5c4fbadbfae

apt-get update
apt-get install python-pip
pip install shadowsocks

添加:/etc/shadowsocks.json

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

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

我用ubuntu按照上面链接的方法来搭建的服务,安装运行到是ok,但是reboot重启Ubuntu的时候就发现出现问题。

编辑/etc/rc.local

添加开机自启动的命令失败:

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

Ubuntu下/etc/rc.local  文件修改之后没有成功。
实际上系统是执行了/etc/rc.local里面的命令,只是没有设置好ssserver命令的环境变量,系统当然无法执行。
我们需要做的就是给运行/etc/rc.local 的脚本里面添加环境变量就可以。

修改/etc/init.d/rc.local文件

vi /etc/init.d/rc.local
然后按i键执行vi编辑器的插入口令
将原本的PATH=/sbin:/usr/sbin:/bin:/usr/bin 修改为 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
按esc键输入:wq!保存退出
重启Ubuntu
reboot
然后系统就会成功执行 ssserver -c /etc/shadowsocks.json -d start 命令启动服务
重启:ssserver -c /etc/shadowsocks.json -d restart

加速

vps是kvm虚拟技术,可提升扶墙效率

https://github.com/ToyoDAdoubi/doubi

  • 安装锐速hack版
    https://github.com/91yun/serverspeeder

  • 安装Google BBR

$ bash -c "$(curl -sSL https://github.com/teddysun/across/raw/master/bbr.sh)" #安装bbr
$ bash -c "$(curl -sSL https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh)" #bbr plus

$ lsmod | grep bbr #检测
  • 腾讯TCPA(仅限centOS)
 bash <(curl -L -s http://down.08mb.com/tcp_opz/tcpa/tcpa.sh) #安装

参考:
http://www.jianshu.com/p/f88424fd4ab3

http://blog.csdn.net/zhe_d/article/details/50312967
http://www.jianshu.com/p/b5c4fbadbfae
http://www.jianshu.com/p/94445ee49df0

小众化工具 brook
https://github.com/txthinking/brook

其他文章:
本文固定链接:https://www.hhtjim.com/ububntu-build-ss-service-failed-to-open.html
matrix
本文章由 matrix 于2016年12月29日发布在零零星星分类下,目前没有通告,你可以至底部留下评论。
转载请注明:ububntu 搭建sss服务无法开机自启动-HHTjim'S 部落格
关键字:, , ,

添加新评论 »

 🙈 😱 😂 😛 😭 😳 😀 😆 👿 😉 😯 😮 😕 😎 😐 😥 😡 😈 💡

插入图片

NOTICE: You should type some Chinese word (like “你好”) in your comment to pass the spam-check, thanks for your patience!