【Ngrok】Linux运行内网穿透工具Ngrok

1、下载 Ngrok
访问 Ngrok 下载页面

https://4kb.cn/TL

2、安装 Ngrok 服务
将下载的 ngrok_linux_x64-0.0.2.zip 文件上传至 Linux 服务器中,并解压

unzip ngrok_linux_x64-0.0.2.zip -d /usr/local/ngrok/

创建 Ngrok 服务文件

vim /etc/systemd/system/ngrok.service

输入以下内容

[Unit]
Description=ngrok service
After=network-online.target
Wants=network-online.target

[Service]
# 启动命令
ExecStart=/usr/local/ngrok/ngrok_linux_x64/start.sh

# 自动重启策略:只要进程退出就重启,延迟10秒
Restart=always
RestartSec=10

# 日志输出到系统日志,方便使用 journalctl 查看
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

重载 systemd 配置,让新文件生效

sudo systemctl daemon-reload

设置开机自启

sudo systemctl enable ngrok

启动服务

sudo systemctl start ngrok

查看运行状态(如果显示 active (running) 则成功)

sudo systemctl status ngrok

查看实时日志

sudo journalctl -u ngrok -f

重启服务

sudo systemctl restart ngrok

停止服务

sudo systemctl stop ngrok
————————————————
版权声明:本文为CSDN博主「JACKAL`」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_40065776/article/details/160227985

上一篇 ORA-02292: integrity constraint violated - child record found
下一篇 虚拟机安装iKuai