{"id":1979,"date":"2022-11-01T00:27:06","date_gmt":"2022-10-31T16:27:06","guid":{"rendered":"https:\/\/www.tra56.com\/?p=1979"},"modified":"2022-11-01T00:27:06","modified_gmt":"2022-10-31T16:27:06","slug":"1979","status":"publish","type":"post","link":"https:\/\/www.tra56.com\/1979.html","title":{"rendered":"frp\u7bc7—\u5185\u7f51\u7a7f\u900f frp\u914d\u7f6e"},"content":{"rendered":"

\u6587\u7ae0\u76ee\u5f55<\/p>\n

1\u3001\u4e0b\u8f7dfrp<\/p>\n

2\u3001\u89e3\u538b<\/p>\n

3\u3001\u914d\u7f6e\u670d\u52a1\u7aef<\/p>\n

\u4fee\u6539frps.ini<\/p>\n

\u542f\u52a8\u670d\u52a1\u7aef\uff1a<\/p>\n

4\u3001\u914d\u7f6esupervisor\u542f\u52a8\u670d\u52a1\u7aef<\/p>\n

5\u3001\u914d\u7f6e\u5ba2\u6237\u7aef\uff1a<\/p>\n

\u4fee\u6539frpc.ini<\/p>\n

\u542f\u52a8\u5ba2\u6237\u7aef<\/p>\n

6\u3001\u914d\u7f6esupervisor\u542f\u52a8\u5ba2\u6237\u7aef<\/p>\n

supervisor\u547d\u4ee4<\/p>\n

1\u3001\u4e0b\u8f7dfrp<\/p>\n

\u4e0b\u8f7d\u94fe\u63a5<\/p>\n

https:\/\/github.com\/fatedier\/frp\/releases<\/p>\n

\"eca83ba8ae069030e6b715ff7a642037_534de9d55b514ae6808079b3cd52f955.png\"\/<\/p>\n

2\u3001\u89e3\u538b<\/p>\n

tar xvf frp_0.40.0_linux_386.tar.gz<\/pre>\n

\"image.png\"\/<\/p>\n

\u8fdb\u5165\u76ee\u5f55\u4e2d\u53ef\u4ee5\u770b\u5230\u4ee5\u4e0b\u4e03\u4e2a\u6587\u4ef6<\/span><\/p>\n

frpc:\u5ba2\u6237\u7aef\u53ef\u6267\u884c\u7a0b\u5e8f\r\nfrpc_full.ini:\u5ba2\u6237\u7aef\u6240\u6709\u914d\u7f6e\u9879\uff08\u53ef\u4ee5\u518d\u6b64\u6587\u4ef6\u67e5\u770bfrp\u7684\u6240\u6709\u7684\u914d\u7f6e\u9879\uff09\r\nfrpc.ini:\u5ba2\u6237\u7aef\u914d\u7f6e\u9879\r\nfrps:\u670d\u52a1\u7aef\u53ef\u6267\u884c\u7a0b\u5e8f\r\nfrps_full.ini:\u670d\u52a1\u7aef\u6240\u6709\u914d\u7f6e\u9879\uff08\u53ef\u4ee5\u518d\u6b64\u6587\u4ef6\u67e5\u770bfrp\u7684\u6240\u6709\u7684\u914d\u7f6e\u9879\uff09\r\nfrps.ini:\u670d\u52a1\u7aef\u914d\u7f6e\u9879\r\nLICENSE:\u8bb8\u53ef\u8bc1<\/pre>\n

3\u3001\u914d\u7f6e\u670d\u52a1\u7aef<\/h1>\n
<!--\u5728\u670d\u52a1\u7aef\u4e0d\u9700\u8981\u5ba2\u6237\u7aef\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u548c\u914d\u7f6e\uff0c\u4e3a\u4e86\u907f\u514d\u8bef\u64cd\u4f5c\uff0c\u5220\u9664\u6389\u6240\u6709\u5ba2\u6237\u7aef\u7684\u914d\u7f6e-->\r\n\r\n[root@VM-16-15-centos frp_0.40.0]$ rm -rf frpc frpc_full.ini frpc.ini\r\n\r\n[root@VM-16-15-centos frp_0.40.0]$ ll\r\ntotal 13184\r\n-rwxr-xr-x 1 root root 13471744 Oct 25 20:58 frps\r\n-rw-r--r-- 1 root root     5010 Oct 25 21:01 frps_full.ini\r\n-rw-r--r-- 1 root root      168 Nov 17 09:06 frps.ini\r\n-rw-r--r-- 1 root root    11358 Oct 25 21:01 LICENSE\r\ndrwxr-xr-x 2 root root     4096 Oct 25 21:01 systemd<\/pre>\n

\u4fee\u6539frps.ini<\/h2>\n
vim frps.ini \r\n\r\n[common]\r\nbind_port = 7000\r\ndashboard_port = 7001\r\ndashboard_user = admin\r\ndashboard_pwd = 123456<\/pre>\n

\u542f\u52a8\u670d\u52a1\u7aef\uff1a<\/h2>\n
.\/frps -c frps.ini<\/pre>\n

\u542f\u52a8\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7<\/span>http:\/\/server_ip:7001<\/a> <\/span><\/p>\n

\"85c59343dccbd2638a022d8e4c77204e_796e4310b554b2dbf177906ca0d98192.png\"\/<\/p>\n

4\u3001\u914d\u7f6esupervisor<\/a>\u542f\u52a8\u670d\u52a1\u7aef<\/h1>\n
[program:frps]\r\ndirectory = \/opt\/frp_0.40.0\r\ncommand = \/opt\/frp_0.40.0\/frps -c \/opt\/frp_0.40.0\/frps.ini \r\nautostart = true ; \u5728 supervisord \u542f\u52a8\u7684\u65f6\u5019\u4e5f\u81ea\u52a8\u542f\u52a8\r\nstartsecs = 5 ; \u542f\u52a8 5 \u79d2\u540e\u6ca1\u6709\u5f02\u5e38\u9000\u51fa\uff0c\u5c31\u5f53\u4f5c\u5df2\u7ecf\u6b63\u5e38\u542f\u52a8\u4e86\r\nautorestart = true ; \u7a0b\u5e8f\u5f02\u5e38\u9000\u51fa\u540e\u81ea\u52a8\u91cd\u542f\r\nstartretries = 3 ; \u542f\u52a8\u5931\u8d25\u81ea\u52a8\u91cd\u8bd5\u6b21\u6570\uff0c\u9ed8\u8ba4\u662f 3\r\nuser = root ; \u7528\u54ea\u4e2a\u7528\u6237\u542f\u52a8\r\nredirect_stderr = true ; \u628a stderr \u91cd\u5b9a\u5411\u5230 stdout\uff0c\u9ed8\u8ba4 false\r\nstdout_logfile_maxbytes = 20MB ; stdout \u65e5\u5fd7\u6587\u4ef6\u5927\u5c0f\uff0c\u9ed8\u8ba4 50MB\r\nstdout_logfile_backups = 20 ; stdout \u65e5\u5fd7\u6587\u4ef6\u5907\u4efd\u6570\r\nstdout_logfile = \/var\/log\/frps_out.log ;\u65e5\u5fd7\u6587\u4ef6<\/pre>\n

5\u3001\u914d\u7f6e\u5ba2\u6237\u7aef\uff1a<\/h1>\n
[root@VM-16-100-centos frp_0.400]$ rm -rf frps frps_full.ini frps.ini\r\n\r\n[root@VM-16-100-centos frp_0.400]$ ll\r\ntotal 11M\r\n-rw-r--r-- 1 yyq yyq  12K Aug  3  2021 LICENSE\r\n-rw-r--r-- 1 yyq yyq  662 Oct 24 15:45 frp_service.conf\r\n-rwxr-xr-x 1 yyq yyq  11M Aug  3  2021 frpc\r\n-rw-r--r-- 1 yyq yyq  455 Mar  9 19:36 frpc.ini\r\n-rw-r--r-- 1 yyq yyq 9.3K Aug  3  2021 frpc_full.ini\r\n-rw-r--r-- 1 yyq yyq  635 Oct 24 15:45 reamemd.txt\r\ndrwxr-xr-x 2 yyq yyq 4.0K Aug  3  2021 systemd<\/pre>\n

[common]\u8868\u793a\u4ee5\u4e0b\u914d\u7f6e\u4fe1\u606f\u662f\u4e00\u4e9b\u516c\u7528\u914d\u7f6e\u4fe1\u606f<\/p>\n

<\/p>\n

server_addr\u662f\u6211\u4eec\u670d\u52a1\u7aef\u5373\u5916\u7f51\u670d\u52a1\u5668\u7684\u516c\u7f51\u8bbf\u95eeip<\/p>\n

server_port\u662f\u6211\u4eec\u524d\u9762\u5728\u670d\u52a1\u7aef\u914d\u7f6e\u7684frps.ini\u4e2dbind_port\u4e2d\u5bf9\u5e94\u7684\u7aef\u53e3\u3002\u9700\u4fdd\u6301\u4e24\u8fb9\u4e00\u81f4<\/p>\n

<\/p>\n

[ssh]\u8868\u793a\u4ee5\u4e0b\u914d\u7f6e\u4fe1\u606f\u662f\u6211\u4eec\u4f7f\u7528ssh\u8fde\u63a5\u5185\u7f51\u670d\u52a1\u5668\u65f6\u9700\u8981\u7684\u4e00\u4e9b\u914d\u7f6e\u4fe1\u606f<\/p>\n

<\/p>\n

type \u662f\u8fde\u63a5\u7c7b\u578b\uff0cssh\u65b9\u5f0f\u8fde\u63a5\u5c31\u7528tcp<\/p>\n

<\/p>\n

local_ip \u662f\u672c\u673aip,\u76f4\u63a5\u4f7f\u7528127.0.0.1\u5373\u53ef<\/p>\n

<\/p>\n

local_port \u662f\u672c\u5730ssh\u7aef\u53e3\uff0cssh\u9ed8\u8ba4\u7aef\u53e3\u4e3a22<\/p>\n

<\/p>\n

remote_port \u662f\u5916\u7f51\u670d\u52a1\u5668\u8bf7\u6c42\u8fc7\u6765\u7684\u7aef\u53e3 \u6ce8\uff1a\u963f\u91cc\u4e91\u670d\u52a1\u5668\u9700\u8981\u5728esc\u7ba1\u7406\u4e2d\u914d\u7f6e\u5b89\u5168\u7ec4\u89c4\u5219\u4e2d\u6dfb\u52a06000\u7aef\u53e3<\/p>\n

\u542f\u52a8\u5ba2\u6237\u7aef<\/h2>\n
.\/.frpc -c frpc.ini<\/pre>\n

6\u3001\u914d\u7f6esupervisor\u542f\u52a8\u5ba2\u6237\u7aef<\/h1>\n
[program:frpc]\r\ndirectory = \/opt\/frp_0.40.0\r\ncommand = \/opt\/frp_0.40.0\/frpc -c \/opt\/frp_0.40.0\/frpc.ini \r\nautostart = true ; \u5728 supervisord \u542f\u52a8\u7684\u65f6\u5019\u4e5f\u81ea\u52a8\u542f\u52a8\r\nstartsecs = 5 ; \u542f\u52a8 5 \u79d2\u540e\u6ca1\u6709\u5f02\u5e38\u9000\u51fa\uff0c\u5c31\u5f53\u4f5c\u5df2\u7ecf\u6b63\u5e38\u542f\u52a8\u4e86\r\nautorestart = true ; \u7a0b\u5e8f\u5f02\u5e38\u9000\u51fa\u540e\u81ea\u52a8\u91cd\u542f\r\nstartretries = 3 ; \u542f\u52a8\u5931\u8d25\u81ea\u52a8\u91cd\u8bd5\u6b21\u6570\uff0c\u9ed8\u8ba4\u662f 3\r\nuser = yyq ; \u7528\u54ea\u4e2a\u7528\u6237\u542f\u52a8\r\nredirect_stderr = true ; \u628a stderr \u91cd\u5b9a\u5411\u5230 stdout\uff0c\u9ed8\u8ba4 false\r\nstdout_logfile_maxbytes = 20MB ; stdout \u65e5\u5fd7\u6587\u4ef6\u5927\u5c0f\uff0c\u9ed8\u8ba4 50MB\r\nstdout_logfile_backups = 20 ; stdout \u65e5\u5fd7\u6587\u4ef6\u5907\u4efd\u6570\r\nstdout_logfile = \/var\/log\/frpc_out.log ;\u65e5\u5fd7\u6587\u4ef6<\/pre>\n

supervisor\u547d\u4ee4<\/h2>\n
supervisorctl update  \u66f4\u65b0\r\nsupervisorctl start frpc  \u542f\u52a8frpc\r\nsupervisorctl stop frpc  \u505c\u6b62 frpc\r\n\r\nsupervisorctl shutdown \u5173\u95edsupervisor<\/pre>\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6587\u7ae0\u76ee\u5f55 1\u3001\u4e0b\u8f7dfrp 2\u3001\u89e3\u538b 3\u3001\u914d\u7f6e\u670d\u52a1\u7aef \u4fee\u6539frps.ini \u542f\u52a8\u670d\u52a1\u7aef\uff1a 4\u3001\u914d\u7f6esupervi […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[140,139],"class_list":["post-1979","post","type-post","status-publish","format-standard","hentry","category-linux","tag-frp","tag-139"],"_links":{"self":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/1979"}],"collection":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/comments?post=1979"}],"version-history":[{"count":1,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/1979\/revisions"}],"predecessor-version":[{"id":1980,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/1979\/revisions\/1980"}],"wp:attachment":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/media?parent=1979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/categories?post=1979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/tags?post=1979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}