部署Shadowsocks服务器

本文参考shadowsocks-libev install at Debian or CentOSarrow-up-right,但是在CentOS 7上略有不同,所以此处先记录,再单独整理一份CentOS7部署。

编译程序

  • 编译环境准备&安装依赖包

yum install -y gcc make libtool build-essential git

yum install -y curl curl-devel zlib-devel openssl-devel gnutls-devel mbedtls-devel libsodium-devel c-ares-devel libev-devel \
perl perl-devel pcre pcre-devel cpio expat-devel gettext-devel asciidoc xmlto
  • 克隆源码

git clone --recursive https://github.com/shadowsocks/shadowsocks-libev.git
  • 开始编译

cd shadowsocks-libev
./autogen.sh
./configure --prefix=/usr && make
make install
  • 如果遇到报错:

    • configure: error: mbed TLS libraries not found.,参考服务器安装影梭时error: mbed TLS libraries not foundarrow-up-right,安装mbedtls-devel

    • configure: error: The Sodium crypto library libraries not found.,则安装libsodium-devel

    • configure: error: The c-ares library libraries not found.,则安装c-ares-devel

    • configure: error: Couldn't find libev. Try installing libev-dev[el].,则安装libev-devel

配置

  • 准备必须的文件

这里方法采用了rc.d执行脚本,适合早期CentOS6系列操作系统。CentOS 7系统参考在CentOS 7上部署ShadowSocks服务器arrow-up-right

  • 创建文件命令

内容参考如下:

单端口:

注意:

  • "server_port":8888是对外提供服务的端口(可自行修改),要保证没有防火墙阻碍

  • "local_port":1080,是ss客户端在本地提供的sockes代理端口

多端口:

  • 添加开机自启动服务

如果采用init脚本,则可以使用:

  • 启动服务

注意:客户端Shadow Socket连接以后,需要设置客户端proxy指向自己本机的1080端口。如果客户端软件自动设置则ok,否则要想办法手工设置。

Ubuntu Touch设置网络Proxy方法arrow-up-right

参考

Last updated

Was this helpful?