搭建环境:
ubuntu 16.04 LTS (本地服务计算机) ubuntu 14.04 LTS(阿里云服务器)
apache tomcat 7
java 7
frp 0.8.1 linux
搭建过程:
- 资源准备
- frp 0.8.1 linux 二进制包
- tomcat
- 任意版本jvm
开始安装
分别在服务端ubuntu和客户端ubuntu解压安装包(jdk以及tomcat这里不再赘述)
tar -zxvf frp_0.8.1_linux.tar.gz配置本地ubuntu 16.04 LTS 中frpc.ini为:
#frpc.ini [common] server_addr = #阿里云服务器ip地址 server_port = 7000 auth_token = 123 [web] type = http local_port = 8889 #本地端口地址修改阿里云服务器ubuntu 14.04 LTS版本frps.ini配置为:
# frps.ini [common] bind_port = 7000 vhost_http_port = 80 [web]#不同标签名对应client中相同的标签 type = http custom_domains = #阿里云服务器地址(即服务访问地址,这里最好这么配置) auth_token = 123 [web-home] type = http custom_domains = #同上一标签 auth_token = 123启动服务
./frps -c ./frps.ini启动tomcat项目以及客户端
./frpc -c ./frpc.ini- 此时访问custom_domains标签设置的地址:80即可经过frp代理进入到本地服务调试。

本文介绍了如何配置frp,将本地运行在ubuntu 16.04 LTS的apache tomcat 7服务,通过frp代理,映射到阿里云ubuntu 14.04 LTS服务器的80端口,以便远程访问和调试。详细步骤包括环境搭建、frp配置文件的修改以及服务的启动。
951





