搭建ngrok教程有蛮多,推荐一篇把,地址是:https://www.svenbit.com/2014/09/run-ngrok-on-your-own-server/,教程里面,域名请用一致的,比如说用了tunnle.xxx.com,请所有的地方都用一致。
搭建的教程,我也写一下,我用的是CENTOS 7.3.1611
ngrok需要自己编译,所以先安装3个环境
执行这3条命令或者安装这3个程序了
sudo apt-get install build-essential
sudo apt-get install golang
sudo apt-get install mercurial
然后git下来ngrok的代码
git clone https://github.com/inconshreveable/ngrok.git ngrok
cd ngrok
再弄出证书来
openssl genrsa -out base.key 2048
openssl req -new -x509 -nodes -key base.key -days 10000 -subj "/CN=[NGROK_BASE_DOMAIN]" -out base.pem
openssl genrsa -out server.key 2048
openssl req -new -key server.key -subj