loading

Loading

请输入关键字开始搜索
    首页 技术实践网站部署

    frp开机启动设置

    分类:网站部署
    字数: (1049)
    阅读: (183)
    0

    主要是使用system进行开机启动设置,需要后台运行的服务,创建一个 systemd 服务。

    cd /etc/systemd/system

    添加frp开机启动

    Server端启动

    编辑frps.service,如下:

    # server端
    sudo vim /etc/systemd/system/frps.service

    复制如下内容:

    [Unit]
    Description=Frp Server Daemon
    After=network.target
    
    [Service]
    Type=simple
    ExecStart=/home/ubuntu/frp/frps -c /home/ubuntu/frp/frps.ini
    Restart=always
    RestartSec=10
    User=root
    Group=root
    
    [Install]
    WantedBy=multi-user.target
    

    设置开机启动:

    sudo systemctl enable frps.service
    sudo systemctl start frps.service
    sudo systemctl stop frps.service

    查看看机启动状态

    sudo systemctl status frps.service

    客户端启动

    sudo vim /etc/systemd/system/frpc.service

    复制如下,记得修改对应路径的位置

    [Unit]
    Description=frpc Service
    After=network.target
    
    [Service]
    ExecStart=/home/ubuntu/frp/frpc -c /home/ubuntu/frp/frpc.toml #此处修改自己的位置
    Restart=always
    User=root
    Group=root
    
    [Install]
    WantedBy=multi-user.target

    设置开机启动:

    sudo systemctl enable frpc.service
    sudo systemctl start frpc.service
    sudo systemctl stop frpc.service
    
    sudo systemctl daemon-reload
    sudo systemctl restart frpc.service

    查看看机启动状态

    sudo systemctl status frpc.service
    本文发布于2024年11月19日14:50,已经过了404天,若内容或图片失效,请留言反馈
    文章出处: 求索空间
    文章链接: https://blog.askerlab.com/frp_install
    评论列表:
    empty

    暂无评论