安装 git 等
yum install python-setuptools && easy_install pip
yum install git
安装 libsodium
yum -y groupinstall "Development Tools"
wget https://github.com/883901/123/blob/master/libsodium-1.0.10.tar.gz
(如果不行用这个:wget https://github.com/jedisct1/libsodium/releases/download/1.0.10/libsodium-1.0.10.tar.gz)
tar xf libsodium-1.0.10.tar.gz && cd libsodium-1.0.10
./configure && make -j2 && make install
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig
(如果提示cannot import name OrderedDict,可能需要给服务器打补丁:第三方插件ordereddict
easy_install ordereddict)
下载程序源代码
git clone -b manyuser https://github.com/esdeathlove/shadowsocks.git
进入 Shadowsocks 这个目录,安装依赖
cd shadowsocks
yum -y install python-devel
yum -y install libffi-devel
yum -y install openssl-devel
pip install -r requirements.txt
配置程序
先得到你的配置文件
cd shadowsocks
cp apiconfig.py userapiconfig.py
cp config.json user-config.json
然后宝塔面板编辑 /root/shadowsocks/userapiconfig.py 文件
#节点ID ( 这里填前端搭建的节点ID)
# Config
#节点ID
NODE_ID = 1
#自动化测速,为0不测试,此处以小时为单位,要和 ss-panel 设置的小时数一致
SPEEDTEST = 6
#云安全,自动上报与下载封禁IP,1为开启,0为关闭
CLOUDSAFE = 1
#自动封禁SS密码和加密方式错误的 IP,1为开启,0为关闭
ANTISSATTACK = 0
#是否接受上级下发的命令,如果你要用这个命令,请参考我之前写的东西,公钥放在目录下的 ssshell.asc
AUTOEXEC = 1
多端口单用户设置,看重大更新说明。和前端.config设置一致
MU_SUFFIX = 'baidu.com'
多端口单用户设置,看重大更新说明。和前端.config设置一致
MU_REGEX = '%5m%id.%suffix'
#不明觉厉
SERVER_PUB_ADDR = '127.0.0.1' # mujson_mgr need this to generate ssr link
#访问面板方式
`API_INTERFACE = 'modwebapi' #glzjinmod (数据库方式连接),modwebapi (http api)
#mudb,不要管
MUDB_FILE = 'mudb.json'
# HTTP API 的相关信息,看重大更新说明。
WEBAPI_URL = 'http://www.ab135.com'
WEBAPI_TOKEN = 'ab135'
# Mysql 数据库连接信息
MYSQL_HOST = '127.0.0.1'
MYSQL_PORT = 3306
MYSQL_USER = 'ss'
MYSQL_PASS = 'ss'
MYSQL_DB = 'shadowsocks'
# 是否启用SSL连接,0为关,1为开
MYSQL_SSL_ENABLE = 0
# 客户端证书目录,请看 https://github.com/glzjin/shadowsocks/wiki/Mysql-SSL%E9%85%8D%E7%BD%AE
MYSQL_SSL_CERT = '/root/shadowsocks/client-cert.pem'
MYSQL_SSL_KEY = '/root/shadowsocks/client-key.pem'
MYSQL_SSL_CA = '/root/shadowsocks/ca.pem'
# API,不用管
API_HOST = '127.0.0.1'
API_PORT = 80
API_PATH = '/mu/v2/'
API_TOKEN = 'abcdef'
API_UPDATE_TIME = 60
# Manager 不用管
MANAGE_PASS = 'ss233333333'
#if you want manage in other server you should set this value to global ip
MANAGE_BIND_IP = '127.0.0.1'
#make sure this port is idle
MANAGE_PORT = 23333
#安全设置,限制在线 IP 数所需,下面这个参数随机设置,并且所有节点需要保持一致。
IP_MD5_SALT = 'randomforsafety'
运行的话,有几种方式
python server.py 用于调错的
./run.sh 无日志后台运行
./logrun.sh 有日志后台运行
supervisord
关于升级
自启动(参考)
iptables -I INPUT -p tcp -m tcp --dport 1024: -j ACCEPT
iptables-save >/etc/sysconfig/iptables
echo 'iptables-restore /etc/sysconfig/iptables' >> /etc/rc.local
echo '/root/shadowsocks/./logrun.sh ' >> /etc/rc.local
chmod +x /etc/rc.d/rc.local
安装 git 等
安装 libsodium
(如果提示cannot import name OrderedDict,可能需要给服务器打补丁:第三方插件ordereddict
easy_install ordereddict)下载程序源代码
进入 Shadowsocks 这个目录,安装依赖
配置程序
先得到你的配置文件
然后宝塔面板编辑 /root/shadowsocks/userapiconfig.py 文件
#节点ID ( 这里填前端搭建的节点ID)
运行的话,有几种方式
关于升级
自启动(参考)