内网穿透-线上参考

 

 

 

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++ glibc.i686

 

#git 环境配置

yum -y remove git
rm -rf /usr/bin/git-cvsserver
rm -rf /usr/bin/gitk

cd /usr/local/src
wget https://www.kernel.org/pub/software/scm/git/git-2.6.0.tar.gz
tar zxvf git-2.6.0.tar.gz
cd git-2.6.0
./configure --prefix=/usr/local/git
make
make install
ln -s /usr/local/git/bin/* /usr/bin/

 

#go环境配置
cd /usr/local/src
wget http://www.golangtc.com/static/go/1.9.1/go1.9.1.linux-amd64.tar.gz
tar -zxvf go1.9.1.linux-amd64.tar.gz
/bin/cp -rf go /usr/local/
ln -s /usr/local/go/bin/* /usr/bin/

export GOROOT=/usr/local/go
export GOBIN=$GOROOT/bin
export GOPKG=$GOROOT/pkg/tool/linux_amd64
export GOARCH=amd64
export GOOS=linux
export GOPATH=/Golang
export PATH=$PATH:$GOBIN:$GOPKG:$GOPATH/bin

go version

mkdir -p /root/go1.4/
/bin/cp -rf /usr/local/src/go/* /root/go1.4/

 


###ngrok
cd /usr/local/
git clone https://github.com/inconshreveable/ngrok.git
export GOPATH=/usr/local/ngrok/
export NGROK_DOMAIN="pay88801.bwt18.com"
cd ngrok

mkdir /usr/local/ngrok/bin/
cp -rf /usr/local/go/bin/go-bindata /usr/local/ngrok/bin/


openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_DOMAIN" -days 5000 -out rootCA.pem
openssl genrsa -out server.key 2048
openssl req -new -key server.key -subj "/CN=$NGROK_DOMAIN" -out server.csr
openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 5000

cp rootCA.pem assets/client/tls/ngrokroot.crt
cp server.crt assets/server/tls/snakeoil.crt
cp server.key assets/server/tls/snakeoil.key


vim /usr/local/ngrok/src/ngrok/log/logger.go
修改
log "github.com/keepeye/log4go"

 


#指定编译环境变量,如何确认GOOS和GOARCH,可以通过go env来查看
#编译服务端


cd /usr/local/go/src
GOOS=linux GOARCH=amd64 ./make.bash
cd /usr/local/ngrok/
GOOS=linux GOARCH=amd64 make release-server

 

#编译客户端,
#Windows的客户端编译
cd /usr/local/go/src
GOOS=windows GOARCH=amd64 ./make.bash
cd /usr/local/ngrok/
GOOS=windows GOARCH=amd64 make release-client

 

#客户端配置文件
server_addr: pay88801.bwt18.com:4443
trust_host_root_certs: false


#服务端启动
/usr/local/ngrok/bin/ngrokd -domain="$NGROK_DOMAIN" -httpAddr=":80"

 

#客户端使用
./ngrok -config=./ngrok.cfg -subdomain=blog 80
setsid ./ngrok -config=./ngrok.cfg -subdomain=test 80 #在linux下如果想后台运行

 


很抱歉!您访问的地区不在服务范围内。

 

 

 

 

 

 

 


git clone https://github.com/inconshreveable/ngrok.git /work/ngrok

 

cd /work/ngrok
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=pay88801.bwt18.com" -days 5000 -out rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key device.key -subj "/CN=pay88801.bwt18.com" -out device.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000

 

 

 

 

 

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++ glibc.i686

 

#git 环境配置

yum -y remove git
rm -rf /usr/bin/git-cvsserver
rm -rf /usr/bin/gitk

cd /usr/local/src
wget https://www.kernel.org/pub/software/scm/git/git-2.6.0.tar.gz
tar zxvf git-2.6.0.tar.gz
cd git-2.6.0
./configure --prefix=/usr/local/git
make
make install
ln -s /usr/local/git/bin/* /usr/bin/

 

#go环境配置
cd /usr/local/src
wget http://www.golangtc.com/static/go/1.9.1/go1.9.1.linux-amd64.tar.gz
tar -zxvf go1.9.1.linux-amd64.tar.gz
/bin/cp -rf go /usr/local/
ln -s /usr/local/go/bin/* /usr/bin/

export GOROOT=/usr/local/go
export GOBIN=$GOROOT/bin
export GOPKG=$GOROOT/pkg/tool/linux_amd64
export GOARCH=amd64
export GOOS=linux
export GOPATH=/Golang
export PATH=$PATH:$GOBIN:$GOPKG:$GOPATH/bin

go version

mkdir -p /root/go1.4/
/bin/cp -rf /usr/local/src/go/* /root/go1.4/

 


###ngrok
cd /usr/local/
git clone https://github.com/inconshreveable/ngrok.git
export GOPATH=/usr/local/ngrok/
export NGROK_DOMAIN="pay88801.bwt18.com"
cd ngrok

mkdir /usr/local/ngrok/bin/
cp -rf /usr/local/go/bin/go-bindata /usr/local/ngrok/bin/


openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_DOMAIN" -days 5000 -out rootCA.pem
openssl genrsa -out server.key 2048
openssl req -new -key server.key -subj "/CN=$NGROK_DOMAIN" -out server.csr
openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 5000

cp rootCA.pem assets/client/tls/ngrokroot.crt
cp server.crt assets/server/tls/snakeoil.crt
cp server.key assets/server/tls/snakeoil.key


vim /usr/local/ngrok/src/ngrok/log/logger.go
修改
log "github.com/keepeye/log4go"

 


#指定编译环境变量,如何确认GOOS和GOARCH,可以通过go env来查看
#编译服务端


cd /usr/local/go/src
GOOS=linux GOARCH=amd64 ./make.bash
cd /usr/local/ngrok/
GOOS=linux GOARCH=amd64 make release-server

 

#编译客户端,
#Windows的客户端编译
cd /usr/local/go/src
GOOS=windows GOARCH=amd64 ./make.bash
cd /usr/local/ngrok/
GOOS=windows GOARCH=amd64 make release-client

 

#客户端配置文件
server_addr: pay88801.bwt18.com:4443
trust_host_root_certs: false


#服务端启动
/usr/local/ngrok/bin/ngrokd -domain="$NGROK_DOMAIN" -httpAddr=":80"

 

#客户端使用
./ngrok -config=./ngrok.cfg -subdomain=blog 80
setsid ./ngrok -config=./ngrok.cfg -subdomain=test 80 #在linux下如果想后台运行

 


很抱歉!您访问的地区不在服务范围内。

 

 

 

 

 

 

 


git clone https://github.com/inconshreveable/ngrok.git /work/ngrok

 

cd /work/ngrok
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=pay88801.bwt18.com" -days 5000 -out rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key device.key -subj "/CN=pay88801.bwt18.com" -out device.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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++ glibc.i686

 

#git 环境配置

yum -y remove git
rm -rf /usr/bin/git-cvsserver
rm -rf /usr/bin/gitk

cd /usr/local/src
wget https://www.kernel.org/pub/software/scm/git/git-2.6.0.tar.gz
tar zxvf git-2.6.0.tar.gz
cd git-2.6.0
./configure --prefix=/usr/local/git
make
make install
ln -s /usr/local/git/bin/* /usr/bin/

 

#go环境配置
cd /usr/local/src
wget http://www.golangtc.com/static/go/1.9.1/go1.9.1.linux-amd64.tar.gz
tar -zxvf go1.9.1.linux-amd64.tar.gz
/bin/cp -rf go /usr/local/
ln -s /usr/local/go/bin/* /usr/bin/

export GOROOT=/usr/local/go
export GOBIN=$GOROOT/bin
export GOPKG=$GOROOT/pkg/tool/linux_amd64
export GOARCH=amd64
export GOOS=linux
export GOPATH=/Golang
export PATH=$PATH:$GOBIN:$GOPKG:$GOPATH/bin

go version

mkdir -p /root/go1.4/
/bin/cp -rf /usr/local/src/go/* /root/go1.4/

 


###ngrok
cd /usr/local/
git clone https://github.com/inconshreveable/ngrok.git
export GOPATH=/usr/local/ngrok/
export NGROK_DOMAIN="pay88801.bwt18.com"
cd ngrok

mkdir /usr/local/ngrok/bin/
cp -rf /usr/local/go/bin/go-bindata /usr/local/ngrok/bin/


openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_DOMAIN" -days 5000 -out rootCA.pem
openssl genrsa -out server.key 2048
openssl req -new -key server.key -subj "/CN=$NGROK_DOMAIN" -out server.csr
openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 5000

cp rootCA.pem assets/client/tls/ngrokroot.crt
cp server.crt assets/server/tls/snakeoil.crt
cp server.key assets/server/tls/snakeoil.key


vim /usr/local/ngrok/src/ngrok/log/logger.go
修改
log "github.com/keepeye/log4go"

 


#指定编译环境变量,如何确认GOOS和GOARCH,可以通过go env来查看
#编译服务端


cd /usr/local/go/src
GOOS=linux GOARCH=amd64 ./make.bash
cd /usr/local/ngrok/
GOOS=linux GOARCH=amd64 make release-server

 

#编译客户端,
#Windows的客户端编译
cd /usr/local/go/src
GOOS=windows GOARCH=amd64 ./make.bash
cd /usr/local/ngrok/
GOOS=windows GOARCH=amd64 make release-client

 

#客户端配置文件
server_addr: pay88801.bwt18.com:4443
trust_host_root_certs: false


#服务端启动
/usr/local/ngrok/bin/ngrokd -domain="$NGROK_DOMAIN" -httpAddr=":80"

 

#客户端使用
./ngrok -config=./ngrok.cfg -subdomain=blog 80
setsid ./ngrok -config=./ngrok.cfg -subdomain=test 80 #在linux下如果想后台运行

 


很抱歉!您访问的地区不在服务范围内。

 

 

 

 

 

 

 


git clone https://github.com/inconshreveable/ngrok.git /work/ngrok

 

cd /work/ngrok
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=pay88801.bwt18.com" -days 5000 -out rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key device.key -subj "/CN=pay88801.bwt18.com" -out device.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000

 

posted @ 2021-02-02 13:12  扶我起来写代码  阅读(134)  评论(0)    收藏  举报