最完整的ss-panel前后端搭建方法(最新版)

最完整的ss-panel前后端搭建方法(最新版)

ss-panel(V2)版是一种傻瓜式的搭建方法,直接是上LNMP环境然后访问就行了,但是第三版的逼格有点高了,但是代码更加清晰,性能更好了,本站的免费ss帐号分享平台就是基于ss-panel!好了,下面介绍下搭建的方法!

如果你的Linux基础不好的话,可以直接看!ss-panel(ss-manyuser)前后端一键安装脚本   这个一键脚本,如果你的基础可以的话,可以继续往下看。。。。

首先搭建前端

这个就没什么好说的,直接可以使用LNMP一键搭建环境!

具体见:lnmp一键搭建

本教程所使用的环境是 NGINX + PHP 7 + MariaDB 10。当然其他主流 LNMP/LAMP 架构都可以(PHP >= 5.4),确保你的站点可以访问后就继续吧。

服务器需要安装git(yum -y install git)

下载 ss-panel 源码

ss-panel GitHub 项目地址:orvice/ss-panel

cd 至你的站点 web 根目录,从 git 上 clone 源码:

以上可以更新到最新版,如果需要版本和教程一致,请使用一下的命令

当然你也可以下载源码再用 WINSCP 传到 VPS 上

注意 git clone 后的目录结构,请务必保证 index.php 在站点根目录下。

配置 ss-panel

 

源码下载下来后

你需要在你站点的 NGINX 设置中加入这些(Apache自行添加):

V3 版的 ss-panel 使用了 composer 来自动管理依赖,这样就不用把一堆库打包在一起

这样,composer 就会根据 composer.json 中的内容自动安装好依赖,vendor 文件夹也出现了。

接着进行配置:

将 .env.example 复制一份重命名为 .env,自行修改其中的数据库和站点信息:

 

数据库的创建就不多说了,建站的一般都玩过数据库吧?将根目录下的 db.sql 导入到数据库中即可。其他配置自行修改。

最完整的ss-panel前后端搭建方法(最新版)

最后一步就是设置目录权限

 

 

现在就可以访问你的站点了,是不是熟悉的界面?

添加管理员

新版的ss-panel,可以直接cd到你的网站目录,执行

添加管理员

到这里,前端就已经配置完成了!

部署配置 ss-R

为了保证教程的可靠性,克隆自己的项目吧

先 clone 到本地:

然后安装必要组建

centos:

 

ubuntu/debian:

配置 ss-R

进入根目录初始化配置(假设根目录在~/shadowsocks,如果不是,命令需要适当调整):

shadowsocks目录内,对userapiconfig.py里以下内容进行相应修改:

根据你的数据库类型,需正确选择使用sspanelv2, sspanelv3, sspanelv3ssr之一

然后修改usermysql.json里面的内容:

以上包括(按次序):数据库服务器地址,端口,数据库登陆用户名,密码,数据库,节点ID(sspanelv3支持),等等,

要注意sspanelv3必须正确填写node_id才能正常使用,并且在填写该ID前,必须在面板上已经添加好该节点,以确定节点ID后,再在此处填写。

然后编辑user-config.json:

 

如果需要chacha20加密

 

如果需要开机自启动,直接把代码写在rc.local!

后台运行并启用日志:

OK,大功告成!现在就可以在后台添加节点了,试试吧!ss-panel的好处就是大家共享ss节点:

例如本站的 七月上 

就是基于的ss-panel!如果需要更多,更稳定的节点,直接点击https://www.7yueshang.com 加入我们吧,免费的喔!

对于ss-panel的搭建如果还有什么问题,可以留言,我会尽快回复的!

如果个人能力有限不会搭建的,可以联系我帮忙搭建,微博:独角兽的印迹,或者邮箱david@mail.echoteen.com

david

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:91   其中:访客  53   博主  36

  1. avatar sejin 1

    博主,网站的伪静态规则怎么写不对啊。。。怎么改都是403
    server
    {
    listen 80 default_server;
    #listen [::]:80 default_server ipv6only=on;
    server_name www.lengjiao.pw;
    index index.html index.htm index.php;
    root /home/wwwroot/www.lengjiao.pw/public;

    #error_page 404 /404.html;
    include enable-php.conf;

    location /
    {
    try_files $uri $uri/ /index.php$is_args$args;
    }

    • avatar david

      @sejin 你是nginx还是Apache?你有用我的脚本吗?你这个是全部内容吗?都没有把PHP的socket写进去!

  2. avatar boyoung 1

    root@localhost:~# cd /root/shadowsocks-rm/shadowsocks
    root@localhost:~/shadowsocks-rm/shadowsocks# python servers.py
    Traceback (most recent call last):
    File “/root/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 197, in thread_push
    DbTransfer.get_instance().push_db_all_user()
    File “/root/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 108, in push_db_all_user
    response = urllib2.urlopen(req)
    File “/usr/lib/python2.7/urllib2.py”, line 127, in urlopen
    return _opener.open(url, data, timeout)
    File “/usr/lib/python2.7/urllib2.py”, line 404, in open
    response = self._open(req, data)
    File “/usr/lib/python2.7/urllib2.py”, line 422, in _open
    ‘_open’, req)
    File “/usr/lib/python2.7/urllib2.py”, line 382, in _call_chain
    result = func(*args)
    File “/usr/lib/python2.7/urllib2.py”, line 1214, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    请问这是什么问题?

    • avatar david

      @boyoung 这个就是你的节点是V几,在config里面要写正确!算了,近期再重写真正的一键脚本

      • avatar ctrysbita 1

        @david 错误同上,v3,完整按这个教程做下来的。另外是不是漏装了个cymysql?

        • avatar david

          @ctrysbita 你安装看看,脚本里有安装的命令吧

      • avatar ctrysbita 1

        @david 解决了,config.py里设置API_KEY和.env里一样即可

        • avatar tongling 1

          @ctrysbita 请问我在config.py文件里没有看到有 API_KEY
          但是错误跟你的一样?我要强制加上 API_KEY吗?
          操作系统是 centos7.*

          • avatar david

            @tongling 不要,这个已经有更新了!

  3. avatar copperfiled 0

    老司师的邀请码来一个呗,谢谢

  4. avatar 挥洒拜拜 1

    [root@vultr ss-panel]# chown -R www /home/www/ss-panel
    chown: invalid user: ‘www’
    在给予权限的时候出现这个怎么解决

    • avatar david

      @挥洒拜拜 看看你的web服务器以什么用户启动就用什么~

  5. avatar P 1

    root@YunServer:/srv/www/html/shadowsocks-rm/shadowsocks# python servers.py Traceback (most recent call last):
    File “servers.py”, line 35, in
    from dbtransfer import DbTransfer
    File “/srv/www/html/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 5, in

    import cymysql
    ImportError: No module named cymysql
    root@YunServer:/srv/www/html/shadowsocks-rm/shadowsocks#
    这个错误什么意思呢?

    • avatar david

      @P 没有安装cymysql

      • avatar P 1

        @david 对的 我昨天后来搞定了,但是后来!有报错了!
        root@YunServer:/srv/www/html/shadowsocks-rm/shadowsocks# python server.py
        ERROR: config not specified
        usage: ssserver [OPTION]…
        A fast tunnel proxy that helps you bypass firewalls.

        You can supply configurations via either config file or command line arguments.

        Proxy options:
        -c CONFIG path to config file
        -s SERVER_ADDR server address, default: 0.0.0.0
        -p SERVER_PORT server port, default: 8388
        -k PASSWORD password
        -m METHOD encryption method, default: aes-256-cfb
        -t TIMEOUT timeout in seconds, default: 300
        -a ONE_TIME_AUTH one time auth
        –fast-open use TCP_FASTOPEN, requires Linux 3.7+
        –workers WORKERS number of workers, available on Unix/Linux
        –forbidden-ip IPLIST comma seperated IP list forbidden to connect
        –manager-address ADDR optional server manager UDP address, see wiki
        –prefer-ipv6 resolve ipv6 address first

        General options:
        -h, –help show this help message and exit
        -d start/stop/restart daemon mode
        –pid-file PID_FILE pid file for daemon mode
        –log-file LOG_FILE log file for daemon mode
        –user USER username to run as
        -v, -vv verbose mode
        -q, -qq quiet mode, only show warnings/errors
        –version show version information

        Online help:

        root@YunServer:/srv/www/html/shadowsocks-rm/shadowsocks#

        • avatar david

          @P 还是配置文件的问题吧

  6. avatar Tony 0

    可以工作,但是会报警告不知道为什么
    root@aliyunhk:/home/wwwroot/shadowsocks-rm/shadowsocks# python servers.py
    Traceback (most recent call last):
    File “/home/wwwroot/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 206, in thread_push
    DbTransfer.get_instance().push_db_all_user()
    File “/home/wwwroot/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 118, in push_db_all_user
    response = urllib2.urlopen(req)
    File “/usr/lib/python2.7/urllib2.py”, line 127, in urlopen
    return _opener.open(url, data, timeout)
    File “/usr/lib/python2.7/urllib2.py”, line 404, in open
    response = self._open(req, data)
    File “/usr/lib/python2.7/urllib2.py”, line 422, in _open
    ‘_open’, req)
    File “/usr/lib/python2.7/urllib2.py”, line 382, in _call_chain
    result = func(*args)
    File “/usr/lib/python2.7/urllib2.py”, line 1214, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    File “/usr/lib/python2.7/urllib2.py”, line 1184, in do_open
    raise URLError(err)
    URLError:
    WARNING:root:db thread except:

    • avatar david

      @Tony 配置文件有更新呢,你有更新配置文件吗?

      • avatar 魏延 1

        @david 我和他的错误提示好像差不多,怎么更新配置文件啊啊啊啊啊

  7. avatar poplj 0

    Sep 16 14:51:30 INFO —————————————–
    Sep 16 14:51:30 INFO Multi-User Shadowsocks Server Starting…
    Sep 16 14:51:30 INFO Current Server Version: 3.1.1-12-g43249c6

    Sep 16 14:51:30 INFO Now using MySQL Database as the user interface
    Sep 16 14:51:30 INFO Now starting manager thread…
    Sep 16 14:51:35 INFO Now starting user pulling thread…
    Sep 16 14:51:35 INFO Server Added: P[1025], M[rc4-md5], E[lj99boy@163.com]
    Sep 16 14:51:36 INFO Server Added: P[1026], M[rc4-md5], E[474473600@qq.com]
    Sep 16 14:51:40 INFO Now starting user pushing thread…

    您好 ,到执行python servers.py这里时,就一直停在 Sep 16 14:51:40 INFO Now starting user pushing thread…这一步不动了,请问这是什么原因?

  8. avatar bazhuayu 0

    我的运行这个错误
    Traceback (most recent call last):
    File “/root/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 206, in thread_push
    DbTransfer.get_instance().push_db_all_user()
    File “/root/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 66, in push_db_all_user
    last_time = time.time()
    UnboundLocalError: local variable ‘time’ referenced before assignment
    WARNING:root:db thread except:local variable ‘time’ referenced before assignment
    麻烦看下

  9. avatar 猴子 0

    博主啊,其他一切没问题,就是这里出了问题
    root@vultr:/shadowsocks-rm/shadowsocks# python servers.py
    Traceback (most recent call last):
    File “/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 206, in thread_push
    DbTransfer.get_instance().push_db_all_user()
    File “/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 118, in push_db_all_user
    response = urllib2.urlopen(req)
    File “/usr/lib/python2.7/urllib2.py”, line 154, in urlopen
    return opener.open(url, data, timeout)
    File “/usr/lib/python2.7/urllib2.py”, line 431, in open
    response = self._open(req, data)
    File “/usr/lib/python2.7/urllib2.py”, line 449, in _open
    ‘_open’, req)
    File “/usr/lib/python2.7/urllib2.py”, line 409, in _call_chain
    result = func(*args)
    File “/usr/lib/python2.7/urllib2.py”, line 1227, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    File “/usr/lib/python2.7/urllib2.py”, line 1197, in do_open
    raise URLError(err)
    URLError:
    WARNING:root:db thread except:

  10. avatar LeeWaiHo 0

    在执行脚本的时候出现如下错误
    python servers.py
    ^CTraceback (most recent call last):
    File “servers.py”, line 63, in
    main()
    File “servers.py”, line 59, in main
    time.sleep(100)
    KeyboardInterrupt
    不知道怎么办了 请大神指教!

  11. avatar 祈晴宝宝 0

    一直提示config not specified
    但是我config文件配置过了啊

    求指教

  12. avatar Tman 0

    运行servers报错,这个是什么原因:
    Traceback (most recent call last):
    File “/home/wwwroot/ys.yeasou.com/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 207, in thread_push
    DbTransfer.get_instance().push_db_all_user()
    File “/home/wwwroot/ys.yeasou.com/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 119, in push_db_all_user
    response = urllib2.urlopen(req)
    File “/usr/lib64/python2.6/urllib2.py”, line 126, in urlopen
    return _opener.open(url, data, timeout)
    File “/usr/lib64/python2.6/urllib2.py”, line 391, in open
    response = self._open(req, data)
    File “/usr/lib64/python2.6/urllib2.py”, line 409, in _open
    ‘_open’, req)
    File “/usr/lib64/python2.6/urllib2.py”, line 369, in _call_chain
    result = func(*args)
    File “/usr/lib64/python2.6/urllib2.py”, line 1190, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    File “/usr/lib64/python2.6/urllib2.py”, line 1165, in do_open
    raise URLError(err)
    URLError:
    WARNING:root:db thread except:

  13. avatar 菠萝 1

    [root@SS shadowsocks]# python servers.py
    Traceback (most recent call last):
    File “/data/webroot/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 207, in thread_push
    DbTransfer.get_instance().push_db_all_user()
    File “/data/webroot/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 119, in push_db_all_user
    response = urllib2.urlopen(req)
    File “/usr/lib/python2.6/urllib2.py”, line 126, in urlopen
    return _opener.open(url, data, timeout)
    File “/usr/lib/python2.6/urllib2.py”, line 391, in open
    response = self._open(req, data)
    File “/usr/lib/python2.6/urllib2.py”, line 409, in _open
    ‘_open’, req)
    File “/usr/lib/python2.6/urllib2.py”, line 369, in _call_chain
    result = func(*args)
    File “/usr/lib/python2.6/urllib2.py”, line 1190, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    File “/usr/lib/python2.6/urllib2.py”, line 1165, in do_open
    raise URLError(err)
    URLError:
    WARNING:root:db thread except:

    求解。。

    • avatar david

      @菠萝 你的配置文件也别全抄呀,按照最新的来,我这个也不是最新的了

  14. avatar 魏延 1

    博主您好,在执行 python servers.py 时貌似失败了 出现如下提示,请问是py版本问题还是什么,搞不懂了。。。
    Traceback (most recent call last):
    File “/root/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 207, in thread_push
    DbTransfer.get_instance().push_db_all_user()
    File “/root/shadowsocks-rm/shadowsocks/dbtransfer.py”, line 119, in push_db_all_user
    response = urllib2.urlopen(req)
    File “/usr/lib/python2.7/urllib2.py”, line 127, in urlopen
    return _opener.open(url, data, timeout)
    File “/usr/lib/python2.7/urllib2.py”, line 401, in open
    response = self._open(req, data)
    File “/usr/lib/python2.7/urllib2.py”, line 419, in _open
    ‘_open’, req)
    File “/usr/lib/python2.7/urllib2.py”, line 379, in _call_chain
    result = func(*args)
    File “/usr/lib/python2.7/urllib2.py”, line 1211, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    File “/usr/lib/python2.7/urllib2.py”, line 1181, in do_open
    raise URLError(err)
    URLError:
    WARNING:root:db thread except:

    • avatar david

      @魏延 配置文件也不要全抄呀,注意下最新版本呢

  15. avatar KSkenn 1

    同一个服务商的两台机器
    一台能正常使用 但是 没登陆记录和流量统计
    另一台就是报我之前反馈的错误 求博主联系方式 我微博找过你的

  16. avatar 邓邓 1

    我想问下怎样创建数据库啊?

    • avatar david

      @邓邓 图片上不是有的啊,create

  17. avatar 0

    root怎样执行php composer.phar install?

    • avatar david

      @ 直接输入啊

  18. avatar Fox 1

    2016-11-29 21:43:13 INFO db_transfer.py:171 db start server at port [21025] pass [123456] protocol [auth_sha1_v4_compatible] method [aes-256-cfb] obfs [tls1.2_ticket_auth_compatible]
    2016-11-29 21:43:13 INFO server_pool.py:127 starting server at [::]:21025
    2016-11-29 21:43:13 WARNING server_pool.py:140 IPV6 [Errno 98] Address already in use
    2016-11-29 21:43:13 INFO server_pool.py:153 starting server at 0.0.0.0:21025
    2016-11-29 21:43:13 WARNING server_pool.py:165 IPV4 [Errno 98] Address already in use
    前端后端搭建好了,但是运行时显示这个… 我也连接不上我的ss Po主知道怎么解决吗?

  19. avatar 仙无痕 1

    cp .env.example .env 这个在哪个文件夹 找网络半天没找到

    • avatar david

      @仙无痕 你用的git clone我的代码吗?

      • avatar 仙无痕 1

        @david 看到了,执行 php xcat createAdmin
        [root@LNMP ss-panel]# php xcat createAdmin
        PHP Fatal error: Uncaught Dotenv\Exception\InvalidPathException: Unable to read the environment file at /home/wwwroot/ss-panel/bootstrap/../.env. in /home/wwwroot/ss-panel/vendor/vlucas/phpdotenv/src/Loader.php:75
        Stack trace:
        #0 /home/wwwroot/ss-panel/vendor/vlucas/phpdotenv/src/Loader.php(52): Dotenv\Loader->ensureFileIsReadable()
        #1 /home/wwwroot/ss-panel/vendor/vlucas/phpdotenv/src/Dotenv.php(50): Dotenv\Loader->load()
        #2 /home/wwwroot/ss-panel/app/Services/Boot.php(14): Dotenv\Dotenv->load()
        #3 /home/wwwroot/ss-panel/bootstrap/app.php(19): App\Services\Boot::loadEnv()
        #4 /home/wwwroot/ss-panel/xcat(3): require(‘/home/wwwroot/s…’)
        #5 {main}
        thrown in /home/wwwroot/ss-panel/vendor/vlucas/phpdotenv/src/Loader.php on line 75

  20. avatar lalal 0

    博主你好 我能访问主页但点击 登录、注册、邀请码什么的全是404

    • avatar david

      @lalal 404就是没有的页面啊