2016/10/04

在CentOS 7 x64上部署ShadowsocksR -- Deploy shadowsocksR on CentOS 7 x64

Deploy steps:
1. shadowsocksR on https://github.com/breakwa11/shadowsocks-rss
2. yum install git
3. git clone -b manyuser https://github.com/breakwa11/shadowsocks.git
4. the command will build a folder ./shadowsocks, ./shadowsocks is a mulit-user version for database, ./shadowsocks/shadowsocks is a single user version, we use it.
5. cd shadowsocks/shadowsocks
6. cp config.json to current folder to config it
7. my config.json is
  {
      "server": "0.0.0.0",
      "local_address": "127.0.0.1",
      "local_port":1080,
      "port_password":{
          "80":"password"
      },
      "timeout":300,
      "method": "aes-256-cfb",
      "protocol": "auth_sha1_v2",
      "protocol_param": "",
      "obfs": "http_simple",
      "obfs_param": "bing.com",
      "redirect": "bing.com",
      "dns_ipv6": false,
      "fast_open": true,
      "workers": 1
  }
8. add 80 port to firewall (make sure firewalld is running):
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --complete-reload
9. test for shadowsocks, in folder ./shadowsocks/shadowsocks:
  python server.py -c config.json -d start
  netstat -tunpl (check the port 80 is listened by the python)
10. if all done, build a system service to start the shadowsocksR with reboot:
vi /etc/systemd/system/shadowsocksr.service
    [Unit]
    Description=ShadowsocksR service
    After=network.target
 
    [Service]
    Type=simple
    User=root
    ExecStart=/bin/python /root/shadowsocks/shadowsocks/server.py -c /root/shadowsocks/shadowsocks/config.json start
    ExecReload=/bin/kill -HUP $MAINPID
    ExecStop=/bin/kill -s QUIT $MAINPID
    PrivateTmp=true
    KillMode=process
    Restart=on-failure
    RestartSec=5s
 
    [Install]
    WantedBy=multi-user.target
  systemctl start shadowsocks-server.service
  systemctl enable shadowsocks-server.service



Refrence site:
1. shadowsocksR project: https://github.com/breakwa11/shadowsocks-rss
2. shadowsocksR author blog for why use the obfs port for 80: https://breakwa11.blogspot.com/2016/07/linode.html
3. a brief for install shadowsocks, include build a system service: https://www.ifshow.com/centos-7-installation-and-configuration-shadowsocks/
4. CentOS firewalld detail information: https://blog.linuxeye.com/406.html

Tips:
1. use traceroute for find which server fit for my network envirement
2. the important 7 issues for installing CentOS: https://www.douban.com/note/517000039/

没有评论: