Skip to content

Instantly share code, notes, and snippets.

@yuhaiyang
Forked from aa65535/ss-install.md
Last active November 2, 2017 09:57
Show Gist options
  • Select an option

  • Save yuhaiyang/5bae4e65b5f7dcd5e3106a5f55876ef9 to your computer and use it in GitHub Desktop.

Select an option

Save yuhaiyang/5bae4e65b5f7dcd5e3106a5f55876ef9 to your computer and use it in GitHub Desktop.
shadowsocks-libev install at Debian or CentOS

CentOS

cd /tmp
# 编译环境准备&安装依赖包
yum install -y epel-release
yum install -y gcc automake autoconf libtool make build-essential autoconf libtool
yum install -y curl curl-devel unzip zlib-devel openssl-devel perl perl-devel cpio expat-devel gettext-devel asciidoc xmlto
# 下载源码
git clone https://github.com/shadowsocks/shadowsocks-libev.git
cd shadowsocks-libev
git submodule update --init --recursive

# Installation of Libsodium
export LIBSODIUM_VER=1.0.13
wget https://download.libsodium.org/libsodium/releases/libsodium-$LIBSODIUM_VER.tar.gz
tar xvf libsodium-$LIBSODIUM_VER.tar.gz
pushd libsodium-$LIBSODIUM_VER
./configure --prefix=/usr && make
sudo make install
popd
sudo ldconfig

# Installation of MbedTLS
export MBEDTLS_VER=2.6.0
wget https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz
tar xvf mbedtls-$MBEDTLS_VER-gpl.tgz
pushd mbedtls-$MBEDTLS_VER
make SHARED=1 CFLAGS=-fPIC
sudo make DESTDIR=/usr install
popd
sudo ldconfig
# 开始编译
./autogen.sh
./configure --prefix=/usr --with-sodium-include=/usr/include --with-sodium-lib=/usr/lib --with-mbedtls-include=/usr/include --with-mbedtls-lib=/usr/lib
make
make install
# 准备必须的文件
mkdir -p /etc/shadowsocks-libev
cp ./rpm/SOURCES/etc/init.d/shadowsocks-libev /etc/init.d/shadowsocks
cp ./debian/config.json /etc/shadowsocks-libev/config.json
chmod +x /etc/init.d/shadowsocks
# 编辑配置文件
vim /etc/shadowsocks-libev/config.json
# 启动服务
chkconfig shadowsocks on
service shadowsocks start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment