<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/ DTD/wml_1.1.xml">

<wml>
<head>
<meta http-equiv="cache-control" content="max-age=180,private" />
</head>
<card title="ss-panel – 开源的ShadowSocks多用户管理系统">
<p>
作者:<a href="index.php?action=showuser&amp;userid=1&amp;hash=">admin</a><br />时间:2015-03-07 18:06<br />分类:<a href="index.php?action=list&amp;cid=3&amp;hash=">电脑技术</a><br />内容:
ss-panel &ndash; 开源的ShadowSocks多用户管理系统

首先你必须要有一个PHP+MYSQL的环境。PHP版本&gt;=5.3 MYSQL&gt;=5.0（这里最好是5.5版本）。

①配置环境

apt-get update

apt-get install apache2 //输入y

apt-get install mysql-server //输入y 创建MYSQL密码 要两遍一样

apt-get install php5 输入y

apt-get install php5-mysql

apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin //输入y 选apache回车 OK 密码 密码 密码

cp /etc/phpmyadmin/apache.conf /etc/apache2/sites-available/phpmyadmin

cd /etc/apache2/sites-enabled/

ln -s ../sites-available/phpmyadmin

/etc/init.d/apache2 restart

/配置环境完成，请访问VPS的IP，如果显示&ldquo;It Works&rdquo;，http://ip/phpmyadmin 能够显示phpmyadmin。则表示环境配置成功/

安装前我们最好升级一下相应的包




    
        
            
            
            1

            2

            

            

            
            
            apt-get update

            apt-get install -y &ndash;force-yes build-essential autoconf libtool libssl-dev git curl

            

            

        
    





安装cymysql




    
        
            
            
            1

            

            

            
            
            pip install cymysql

            

            

        
    





出现：pip: command not found的问题话，可以查看

Debian下准备编译一下python呢，但是输入pip命令出现了错误。这个错误的解决时非常简单了

因为我们没有安装pip，所以在这里安装一下就好。




    
        
            
            
            1

            

            

            
            
            apt-get install python-pip -y

            

            

        
    





使用上面的安装一下python依赖的pip就好了。

或者使用下面的命令都是可以，达到的效果是一样的。个人比较喜欢下面的。使用下面的命令把apt-get命令也一起升级了，所以是不错的选择：




    
        
            
            
            1

            

            

            
            
            apt-get update &amp;&amp; apt-get upgrade -y &amp;&amp; apt-get install python-pip -y

            

            

        
    





出现下图所示就说明安装成功了

安装SS多用户 




    
        
            
            
            1

            

            

            
            
            git clone -b manyuser https://github.com/mengskysama/shadowsocks.git

            

            

        
    








    
        
            
            
            1

            

            

            
            
             cd /root/shadowsocks/shadowsocks

            

            

        
    





创建数据库shadowsocks，然后将shadowsocks.sql导入到你创建的数据库中。

设置数据库
编辑Config.py文件：




    
        
            
            
            1

            

            

            
            
            vi Config.py

            

            

        
    





把上面的信息修改成你自己的数据库的信息。

MYSQL_HOST = &ldquo;是你的mysql服务器的IP（如果在一个VPS上的话，可以是：127.0.0.1或者localhost）&rdquo; 




    
        
            
            
            1

            2

            3

            

            

            
            
            MYSQL_HOST = &lsquo;你的数据库IP&rsquo;

            MYSQL_HOST = &lsquo;127.0.0.1&rsquo;

            MYSQL_HOST = &lsquo;localhost&rsquo;

            

            

        
    





配置文件信息




    
        
            
            
            1

            2

            3

            4

            5

            6

            7

            8

            9

            10

            11

            12

            

            

            
            
            #Config

            MYSQL_HOST = &lsquo;localhost&rsquo;

            MYSQL_PORT = 3306

            MYSQL_USER = &lsquo;数据库用户&rsquo;

            MYSQL_PASS = &lsquo;数据库密码&rsquo;

            MYSQL_DB = &lsquo;数据库名称&rsquo;

             

            MANAGE_PASS = &lsquo;ss233333333&prime;

            #如果需要管理其他的服务器，填写服务器IP

            MANAGE_BIND_IP = &lsquo;127.0.0.1&rsquo;

            #make sure this port is idle

            MANAGE_PORT = 23333

            

            

        
    





开启SS服务
配置文件后运行：




    
        
            
            
            1

            

            

            
            
            python server.py

            

            

        
    





现在shadowsocks多用户的后端就安装完成了，后面的几篇文章介绍一下现在的几个前端的安装方法。

项目地址：https://github.com/orvice/ss-panel

演示地址：https://cattt.com/

下载地址：https://github.com/orvice/ss-panel/archive/master.zip

本站下载： 

下载 &ldquo;SS-Panel&rdquo;ss-panel.zip &ndash; 已下载89次 &ndash; 2 MB

安装教程
安装好后端后，下面就只需要修改一下配置文件就好了。

导入sql文件夹下面的所有数据库到你自己建立的数据库中。

修改lib/config-sample.php（里面填写你的数据库信息）并改为：config.php即可。




PHP







    
        
            
            
            1

            2

            3

            4

            5

            6

            7

            8

            9

            10

            11

            12

            13

            14

            15

            16

            17

            18

            19

            20

            21

            22

            23

            24

            25

            26

            27

            28

            29

            30

            31

            32

            33

            34

            35

            36

            37

            38

            39

            40

            41

            42

            43

            44

            45

            46

            47

            48

            49

            50

            51

            52

            53

            54

            55

            56

            57

            58

            

            

            
            
            &lt;?php

            /*

            * ss-panel配置文件

            * https://github.com/orvice/ss-panel

            * Author @orvice

            * https://orvice.org

            */

             

            //Define DB Connection

            define(&lsquo;DB_HOST&rsquo;,&lsquo;localhost&rsquo;);

            define(&lsquo;DB_USER&rsquo;,&lsquo;root&rsquo;);

            define(&lsquo;DB_PWD&rsquo;,&lsquo;password&rsquo;);

            define(&lsquo;DB_DBNAME&rsquo;,&lsquo;db&rsquo;);

            define(&lsquo;DB_CHARSET&rsquo;,&lsquo;utf8&prime;);

             

            /*

            * 下面别修改

            */

             

            //Define system Path

            define(&lsquo;SS_PATH&rsquo;,&rdquo;);

             

            //Version

            $version   =&ldquo;0.2.8&rdquo;;

             

            //set timezone

            date_default_timezone_set(&lsquo;PRC&rsquo;);

             

            //Using Mysqli

            $dbc = new mysqli(DB_HOST,DB_USER,DB_PWD,DB_DBNAME);

            $db_char = DB_CHARSET;

            $dbc-&gt;query(&ldquo;SET NAMES utf8&Prime;);

            $dbc-&gt;query(&ldquo;SET time_zone = &lsquo;+8:00&prime;&rdquo;);

             

            //定义流量

            $tomb = 1024*1024;

            $togb = $tomb*1024;

             

             

             

            /*

            * 下面的东西根据需求修改

            */

             

            //define Plan

            //注册用户的初始化流量

            //默认5GiB

            $a_transfer = $togb*5;

             

            //签到设置 签到活的的最低最高流量,单位MB

            $check_min = 1;

            $check_max = 100;

             

            //name

            $site_name = &ldquo;ss-panel&ldquo;;

             

            //invite only

            $invite_only = true;

            

            

        
    





上面是默认的配置，修改一下数据信息就好了

后台信息
后台地址：/admin

帐号：admin

密码：12345678
</p><p>
<a href="index.php?action=login&amp;hash=">立即登陆发表评论</a><br />
</p>
<p><a href="index.php?action=list&amp;hash=">返回日志列表</a><br /><a href="index.php?action=index&amp;hash=">返回主页</a></p>
</card>
</wml>
