my blog my blog

Tag: supervisor
Ubuntu下shadowsocks多用户后端manyuser+前端sspanel搭建教程

 

好吧,很多东西还是有个前端管理起来比较方便,奶牛今天也配了个,写下过程记录下。

安装shadowsocks支持

  1. apt-get install python-pip python-m2crypto
  2. pip install cymysql

安装LNMP

  1. wget -c http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz && tar zxf lnmp1.2-full.tar.gz && cd lnmp1.2-full && ./install.sh lnmp

后端安装配置

  1. git clone -b manyuser https://github.com/mengskysama/shadowsocks.git 
  2. cd ./shadowsocks/shadowsocks 
  3. vim Config.py 
  4.     #Config 
  5.     MYSQL_HOST = 'localhost' #这一行是服务器IP,127.0.0.1表示本机 
  6.     MYSQL_PORT = 3306 #数据库端口号 
  7.     MYSQL_USER = 'nenew' #数据库用户名 
  8.     MYSQL_PASS = 'nenew' #数据库密码 
  9.     MYSQL_DB = 'shadowsocks' #数据库名称 
  10.  
  11.     MANAGE_PASS = 'ss233333333' 
  12.     #if you want manage in other server you should set this value to global ip 
  13.     MANAGE_BIND_IP = '127.0.0.1' 
  14.     #make sure this port is idle 
  15.     MANAGE_PORT = 23333 
  16.  
  17. python server.py 

在mysql数据库中新建数据库shadowsocks,并添加用户nenew,导入manyuser中的sql文件,然后执行python server.py。如果没有异常,则表示已经安装成功后端。

前端安装:

  1. lnmp vhost add 

添加虚拟主机,然后进入虚拟主机目录

  1. wget https://github.com/orvice/ss-panel/archive/master.zip 
  2. unzip master.zip 
  3. rm master.zip 
  4. mv -f ss-panel-master/* ./ 
  5. mv lib/config-simple.php lib/config.php 
  6. vim lib/config.php 

编辑配置信息,然后将lib文件夹下的sql文件都导入到nenew数据库中。

添加守护进程supervisor:

  1. apt-get install supervisor 
  2. echo_supervisord_conf > /etc/supervisor/supervisord.conf 
  3. vim /etc/supervisor/supervisord.conf 

将文件最后添加

  1. [program:shadowsocks] 
  2. command=python /root/shadowsocks/shadowsocks/server.py -c /root/shadowsocks/shadowsocks/config.json 
  3. autorestart=true 
  4. user=root 

其中的目录自己根据实际情况设置,重启即可。

前端github:https://github.com/orvice/ss-panel

后端github:https://github.com/mengskysama/shadowsocks

顺带广告,ss服务器150元每年,需要者联系,联系方式见杂货铺。