GithubHelp home page GithubHelp logo

xswvfr / rules-panel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrjun12/rules-panel

0.0 0.0 0.0 1.01 MB

web 管理 iptables转发规则

PHP 25.85% HTML 17.71% CSS 9.98% JavaScript 45.71% TSQL 0.75%

rules-panel's Introduction

控制端部署:

  1. 上传源代码 设置public文件夹为运行目录。
  2. 伪静态配置:location /{ if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; } }
  3. 设置cron定时任务 https://网址/cron (5分钟一次)
  4. 导入数据库(test.sql)数据库配置文件app/config.php 默认用户名密码为:admin 123456

被控端部署:

#被控端安装教程(转发机器) #被控端安装很简单,被控端会接管iptables的NAT规则,其他NAT命令会失效 #请勿安装其他基于iptables的ddns转发脚本

#安装nodejs最新版(centos)

yum install epel-* -y

yum install nodejs -y

npm install n -g

n latest

npm install pm2 -g

#安装nodejs最新版(debian)

curl -sL https://deb.nodesource.com/setup_9.x | sudo bash - apt-get install nodejs

npm install pm2 -g

#nodejs和pm2安装结束

#pm2开机自启

pm2 startup

#新建文件夹iptables_forward

mkdir iptables_forward

#将 app.js、package.json两个文件放进去

#修改app.js文件,如下三处,保存

const master_url = "https://baidu.com" #填写Master URL

const slave_key = '123456'; #填写节点key

const nic_ip = '1.1.1.1'; #主网卡上的IP(如果主网卡IP=公网IP时,当IP变动,需更新此处IP,并且重启本进程!!!)

*Mater URL是主控的网址

*key是主控添加服务器后生成的

*主网卡IP查看方法:ip addr

#然后在该文件夹下执行

npm install

#安装iptables转发(逗比转发脚本)

wget http://ftp.inwang.net/iptables-pf.sh && chmod +x iptables-pf.sh

#执行iptables转发脚本,执行第一个选项安装iptables

#启动

pm2 start app.js

#开机自启

pm2 save

#重启服务器

reboot

#********到此安装结束,可以愉快地使用了

#其他命令

pm2 list #查询

pm2 logs 0 #查询日志

pm2 stop 0 #暂停

pm2 flush #清除日志

#错误分析

  1. 提示文件写入失败:chown www 网站目录 -R

rules-panel's People

Contributors

mrjun12 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.