{"id":113385,"date":"2018-08-06T08:09:00","date_gmt":"2018-08-06T00:09:00","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=113385"},"modified":"2018-07-30T09:13:02","modified_gmt":"2018-07-30T01:13:02","slug":"fedora-28-server-lnmp","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/fedora-28-server-lnmp.html","title":{"rendered":"Fedora 28 server web \u65e0\u6cd5\u8bbf\u95ee\u4e4b\u914d\u7f6e\u9632\u706b\u5899"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u521a\u5b89\u88c5\u5b8c Lnmp \u8bbf\u95ee\u6b63\u5e38\uff0c\u91cd\u542f Fedora 28 \u7cfb\u7edf\u4e4b\u540e\uff0c\u53d1\u73b0web\u65e0\u6cd5\u8bbf\u95ee\u4e86\uff0c\u91cd\u542f lnmp \u4e00\u5207\u6b63\u5e38\uff0c\u6240\u6709\u670d\u52a1\u90fd\u662f\u8fd0\u884c\u72b6\u6001\uff0c\u7f51\u4e0a\u67e5\u4e86\u4e00\u4e0b\uff0c\u6000\u7591\u662f\u9632\u706b\u5899\u95ee\u9898\uff0c\u5173\u95ediptables\uff0c\u539f\u6765Fedora\u670d\u52a1\u5668\u7248\u672c\u91cc\u9762\u7684\u9632\u706b\u5899\u539f\u6765\u662ffirewall\uff0c\u5173\u95ed\u4e4b\u540e\u6b63\u5e38\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5173\u95edfirewall\u547d\u4ee4\uff1a<\/p>\n

systemctl stop firewalld.service<\/pre>\n

\u518d\u6b21\u8bbf\u95eeWEB\u670d\u52a1\uff0c\u6b63\u5e38\u5de5\u4f5c\u4e86\u3002<\/p>\n

Fedora28\uff0c\u65e0\u6cd5\u4f7f\u7528iptables\u63a7\u5236Linuxs\u7684\u7aef\u53e3\uff0c\u800c\u4f7f\u7528firewalld\u4ee3\u66ff\u4e86\u539f\u6765\u7684iptables\u3002\u4e0b\u9762\u8bb0\u5f55\u5982\u4f55\u4f7f\u7528firewalld\u5f00\u653eLinux\u7aef\u53e3,\u5f00\u542f\u7aef\u53e3\uff1a<\/p>\n

firewall-cmd --zone=public --add-port=80\/tcp --permanent<\/pre>\n

\u547d\u4ee4\u542b\u4e49\uff1a<\/p>\n

\r\n\u2013zone #\u4f5c\u7528\u57df\r\n\u2013add-port=80\/tcp #\u6dfb\u52a0\u7aef\u53e3\uff0c\u683c\u5f0f\u4e3a\uff1a\u7aef\u53e3\/\u901a\u8baf\u534f\u8bae\r\n\u2013permanent #\u6c38\u4e45\u751f\u6548\uff0c\u6ca1\u6709\u6b64\u53c2\u6570\u91cd\u542f\u540e\u5931\u6548\r\n<\/pre>\n

\u91cd\u542f\u9632\u706b\u5899<\/p>\n

firewall-cmd --reload<\/pre>\n

\u6587\u4e2d\u672c\u662f\u5df2\u589e\u52a0\u4e8680\u7aef\u53e3\u53ea\u662f\u6ca1\u6709\u8fdb\u884c\u91cd\u542f\uff0c\u7ecf\u8fc7\u4e00\u6b21\u505c\u7528\u548c\u542f\u7528\uff0c\u9632\u706b\u5899\u7684\u8bbe\u7f6e\u751f\u6548\u3002
\n\u8be6\u7ec6\u4fe1\u606f\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u8d44\u6599\uff1a<\/p>\n

http:\/\/stackoverflow.com\/questions\/24729024\/centos-7-open-firewall-port<\/p>\n

https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/7\/html\/Security_Guide\/sec-Using_Firewalls.html<\/p>\n

\u5982\u679c\u8fd8\u662f\u4e0d\u884c\u53ea\u8981\u5378\u8f7dfirewall\uff0c\u5b89\u88c5iptables\u5c31\u53ef\u4ee5\u4e86\u3002<\/strong><\/p>\n

yum remove firewall<\/pre>\n

\u5b89\u88c5 iptables\uff1a<\/p>\n

yum install iptables-services<\/pre>\n

\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

vi \/etc\/sysconfig\/iptables<\/pre>\n

\u6dfb\u52a0\u4e0b\u9762\u4e24\u884c<\/p>\n

-A INPUT -m state \u2013state NEW -m tcp -p tcp \u2013dport 80 -j ACCEPT\uff08\u5141\u8bb880\u7aef\u53e3\u901a\u8fc7\u9632\u706b\u5899\uff09\r\n-A INPUT -m state \u2013state NEW -m tcp -p tcp \u2013dport 3306 -j ACCEPT\uff08\u5141\u8bb83306\u7aef\u53e3\u901a\u8fc7\u9632\u706b\u5899\uff09<\/pre>\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

\u6dfb\u52a0\u597d\u4e4b\u540e\u9632\u706b\u5899\u89c4\u5219\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

\r\n# Firewall configuration written by system-config-firewall\r\n# Manual customization of this file is not recommended.\r\n*filter\r\n:INPUT ACCEPT [0:0]\r\n:FORWARD ACCEPT [0:0]\r\n:OUTPUT ACCEPT [0:0]\r\n-A INPUT -m state \u2013state ESTABLISHED,RELATED -j ACCEPT\r\n-A INPUT -p icmp -j ACCEPT\r\n-A INPUT -i lo -j ACCEPT\r\n-A INPUT -m state \u2013state NEW -m tcp -p tcp \u2013dport 22 -j ACCEPT\r\n-A INPUT -m state \u2013state NEW -m tcp -p tcp \u2013dport 80 -j ACCEPT\r\n-A INPUT -m state \u2013state NEW -m tcp -p tcp \u2013dport 3306 -j ACCEPT\r\n-A INPUT -j REJECT \u2013reject-with icmp-host-prohibited\r\n-A FORWARD -j REJECT \u2013reject-with icmp-host-prohibited\r\nCOMMIT\r\n<\/pre>\n

\u91cd\u542f\u670d\u52a1\uff1a<\/p>\n

systemctl restart iptables.service<\/pre>\n

\u8ddf\u968f\u7cfb\u7edf\u542f\u52a8\uff1a<\/p>\n

systemctl enable iptables.service<\/pre>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/imcn.me\/html\/y2018\/33619.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/fedora-28-server-lnmp.html<\/a>\u7f16\u8f91\uff1a\u502a\u5bb6\u5174\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u521a\u5b89\u88c5\u5b8c Lnmp \u8bbf\u95ee\u6b63\u5e38\uff0c\u91cd\u542f Fedora 28 \u7cfb\u7edf\u4e4b\u540e\uff0c\u53d1\u73b0web\u65e0\u6cd5\u8bbf\u95ee\u4e86\uff0c\u91cd\u542f lnmp […]<\/p>\n","protected":false},"author":362,"featured_media":113392,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-113385","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/113385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=113385"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/113385\/revisions"}],"predecessor-version":[{"id":113979,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/113385\/revisions\/113979"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/113392"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=113385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=113385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=113385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}