關於安裝配置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