Supervisor 安装
Centos 7 下 yum 安装
# yum install -y epel-release
# yum install -y supervisor
# systemctl enable supervisord # 开机自启动
# systemctl start supervisord # 启动supervisord服务
# systemctl status supervisord # 查看supervisord服务状态
# ps -ef|grep supervisord # 查看是否存在supervisord进程
via:https://blog.csdn.net/Jsonxiang/article/details/87872480
下载安装 frp
mkdir /root/software
cd /root/software
wget -c "https://github.com/fatedier/frp/releases/download/v0.35.1/frp_0.35.1_linux_amd64.tar.gz" -O frp.tar.gz
tar -xzvf frp.tar.gz
mv frp_0.35.1_linux_amd64 frp
cd frp
创建守护进程 以 frp 守护进程为例
# cd /etc/supervisord.d/
# vim frp.ini
[program:frp]
command = /root/software/frp/frps -c /root/software/frp/frps.ini
autostart = true
然后重新加载
systemctl restart supervisord
CentOS 6 安装
# yum install -y epel-release
# yum install -y supervisor
# chkconfig --add supervisord #加入服务
# chmod 755 /etc/init.d/supervisord #设置权限
# chkconfig supervisord on #设置开机启动
CentOS 6 貌似无法在其他目录添加配置文件。在 conf 中 [include] 貌似也不行,暂时就添加在了 supervisord.conf 文件最后
[program:frp]
command = /root/frp/frps -c /root/frp/frps.ini
autostart = true
frp 配置
服务端 frps.ini
# cd /root/software/frp
# vim frps.ini
[common]
bind_port = 7000
vhost_http_port = 8085
vhost_http_timeout = 600
客户端 frpc.ini
[common]
server_addr = 118.xxx.xxx.xxx
server_port = 7000
[web01]
type = http
local_port = 8080
custom_domains = test.liuguofeng.com
服务端启动 ./frpc -c frpc.ini
客户端启动 ./frps -c frps.ini
Windows 客户端开机启动 frpc.bat
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
::下面是你自己的代码。
echo Starting nginx...
cd C:\Software\frp_0.33.0_windows_amd64
frpc.exe -c frpc.ini
放至启动文件夹
C:\Users\misswell\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup