Skip to content

Instantly share code, notes, and snippets.

@zernel
Forked from chuyik/install.sh
Last active March 6, 2018 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zernel/df7ed7dfeb9f938d5f9bc2b428805989 to your computer and use it in GitHub Desktop.
Save zernel/df7ed7dfeb9f938d5f9bc2b428805989 to your computer and use it in GitHub Desktop.
Bandwagon(搬瓦工) CentOS 7 安装 shadowsocks-libev 和 kcptun
######################
## shadowsocks-libev
######################
# install dependencies
yum install epel-release -y
yum install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto udns-devel libev-devel -y
# install shadowsocks-libev
cd /etc/yum.repos.d/
curl -O https://copr.fedorainfracloud.org/coprs/librehat/shadowsocks/repo/epel-7/librehat-shadowsocks-epel-7.repo
yum update
yum install shadowsocks-libev
# edit config.json
vi /etc/shadowsocks-libev/config.json
{
"server":"0.0.0.0",
"server_port":8888,
"local_port":1080,
"password":"xxxxxxxxxxx",
"timeout":60,
"method":"aes-256-cfb"
}
# run application on startup
systemctl enable shadowsocks-libev
systemctl start shadowsocks-libev
systemctl status shadowsocks-libev
chkconfig shadowsocks-libev on
# configure firewall (if needed)
firewall-cmd --zone=public --add-port=8888/tcp --permanent
firewall-cmd --zone=public --add-port=8888/udp --permanent
firewall-cmd --reload
# watch log
journalctl | grep ss-server
######################
## kcptun
######################
# install server
wget --no-check-certificate https://raw.githubusercontent.com/kuoruan/kcptun_installer/master/kcptun.sh
chmod +x ./kcptun.sh
./kcptun.sh
# configure firewall (if needed)
firewall-cmd --zone=public --add-port=29900/udp --permanent
firewall-cmd --reload
# install client
open https://github.com/xtaci/kcptun/releases
# create run_client.sh and run_client.plist
# run on startup
launchctl load run_client.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>kcptun.client</string>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>/path/to/run_client.sh</string>
</array>
<key>StandardOutPath</key>
<string>/path/to/run-out.log</string>
<key>StandardErrorPath</key>
<string>/path/to/run-out.log</string>
</dict>
</plist>
/path/to/client_darwin_amd64 --remoteaddr 10.10.10.10:29900 --autoexpire 60 --key "kcptun_password" --crypt "salsa20" --mode "fast2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment