Some Memo On Off-wall


Useful memo on setting up special proxy tool.

apt update
apt upgrade -y
# install essential packages PYTHON
# apt install build-essential python-pip python-setuptools python-m2crypto -y
# pip install --upgrade pip
# pip install git+https://github.com/shadowsocks/shadowsocks.git@master

# libev
# ubuntu 16.04 & 14.04
# sudo apt-get install software-properties-common -y
# sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y
sudo apt-get update
sudo apt install shadowsocks-libev

mkdir temp
cd temp

#in temp
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar -xf LATEST.tar.gz
cd libsodium-stable

#in temp/libsodium
#install libsodium
./configure
make && make check
make install
ldconfig

cd ../..
rm -r temp
#for ubuntu 14.04
#wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15.14/linux-image-4.15.14-041514-generic_4.15.14-041514.201803281351_amd64.deb
#dpkg -i linux-image-*.deb
#update-grub
#upgrade to new kernel
#for ubuntu 16.04 or higher
apt install --install-recommends linux-generic-hwe-16.04 -y
apt autoremove

#enable bbr
modprobe tcp_bbr
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
# turn on TCP Fast Open on both client and server side
echo "net.ipv4.tcp_fastopen = 3" >> /etc/sysctl.conf
sysctl -p

#some enhancements for PYTHON
# pip install M2Crypto
echo "Done!"

For libev version:

# config file in /etc/shadowsocks-livev/config.json
# start the server
systemctl start shadowsocks-libev-server@config

# config file
# {
#     "server":["[::0]","0.0.0.0"], //for both v4 & v6
#     "server_port":your port,
#     "local_address":"127.0.0.1",
#     "local_port":1080,
#     "password":"your password",
#     "timeout":600,
#     "fast_open":true,
#     "mode":"tcp_and_udp",
#     "method":"encryption"
# }


cat /lib/systemd/system/[email protected]

[Unit]
Description=Shadowsocks-Libev Custom Server Service for %I
#Documentation=man:shadowsocks-libev.ss-server(1)
After=network.target

[Service]
Type=simple
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
ExecStart=/snap/bin/shadowsocks-libev.ss-server -c /root/snap/shadowsocks-libev/%i.json
PrivateTmp=true

[Install]
WantedBy=multi-user.target

For python version:

# config file in /etc/config.json
# start the server
ssserver -d start -c /etc/config.json

# config file
# {
#     "server":"::", //for both v4 & v6
#     "local_address":"127.0.0.1",
#     "local_port":1080,
#     "port_password": {
#         "port1":"password1",
#         "port2": "password2"
#     },
#     "timeout":600,
#     "method":"encryption",
#     "fast_open": true,
#     "workers": 4
# }

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注