CentOS安装配置ss-manyuser教程

作者:袖梨 2022-06-30

关于安装配置ss-manyuser的步骤,我们整理如下。

一、安装所需组件

yum install wget git tar gcc gcc-c++ openssl openssl-devel pcre-devel python-devel libevent automake autoconf libtool make -y

二、升级Python

请参考:CentOS升级Python2.7

wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar zxvf Python-2.7.6.tgz
 
cd /root/Python-2.7.6/Modules/zlib
./configure
make && make install
 
cd /root/Python-2.7.6
./configure
make && make install
 
mv /usr/bin/python /usr/bin/python2.4.3
ln -s /usr/local/bin/python2.7 /usr/bin/python

三、安装setuptools、pip、cymysql、ss

cd
wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
python ez_setup.py --insecure
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-6.0.7.tar.gz
tar zxvf pip-6.0.7.tar.gz
cd pip-6.0.7
python setup.py install
pip install cymysql
cd
git clone -b manyuser https://github.com/mengskysama/shadowsocks.git
 
cd /root/shadowsocks/shadowsocks
vim Config.py

编辑数据库配置保存即可。

四、安装swig和M2Crypto

cd /root
wget http://jaist.dl.sourceforge.net/project/swig/swig/swig-3.0.0/swig-3.0.0.tar.gz
tar zxvf swig-3.0.0.tar.gz
cd swig-3.0.0
./configure
make && make install

cd /root
wget https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz --no-check-certificate
tar zxvf M2Crypto-0.22.3.tar.gz
cd M2Crypto-0.22.3
python setup.py build
python setup.py install

五、配置supervisor值守ss进程

请参考:CentOS配置Supervisor值守shadowsocks进程

cd /root
wget http://www.plope.com/software/meld3/meld3-0.6.5.tar.gz
tar zxvf meld3-0.6.5.tar.gz
cd meld3-0.6.5
python setup.py install
cd
 
pip install --upgrade pip
pip install --upgrade meld3
 
pip install supervisor
echo_supervisord_conf > /etc/supervisord.conf
 
vim /etc/supervisord.conf
[include]
files = /etc/supervisord.conf.d/*.conf
 
mkdir /etc/supervisord.conf.d
cd /etc/supervisord.conf.d
vim ss.conf
 
[program:ss]
command=python /root/shadowsocks/shadowsocks/server.py -c /root/shadowsocks/shadowsocks/config.json
autostart=true
autorestart=true
 
ln -s /usr/local/bin/supervisord /usr/bin/supervisord
ln -s /usr/local/bin/supervisorctl /usr/bin/supervisorctl
 
cd /etc/init.d
wget http://www.xj123.info/tool/sh/supervisord
chmod +x supervisord
 
chkconfig --add supervisord
chkconfig supervisord on
 
cd

service supervisord start

    supervisor一些控制命令
    启动 supervisor supervisord
    supervisorctl tail -f ss stderr #Ctrl+C 取消查看
    打开命令行 supervisorctl
    获得所有程序状态 supervisorctl status
    关闭目标程序 supervisorctl stop ss(换成你需要的程序)
    启动目标程序 supervisorctl start ss(换成你需要的程序)
    关闭所有程序 supervisorctl shutdown

相关文章

精彩推荐