Giter Site home page Giter Site logo

rules-panel's Introduction

控制端部署:

  1. 上传源代码 设置public文件夹为运行目录(注意,文件不包含Master文件夹)。
  2. Nginx伪静态配置:
location /{     
    if (!-e $request_filename) {       
        rewrite ^/(.*)$ /index.php/$1 last;       
        break;     
    }    
}

Apache伪静态(.htaccess在public文件夹下)配置:

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

</IfModule>
  1. 设置定时任务

#安装curl

apt-get install curl -y

#设定定时任务(5分钟执行一次)

crontab -e

#添加定时任务,请替换网址为你自己的

*/5 * * * * curl https://网址/cron

  1. 导入数据库(test.sql)数据库配置文件app/config.php 默认用户名密码为:admin 123456

被控端部署-Golang版(推荐):

代码和执行逻辑重构,大幅降低CPU占用情况,但是不开放源代码,仅提供编译好的二进制程序

本程序会接管iptables的NAT规则,如果您不熟练iptables,请不要使用其他基于iptables的脚本!!!

#开启转发(此处为逗比脚本):

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/iptables-pf.sh && chmod +x iptables-pf.sh && bash iptables-pf.sh

然后执行 ./iptables-pf.sh 执行选项1安装iptables

#清空本地iptables规则(如果你是从nodejs被控端换过来,也必须执行此命令)

iptables -F

iptables -t nat -F

#保存防火墙

CENTOS执行:

service iptables save

Debian执行:

iptables-save > /etc/iptables.up.rules

#下载被控文件:

wget https://raw.githubusercontent.com/xb0or/rules-panel/master/Slave/Go/ip_table && chmod +x ip_table

#设定定时任务:

crontab -e

*/5 * * * * . /etc/profile;/root/ip_table key123 10.0.0.4 https://baidu.com/api

#参数说明:

*key123 为 主控面板添加服务器后,分配的key

*10.0.0.4 为主网卡上的IP,查看方法:ip addr。如果您的IP为公网IP,并且是动态IP,当IP变动时需要修改此处

*https://baidu.com/api 为您的主控URI,请自行替换为您的域名

#错误分析

  1. 提示文件写入失败:chown www 网站目录 -R
  2. 添加完服务器却找不到:给用户分配权限
  3. 如果你的小鸡是NAT,主网卡ip应该为内网ip(通常为10.开头)
  4. 端口不通:放行iptables防火墙。如果是centos 需要卸载firwall启用iptables
#signal SIGSEGV报错:

debian:

apt-get install ca-certificates -y

centos:

yum install ca-certificates -y

rules-panel's People

Contributors

mrjun12 avatar xb0or avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.