{"id":148893,"date":"2019-07-04T08:00:02","date_gmt":"2019-07-04T00:00:02","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=148893"},"modified":"2019-06-24T09:12:48","modified_gmt":"2019-06-24T01:12:48","slug":"apache-web-content","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/apache-web-content.html","title":{"rendered":"\u81ea\u5b9a\u4e49Apache Web\u670d\u52a1\u7684\u9996\u9875\u5185\u5bb9"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u7f16\u5199index.html\u6587\u4ef6\uff0c\u81ea\u5b9a\u4e49Apache Web\u670d\u52a1\u7684\u9996\u9875\u5185\u5bb9\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
1. \u5b89\u88c5Apache<\/strong><\/div>\n
[root@localhost ~]# yum install -y httpd\r\n<\/pre>\n
2. \u4fee\u6539\/etc\/httpd\/conf\/httpd.conf\u914d\u7f6e\u6587\u4ef6<\/strong><\/div>\n
[root@localhost ~]# vim \/etc\/httpd\/conf\/httpd.conf\r\n\u5728 vim \u4e2d\uff0c\u5feb\u901f\u5b9a\u4f4d\u5230 \u7b2c 95\u884c\r\n\u547d\u4ee4\u6a21\u5f0f\u4e0b \u8f93\u5165 :95\r\n\u4fee\u6539\u4e3a\u4ee5\u4e0b\u5f62\u5f0f\u3002\u8bb0\u5f97\u53bb\u6389 # \u53f7\r\n\r\nServerName 192.168.XX.XX:80\r\n\r\n: wq \u4fdd\u5b58\u9000\u51fa\r\n<\/pre>\n
3. \u542f\u52a8web\u670d\u52a1<\/strong><\/div>\n
[root@localhost ~]# systemctl start httpd\r\n[root@localhost ~]# netstat -ntl #\u786e\u8ba480\u7aef\u53e3\u5df2\u542f\u7528\r\nActive Internet connections (only servers)\r\nProto Recv-Q Send-Q Local Address Foreign Address State\r\ntcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN\r\ntcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN\r\ntcp6 0 0 :::80 :::* LISTEN\r\ntcp6 0 0 :::22 :::* LISTEN\r\ntcp6 0 0 ::1:25 :::* LISTEN\r\n<\/pre>\n
4. \u68c0\u67e5Apache Web\u670d\u52a1\u662f\u5426\u6b63\u5e38<\/strong><\/div>\n
[root@localhost ~]# cd \/var\/www\/html\/\r\n[root@localhost html]# ls\r\n[root@localhost html]# iptables -F\r\n[root@localhost html]# ifconfig\r\nens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500\r\ninet 192.168.10.11 netmask 255.255.255.0 broadcast 192.168.10.255\r\ninet6 fe80::20c:29ff:feda:182e prefixlen 64 scopeid 0x20 ether 00:0c:29:da:18:2e txqueuelen 1000 (Ethernet)\r\nRX packets 930 bytes 77097 (75.2 KiB)\r\nRX errors 0 dropped 0 overruns 0 frame 0\r\nTX packets 575 bytes 77429 (75.6 KiB)\r\nTX errors 0 dropped 0 overruns 0 carrier 0 collisions 0\r\n\r\nlo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536\r\ninet 127.0.0.1 netmask 255.0.0.0\r\ninet6 ::1 prefixlen 128 scopeid 0x10\r\nloop txqueuelen 1 (Local Loopback)\r\nRX packets 88 bytes 7484 (7.3 KiB)\r\nRX errors 0 dropped 0 overruns 0 frame 0\r\nTX packets 88 bytes 7484 (7.3 KiB)\r\nTX errors 0 dropped 0 overruns 0 carrier 0 collisions 0\r\n<\/pre>\n

\u5728\u6d4f\u89c8\u5668\u8f93\u5165192.168.10.11\uff0c\u51fa\u73b0\u4ee5\u4e0b\u754c\u9762\uff0c\u8bf4\u660eApache Web\u670d\u52a1\u6b63\u5e38\u3002<\/p>\n

\"\"<\/p>\n

5. \u81ea\u5b9a\u4e49\u9996\u9875\u6587\u4ef6<\/strong><\/div>\n
\r\n[root@localhost html]# pwd\r\n\/var\/www\/html\r\n[root@localhost html]# vim index.html\r\n\"\"\r\n[root@localhost html]# systemctl restart httpd\r\n<\/pre>\n

\u5728\u6d4f\u89c8\u5668\u8f93\u5165192.168.10.11\uff0c\u51fa\u73b0\u4ee5\u4e0b\u754c\u9762\uff0c\u8bf4\u660e\u81ea\u5b9a\u4e49\u9996\u9875\u6587\u4ef6\u751f\u6548\u3002<\/p>\n

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

[root@localhost ~]# yum install -y httpd [root@localhos […]<\/p>\n","protected":false},"author":63,"featured_media":148896,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-148893","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\/148893","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=148893"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/148893\/revisions"}],"predecessor-version":[{"id":148933,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/148893\/revisions\/148933"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/148896"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=148893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=148893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=148893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}