ss-libev编译与安装

2018年5月15日 Linux 0条评论 阅读次数 2,068

ss-libev

安装环境: CentOS 7 Minimal x86_64

编译前准备工作:

# ubuntu
apt update
apt upgrade -y
# CentOS
yum update -y
# ubuntu
apt install -y --no-install-recommends gettext build-essential autoconf \
                                       libtool libpcre3-dev asciidoc xmlto\
                                       libev-dev libc-ares-dev automake git
# Centos
yum install -y gettext gcc autoconf libtool automake make asciidoc xmlto \
               c-ares-devel libev-devel pcre-devel git

libsodium

#其他linux
cd ~
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar xvf LATEST.tar.gz
cd libsodium-stable
./configure --prefix=/usr && make
make install
ldconfig

#centos
yum install -y libsodium libsodium-devel
#ubuntu
apt install -y libsodium-dev

MbedTLS

#其他linux
cd ~
wget https://tls.mbed.org/download/mbedtls-2.9.0-gpl.tgz
tar xvf mbedtls-2.9.0-gpl.tgz
cd mbedtls-2.9.0
make SHARED=1 CFLAGS=-fPIC
make DESTDIR=/usr install
ldconfig

#centos
yum install -y mbedtls mbedtls-devel
#ubuntu
apt install -y libmbedtls-dev

shadowsocks-libev

cd ~
git clone https://github.com/shadowsocks/shadowsocks-libev.git
cd shadowsocks-libev
git submodule update --init --recursive
./autogen.sh && ./configure && make
sudo make install
#help
-s <server_host>           Host name or IP address of your remote server.
-p <server_port>           Port number of your remote server.
-l <local_port>            Port number of your local server.
-k <password>              Password of your remote server.
-m <encrypt_method>        Encrypt method: rc4-md5,
                           aes-128-gcm, aes-192-gcm, aes-256-gcm,
                           aes-128-cfb, aes-192-cfb, aes-256-cfb,
                           aes-128-ctr, aes-192-ctr, aes-256-ctr,
                           camellia-128-cfb, camellia-192-cfb,
                           camellia-256-cfb, bf-cfb,
                           chacha20-ietf-poly1305,
                           salsa20, chacha20 and chacha20-ietf.
                           The default cipher is rc4-md5.

[-a <user>]                Run as another user.
[-f <pid_file>]            The file path to store pid.
[-t <timeout>]             Socket timeout in seconds.
[-c <config_file>]         The path to config file.
[-n <number>]              Max number of open files.
[-i <interface>]           Network interface to bind.
[-b <local_address>]       Local address to bind.

[-u]                       Enable UDP relay.
[-U]                       Enable UDP relay and disable TCP relay.
[-6]                       Resovle hostname to IPv6 address first.

[-d <addr>]                Name servers for internal DNS resolver.
[--reuse-port]             Enable port reuse.
[--fast-open]              Enable TCP fast open.
                           with Linux kernel > 3.7.0.
[--acl <acl_file>]         Path to ACL (Access Control List).
[--manager-address <addr>] UNIX domain socket address.
[--mtu <MTU>]              MTU of your network interface.
[--mptcp]                  Enable Multipath TCP on MPTCP Kernel.
[--no-delay]               Enable TCP_NODELAY.
[--key <key_in_base64>]    Key of your remote server.
[--plugin <name>]          Enable SIP003 plugin. (Experimental)
[--plugin-opts <options>]  Set SIP003 plugin options. (Experimental)

[-v]                       Verbose mode.
[-h, --help]               Print this message.

KCP

./server_linux_amd64 -l :21 -t 127.0.0.1:12345 --crypt none  --mode normal --dscp 46 &

centOS 7 升级 gcc

sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
#for bash
scl enable devtoolset-7 bash
#for ~/.bashrc
source scl_source enable devtoolset-4
which gcc
gcc --version