折雨的天空
ngrok搭建的一些注意事项
2017-2-9 我好笨


一键安装包,在上一篇里面已经说了。



教程地址:



http://www.sunnyos.com/article-show-66.html







安装完成以后,用命令



sh ./ngrok.sh



输入你的域名后,可以有个选择,可以启动服务。启动服务需要服务器80端口没有被占用。







然后,就是客户端,客户端在一键包里也集成了,直接编译一个客户端







主要是客户端的使用:







可以参考教程:







http://www.sunnyos.com/article-show-61.html











主要步骤是,下载编译的客户端到本地,建立一个本地配置文件







文件内容包含:







server_addr: "server.ngrok.cc:4443"
tunnels:
sunny:
subdomain: "sunnyos"
auth: "sunny:admin1993"
proto:
http: 192.168.1.108:80
sunny1:
subdomain: "sunnyos1"
proto:
http: 192.168.1.104:80
ssh:
remote_port: 50000
proto:
tcp: 192.168.1.120:22
test:
hostname: "test.sunnyos.com"
proto:
http: 80
test1:
hostname: "sunny.com"
proto:
http: 192.168.1.104:80
test2:
hostname: "www.sunny.com"
proto:
http: 192.168.1.104:80



就是这些,根据情况来,如果要顶级域名的话,要做cname解析,解析到你的Ngrok的域名上。上面配置文件中的第一个也要换成你的域名。







最后启动的时候,可以使用



Ngrok --help





来看命令。







我本地用了一个







ngrok -config=./ngrok.cfg start ben



对应的是 配置文件路径 start命令,ben是通道名称。







这里要助理,cfg里不支持tab空格,要用空格,有点坑。

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容