{"id":734,"date":"2020-08-13T23:02:47","date_gmt":"2020-08-13T15:02:47","guid":{"rendered":"https:\/\/www.iotch.xyz\/?p=734"},"modified":"2020-08-13T23:02:47","modified_gmt":"2020-08-13T15:02:47","slug":"frp%e5%90%8e%e5%8f%b0%e8%87%aa%e5%8a%a8%e5%90%af%e5%8a%a8%e7%9a%84%e5%87%a0%e4%b8%aa%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=734","title":{"rendered":"Frp\u540e\u53f0\u81ea\u52a8\u542f\u52a8\u7684\u51e0\u4e2a\u65b9\u6cd5"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\" id=\"1\u4f7f\u7528nohup\u6765\u542f\u52a8\">1\u4f7f\u7528nohup\u6765\u542f\u52a8<\/h3>\n\n\n\n<p>\u8fd9\u662ffrps\u7684\u540e\u53f0\u542f\u52a8\uff08\u8def\u5f84\u5199\u4f60\u670d\u52a1\u5668\u4e0a\u7684\u7edd\u5bf9\u8def\u5f84\uff09\uff0c\u5982\u679c\u8981\u67e5\u770b\u65e5\u5fd7\u7684\u8bdd\uff0c\u5c31\u76f4\u63a5\u4f7f\u7528<code>cat nohup.out<\/code>\uff0c\u5c31\u53ef\u4ee5\u67e5\u770b\u4e86\u3002<br><code><br>nohup \/path\/to\/your\/fprs -c-c \/path\/to\/your\/frps.ini<br><\/code><br>\u8fd9\u662ffrpc\u7684\u540e\u53f0\u542f\u52a8<br><code><br>nohup \/path\/to\/your\/fprc -c-c \/path\/to\/your\/frpc.ini<br><\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2\u4f7f\u7528systemctl\u6765\u63a7\u5236\u542f\u52a8\">2\u4f7f\u7528systemctl\u6765\u63a7\u5236\u542f\u52a8<\/h3>\n\n\n\n<p>\u8fd9\u4e2a\u65b9\u6cd5\u6bd4\u8f83\u597d\u7528\uff0c\u5f88\u65b9\u4fbf<br><code>sudo vim \/lib\/systemd\/system\/frps.service<\/code><br>\u5728frps.service\u91cc\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=fraps service\nAfter=network.target syslog.target\nWants=network.target\n\n&#91;Service]\nType=simple\n#\u542f\u52a8\u670d\u52a1\u7684\u547d\u4ee4\uff08\u6b64\u5904\u5199\u4f60\u7684frps\u7684\u5b9e\u9645\u5b89\u88c5\u76ee\u5f55\uff09\nExecStart=\/your\/path\/frps -c \/your\/path\/frps.ini\n\n&#91;Install]\nWantedBy=multi-user.target\n<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u5c31\u542f\u52a8frps<br><code>sudo systemctl start frps<\/code><br>\u518d\u6253\u5f00\u81ea\u542f\u52a8<br><code>sudo systemctl enable frps<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5982\u679c\u8981\u91cd\u542f\u5e94\u7528\uff0c\u53ef\u4ee5\u8fd9\u6837\uff0c<code>sudo systemctl restart frps<\/code><\/li><li>\u5982\u679c\u8981\u505c\u6b62\u5e94\u7528\uff0c\u53ef\u4ee5\u8f93\u5165\uff0c<code>sudo systemctl stop frps<\/code><\/li><li>\u5982\u679c\u8981\u67e5\u770b\u5e94\u7528\u7684\u65e5\u5fd7\uff0c\u53ef\u4ee5\u8f93\u5165\uff0c<code>sudo systemctl status frps<\/code><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3\u4f7f\u7528supervisor\u6765\u63a7\u5236\">3\u4f7f\u7528supervisor\u6765\u63a7\u5236<\/h3>\n\n\n\n<p>\u9996\u5148\u5148\u5b89\u88c5supervisor\uff0c\u6211\u7528\u7684ubuntu<br><code>sudo apt install supervisor<\/code><br>\u521b\u5efa supervisor frps \u914d\u7f6e\u6587\u4ef6,\u5728 \/etc\/supervisor\/conf.d \u521b\u5efa frp.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;program:frp]\ncommand = \/your\/path\/frps -c \/your\/path\/frps.ini\nautostart = true\n<\/code><\/pre>\n\n\n\n<p>\u540c\u6837\u662f\u4f60\u7684\u7edd\u5bf9\u8def\u5f84\u3002<br>\u5199\u5b8c\u4ee5\u540e\uff0c\u8981\u91cd\u65b0\u52a0\u8f7d\u4e00\u4e0bsupervisor<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u91cd\u542fsupervisor\nsudo systemctl restart supervisor\n# \u67e5\u770bsupervisor\u8fd0\u884c\u72b6\u6001\nsudo supervisorctl status\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u591a\u8bf4\u4e00\u53e5\uff0c\u8fd9\u662f\u5199\u7684frps\u7684\u540e\u53f0\u542f\u52a8\uff0cfrpc\u7684\u8bdd\uff0c\u7c7b\u6bd4\u4e00\u4e0b\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<button class=\"simplefavorite-button\" data-postid=\"734\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>1\u4f7f\u7528nohup\u6765\u542f\u52a8 \u8fd9\u662ffrps\u7684\u540e\u53f0\u542f\u52a8\uff08\u8def\u5f84\u5199\u4f60\u670d\u52a1\u5668\u4e0a\u7684\u7edd\u5bf9\u8def\u5f84\uff09\uff0c\u5982\u679c\u8981\u67e5\u770b\u65e5\u5fd7\u7684\u8bdd\uff0c\u5c31\u76f4\u63a5\u4f7f\u7528cat nohup.o &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,9,11],"tags":[],"class_list":["post-734","post","type-post","status-publish","format-standard","hentry","category-8","category-9","category-11"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=734"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/734\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}