CentOS 7下ngrok服务器搭建
一、安装ngrok编译环境
1、安装git所需要的依赖包
yum -y install zlib-devel openssl-devel perl hg cpio expat-devel gettext-devel curl curl-devel perl-ExtUtils-MakeMaker hg wget gcc gcc-c++ libxslt xmlto
yum -y install asciidoc
2、卸载系统自带git,除非版本高于1.8
git version
Git yum remove git
3、安装git
yum install git
4、安装go环境
yum install y golang
检查go环境
go version
二、安装ngrok
1、下载ngrok源码
cd /usr/local/
git clone https://github.com/inconshreveable/ngrok.git
2、安装证书
cd ngrok
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=example.com" -days 5000 -out rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key service.key -subj "/CN=example.com" -out device.csr
openssl x509 -req -in service.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000
3、证书拷贝
yes|cp rootCA.pem assets/client/tls/ngrokroot.crt
yes|cp service.crt assets/server/tls/snakeoil.crt
yes|cp service.key assets/server/tls/snakeoil.key
4、交叉编译
centos服务端:
GOOS=linux GOARCH=amd64
make release-server
windows客户端:
GOOS=windows GOARCH=amd64
make release-client
5、启动服务端
ngrok/bin目录下,可以改变4443端口为其他比如8899:
./ngrokd -domain="example.com" -tunnelAddr=":8899"
后台运行服务端:
setsid ./ngrokd -domain="example.com" -tunnelAddr=":8899"
或者:
yum install screen
scree -S keepngrok
./ngrokd -domain="example.com" -tunnelAddr=":8899"
6、客户端使用
新建一个ngrok.cfg
server_addr: "example.com:8899"
trust_host_root_certs: false
tunnels:
http:
subdomain: "dev"
proto:
http: "8090"
https:
subdomain: "test"
proto:
https: "8091
ssh:
remote_port: 3311
proto:
tcp: "22"
进入客户端目录启动
cd e:\windows_amd64
ngrok -config ngrok.cfg start http https ssh
CentOS 7下ngrok服务器搭建相关推荐
- ngrok服务器搭建流程
ngrok服务器搭建流程 微信开发内网测试问题一直是一个困扰开发者的问题,ngrok服务是一个很好的解决方案,网上有类似的工具比如小米球但是不稳定或收费,如果自己有一台公网上的centos服务器,可以 ...
- CentOS7 NGROK服务器搭建 无需域名
CentOS7 NGROK服务器搭建 CentOS7 NGROK服务器搭建 无需域名 看到一些ngrok收费一月9元起,遂花了10元买了腾讯云服务https://curl.qcloud.com/lj0 ...
- Linux centos7 下 svn 服务器搭建
摘自:https://www.cnblogs.com/mymelon/p/5483215.html 鉴于在搭建时,参考网上很多资料,网上资料在有用的同时,也坑了很多人 本文的目的,也就是想让后继之人在 ...
- mac下RTSP服务器搭建(ZLMediaKit)
mac下RTSP服务器搭建(ZLMediaKit) 目录 获取代码 编译器 cmake 依赖库 构建和编译项目 运行 测试 注:参考wiki(包含其他系统安装方式):https://github.co ...
- suse ftp文件服务器搭建,SUSE下FTP服务器搭建
FTP(File Transfer Protocol),是TCP/IP网络上两台计算机传送文件的协议,是在TCP/IP网络和Internet上最早使用的协议之一,属于网络协议组的应 用层.FTP客户机 ...
- Linux下FTP服务器搭建
Linux下FTP服务器搭建 一.FTP介绍 二.环境介绍 三.FTP服务端搭建步骤 1.安装相关软件包 2.启动FTP并检查状态 3.检查服务端口运行状态 4.修改FTP配置文件 5.关闭selin ...
- CentOS 7 下解决服务器报 Redis server went away 的错误
这两天在学习 Redis,因为 Redis 在 Windows 上的表现并不好,而且线上环境基本上都是 Linux,所以选择在 CentOS 7 上跑跑例子.在安装完 Redis 的 PHP 客户端 ...
- linux下svn服务器搭建及使用
文章目录 1. 安装svn客户端 2. 安装svn服务器 3. 在svn目录下创建版本库 4. 修改版本库配置文件 4.1 修改 authz 文件 4.2 设置密码 passwd 4.3 修改 svn ...
- 一分钟实现内网穿透(ngrok服务器搭建)
简单来说内网穿透的目的是:让外网能访问你本地的应用,例如在外网打开你本地http://127.0.0.1指向的Web站点. 最近公司的花生壳到期了,要续费,发现价格一直在涨,都是5年以上的老用户,旗舰 ...
最新文章
- 转	The connection to adb is down, and a severe error
- Map json数据解析
- 移动项目开发笔记(.Net下的观察者(Observer)模式)
- 使用运行时动态创建属性
- 学习ansible playbook之前先了解下YAML语法
- 【机器学习PAI实践八】用机器学习算法评估学生考试成绩
- 民用建筑工程给水排水设计深度图样_「安装工程识图」建筑给水排水施工图的识读方法...
- 利用 Azure Functions 实现无服务器体系结构
- 【Java】网络编程
- CISC与RISC的区别?
- typecho和wordpress模板了解、开发流程介绍、前台后台前端后端区分
- 微信小程序 this和that详解及简单实例
- 语言软件生成outsid_常用的C语言开发工具有哪些
- MySQL数据库中的删除命令:delete、truncate、drop
- Java Swing Action 动作
- 数据分析之matplotlib和numpy的应用
- 《java学习二》jvm性能优化-----认识jvm
- Google Chrome浏览器模拟设置不同分辨率
- 数据挖掘应用实例分析
- 管家婆服装.NET II TOP V6.5-采购入库单(一)