{"id":285,"date":"2017-10-29T22:06:50","date_gmt":"2017-10-29T14:06:50","guid":{"rendered":"https:\/\/blog.lovexu.cc:3138\/?p=285"},"modified":"2022-09-17T12:02:50","modified_gmt":"2022-09-17T04:02:50","slug":"linux-vps%e9%98%b2%e7%81%ab%e5%a2%99%e5%bc%80%e6%94%be%e6%8c%87%e5%ae%9a%e7%ab%af%e5%8f%a3","status":"publish","type":"post","link":"https:\/\/lox.im\/index.php\/285.html","title":{"rendered":"linux vps\u9632\u706b\u5899\u5f00\u653e\u6307\u5b9a\u7aef\u53e3"},"content":{"rendered":"<header class=\"entry-header\"><\/header>\n<div class=\"entry-content\">\n<div class=\"single-cat-tag\">\n<div class=\"single-cat\">ftp\u9ed8\u8ba4\u7aef\u53e3\u662f21 ssh\u9ed8\u8ba4\u7aef\u53e3\u662f22 MySQL\u9ed8\u8ba4\u7aef\u53e3\u662f3306 web\u9ed8\u8ba4\u662f80 \u8fd9\u4e9b\u7aef\u53e3\u90fd\u662f\u9ed8\u8ba4\u5f00\u653e\u7684\uff1b<\/div>\n<\/div>\n<div class=\"single-content\">\n<p>\u6267\u884c\u67d0\u4e9b\u7279\u5b9a\u4efb\u52a1\u65f6\uff0c\u4f1a\u9700\u8981\u6539\u53d8\u7aef\u53e3\uff0c\u5728\u9632\u706b\u5899\u4e0a\u5f00\u653e\u4e00\u4e2a\u65b0\u7684\u7aef\u53e3\u8ba9\u6570\u636e\u901a\u8fc7\uff1b<br \/>\n<a title=\"\u67e5\u770b\u4e0e linux \u76f8\u5173\u7684\u6587\u7ae0\" href=\"https:\/\/www.5yun.org\/tag\/linux\/\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\" >linux<\/a> \u670d\u52a1\u5668\u4e0a \u6211\u7528\u7684\u6700\u591a\u7684\u662fCentos\u7248\u672c\uff0c\u521a\u521a\u67e5\u4e86\u4e9b\u8d44\u6599\u5728\u56fd\u5916\u670d\u52a1\u5668\u4e0a\u6d4b\u8bd5\u4e86\u4e0b\u5f00\u653e\u4e86\u4e2a3308\u7aef\u53e3\uff1b<\/p>\n<h2>CentOS \u9632\u706b\u5899\u5f00\u542f80\/22\u7aef\u53e3<\/h2>\n<p>vi \/etc\/sysconfig\/iptables<br \/>\n-A INPUT -m state \u00a0\u2212\u2013state NEW -m tcp -p tcp \u00a0\u2212\u2013dport 80 -j ACCEPT\uff08\u5141\u8bb880\u7aef\u53e3\u901a\u8fc7\u9632\u706b\u5899\uff09<br \/>\n-A INPUT -m state \u00a0\u2212\u2013state NEW -m tcp -p tcp \u00a0\u2212\u2013dport 3306 -j ACCEPT\uff08\u5141\u8bb83306\u7aef\u53e3\u901a\u8fc7\u9632\u706b\u5899\uff09<br \/>\n\u7279\u522b\u63d0\u793a\uff1a\u5f88\u591a\u7f51\u53cb\u628a\u8fd9\u4e24\u6761\u89c4\u5219\u6dfb\u52a0\u5230\u9632\u706b\u5899\u914d\u7f6e\u7684\u6700\u540e\u4e00\u884c\uff0c\u5bfc\u81f4\u9632\u706b\u5899\u542f\u52a8\u5931\u8d25\uff0c\u6b63\u786e\u7684\u5e94\u8be5\u662f\u6dfb\u52a0\u5230\u9ed8\u8ba4\u768422\u7aef\u53e3\u8fd9\u6761\u89c4\u5219\u7684\u4e0b\u9762<\/p>\n<p>\/etc\/init.d\/iptables status<br \/>\n\u67e5\u770b\u9632\u706b\u5899\u4fe1\u606f\uff0c\u786e\u8ba422 80\u7aef\u53e3\u662f\u5426\u88ab\u6253\u5f00<\/p>\n<p>\/etc\/rc.d\/init.d\/iptables save<br \/>\n\u4fdd\u5b58\u9632\u706b\u5899\u64cd\u4f5c\u89c4\u5219<\/p>\n<p>service iptables restart<br \/>\n\u9632\u706b\u5899\u91cd\u542f\u91cd\u65b0\u52a0\u8f7d\uff0c\u6267\u884c\u65b0\u7684\u7aef\u53e3\u89c4\u5219\uff1b<\/p>\n<p>------------------\u989d\u5916\u9644\u52a0\u547d\u4ee4--------------------------<br \/>\n\u5173\u95ed\u9632\u706b\u5899\u670d\u52a1<br \/>\n\/etc\/init.d\/iptables stop<\/p>\n<p>\u6c38\u4e45\u5173\u95ed\u9632\u706b\u5899<br \/>\nchkconfig \u2013level 35 iptables off<\/p>\n<h2>\u9644\u4e0a\u64cd\u4f5c\u65e5\u5fd7\uff1a<\/h2>\n<div id=\"crayon-59f5df61d7a29611754461\" class=\"crayon-syntax crayon-theme-github crayon-font-consolas crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-plain-wrap\">\n<div id=\"crayon-59f5df61d7a29611754461-1\" class=\"crayon-line\">\n<pre class=\"lang:default decode:true \"><code>[root@default ~]# \/sbin\/iptables -I INPUT -p tcp --dport 3308 -j ACCEPT\r\n[root@default ~]# \/etc\/init.d\/iptables status\r\nTable: raw\r\nChain PREROUTING (policy ACCEPT)\r\nnum target prot opt source destination\r\nChain OUTPUT (policy ACCEPT)\r\nnum target prot opt source destination\r\nTable: nat\r\nChain PREROUTING (policy ACCEPT)\r\nnum target prot opt source destination\r\nChain POSTROUTING (policy ACCEPT)\r\nnum target prot opt source destination\r\nChain OUTPUT (policy ACCEPT)\r\nnum target prot opt source destination\r\nTable: mangle\r\nChain PREROUTING (policy ACCEPT)\r\nnum target prot opt source destination\r\nChain INPUT (policy ACCEPT)\r\nnum target prot opt source destination\r\nChain FORWARD (policy ACCEPT)\r\nnum target prot opt source destination\r\nChain OUTPUT (policy ACCEPT)\r\nnum target prot opt source destination\r\nChain POSTROUTING (policy ACCEPT)\r\nnum target prot opt source destination\r\nTable: filter\r\nChain INPUT (policy ACCEPT)\r\nnum target prot opt source destination\r\n1 ACCEPT tcp -- 0.0.0.0\/0 0.0.0.0\/0 tcp dpt:3308\r\nChain FORWARD (policy ACCEPT)\r\nnum target prot opt source destination\r\nChain OUTPUT (policy ACCEPT)\r\nnum target prot opt source destination\r\n[root@default ~]# \/etc\/rc.d\/init.d\/iptables save\r\niptables: Saving firewall rules to \/etc\/sysconfig\/iptables:[ OK ]\r\n[root@default ~]# service iptables restart\r\niptables: Setting chains to policy ACCEPT: raw nat mangle f[ OK ]\r\niptables: Flushing firewall rules: [ OK ]\r\niptables: Unloading modules: [ OK ]\r\niptables: Applying firewall rules: [ OK ]\r\n[root@default ~]#<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-293\" src=\"https:\/\/lox.im\/wp-content\/uploads\/2017\/10\/1-35-1024x683.jpg\" alt=\"\" width=\"1024\" height=\"683\" srcset=\"https:\/\/lox.im\/wp-content\/uploads\/2017\/10\/1-35-1024x683.jpg 1024w, https:\/\/lox.im\/wp-content\/uploads\/2017\/10\/1-35-300x200.jpg 300w, https:\/\/lox.im\/wp-content\/uploads\/2017\/10\/1-35-768x512.jpg 768w, https:\/\/lox.im\/wp-content\/uploads\/2017\/10\/1-35-750x500.jpg 750w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ftp\u9ed8\u8ba4\u7aef\u53e3\u662f21 ssh\u9ed8\u8ba4\u7aef\u53e3\u662f22 MySQL\u9ed8\u8ba4\u7aef\u53e3\u662f3306 web\u9ed8\u8ba4\u662f80 \u8fd9\u4e9b\u7aef\u53e3\u90fd\u662f\u9ed8\u8ba4\u5f00\u653e\u7684\uff1b \u6267\u884c\u67d0\u4e9b\u7279\u5b9a &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[4],"tags":[11],"class_list":["post-285","post","type-post","status-publish","format-standard","hentry","category-internet","tag-11"],"_links":{"self":[{"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/posts\/285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/comments?post=285"}],"version-history":[{"count":2,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/posts\/285\/revisions"}],"predecessor-version":[{"id":788,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/posts\/285\/revisions\/788"}],"wp:attachment":[{"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/media?parent=285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/categories?post=285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lox.im\/index.php\/wp-json\/wp\/v2\/tags?post=285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}