{"id":744,"date":"2013-12-23T15:56:13","date_gmt":"2013-12-23T07:56:13","guid":{"rendered":"http:\/\/101.37.83.176\/?p=744"},"modified":"2022-09-07T14:36:56","modified_gmt":"2022-09-07T06:36:56","slug":"lamp","status":"publish","type":"post","link":"http:\/\/101.37.83.176\/?p=744","title":{"rendered":"\u963f\u91cc\u4e91\u670d\u52a1\u5668\u642d\u5efaLAMP\u73af\u5883"},"content":{"rendered":"<p>\u00a9 Written by <a href=\"http:\/\/101.37.83.176\/?page_id=2\" target=\"_blank\" rel=\"noopener\"><span style=\"color: #0066cc;\">J.Y. WANG<\/span><\/a><\/p>\n<p>#\u4ee5\u4e0b\u5185\u5bb920180101\u8fdb\u884c\u4e86\u66f4\u65b0\u3002<\/p>\n<p>#\u67e5\u770b\u6570\u636e\u76d8\u662f\u5426\u5206\u533a\u683c\u5f0f\u5316<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">lsblk<\/pre>\n<p>#\u5bf9\u6570\u636e\u76d8\u5206\u533a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">fdisk \/dev\/vdb\r\nn\r\np\r\n1\r\nwq<\/pre>\n<p>#\u5bf9\u6570\u636e\u76d8\u683c\u5f0f\u5316<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">mkfs.ext4 \/dev\/vdb1<\/pre>\n<p>#\u67e5\u770b\u6302\u8f7d\u60c5\u51b5<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">df -ahT<\/pre>\n<p>#\u5efa\u7acb\u6302\u8f7d\u76ee\u5f55<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">mkdir \/var\/www<\/pre>\n<p>#\u6dfb\u52a0\u542f\u52a8\u6302\u8f7d<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">echo '\/dev\/xvdb1 \/var\/www ext4 defaults 0 0 \/etc\/fstab<\/pre>\n<p>#\u6302\u8f7d\u5206\u533a<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">mount -a<\/pre>\n<p>#\u66f4\u65b0<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">yum -y update<\/pre>\n<p>#\u5b89\u88c5LAMP<br \/>\n#\uff08\u5982\u679c\u4f7f\u7528RDS\u53ef\u4ee5\u4e0d\u88c5mysql mysql-server\uff09<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">yum install httpd php php-mysql php-gd php-mbstring php-mcrypt mysql mysql-server<\/pre>\n<p># \u5b89\u88c5\u7684\u6a21\u5757\u7b80\u4ecb<br \/>\n# httpd\uff08\u63d0\u4f9bApache\u4e3b\u7a0b\u5e8f\uff09<br \/>\n# php\uff08PHP\u4e3b\u7a0b\u5e8f\u542b\u7ed9Apache\u4f7f\u7528\u7684\u6a21\u5757\uff09<br \/>\n# php-mysql\uff08\u63d0\u4f9b\u7ed9PHP\u7a0b\u5e8f\u8bfb\u53d6MySQL\u8d44\u6599\u5e93\u7684\u6a21\u5757\uff09<br \/>\n# php-gd (php\u5904\u7406\u56fe\u5f62\u6269\u5c55\u5e93)<br \/>\n# php-mbstring\uff08PHP\u7684\u591a\u5b57\u8282\u5b57\u7b26\u5904\u7406\u6a21\u5757\uff09<br \/>\n# php-mcrypt\uff08php\u7684\u52a0\u5bc6\u652f\u6301\u6269\u5c55\u5e93\uff09<br \/>\n# php-devel \uff08\u5efa\u6784PHP\u6269\u5c55\u6240\u9700\u7684\u6587\u4ef6\uff09<br \/>\n# mysql\uff08MySQL\u5ba2\u6237\u7aef\u7a0b\u5e8f\uff0c\u82e5\u4f7f\u7528RDS\u53ef\u4e0d\u88c5\uff09<br \/>\n# mysql-server\uff08MySQL\u670d\u52a1\u5668\u7a0b\u5e8f\uff0c\u82e5\u4f7f\u7528RDS\u53ef\u4e0d\u88c5\uff09<\/p>\n<p>#\u914d\u7f6eApache<br \/>\n\/etc\/httpd\/conf\/httpd.conf<br \/>\n#\u914d\u7f6e\u65b9\u6cd5\u8bf7\u53c2\u89c1<a href=\"http:\/\/linux.vbird.org\/linux_server\/0360apache.php\" target=\"_blank\" rel=\"noopener\">\u9e1f\u54e5\u7684Linux\u79c1\u623f\u83dc<\/a><\/p>\n<p>#\u542f\u52a8\u670d\u52a1(\u9002\u7528\u4e8eCentos 7)<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">systemctl start httpd.service\r\nsystemctl enable httpd.service<\/pre>\n<p>#\u82e5\u4f7f\u7528RDS\u5219\u65e0\u9700\u542f\u52a8\u548c\u521d\u59cb\u5316mysql<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">systemctl start mysqld.service\r\nsystemctl enable mysqld.service\r\n#mysql\u521d\u59cb\u5316\r\n\/usr\/bin\/mysql_secure_installation<\/pre>\n<p>#\u67e5\u770bhttpd\u768480\u7aef\u53e3\u548cmysql\u76843306\u7aef\u53e3\u662f\u5426\u6210\u529f\u542f\u52a8<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">netstat -nat<\/pre>\n<p>#\u9996\u5148\u8bbe\u5b9a\u7f51\u7ad9\u76ee\u5f55\u548c\u6587\u4ef6\u7684\u6240\u6709\u8005\u548c\u6240\u6709\u7ec4\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">chown -R root:apache \/var\/www\r\ncd \/var\/www<\/pre>\n<p>#\u8bbe\u7f6e\u7f51\u7ad9\u76ee\u5f55\u6743\u9650\u4e3a750\uff0c\u53ea\u6709root\u7528\u6237\u5bf9\u76ee\u5f55\u62e5\u6709\u8bfb\u5199\u6267\u884c\u7684\u6743\u9650\uff0c\u7528\u6237\u7ec4\u6709\u8bfb\u6267\u884c\u6743\u9650\uff0c\u5176\u5b83\u7528\u6237\u6ca1\u6709\u4efb\u4f55\u6743\u9650\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">find -type d -exec chmod 750 {} \\;<\/pre>\n<p>#\u8bbe\u7f6e\u7f51\u7ad9\u6587\u4ef6\u6743\u9650\u4e3a640\uff0c\u53ea\u6709root\u7528\u6237\u5bf9\u7f51\u7ad9\u6587\u4ef6\u6709\u66f4\u6539\u7684\u6743\u9650\uff0chttp\u670d\u52a1\u5668\u53ea\u6709\u8bfb\u53d6\u6587\u4ef6\u7684\u6743\u9650\uff0c\u5176\u5b83\u7528\u6237\u65e0\u4efb\u4f55\u6743\u9650\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">find -not -type d -exec chmod 640 {} \\;<\/pre>\n<p>#\u9488\u5bf9wordpress\u76ee\u5f55\u8bbe\u7f6e\u6240\u6709\u8005\u548c\u6240\u6709\u7ec4\u6743\u9650\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">chown -R apache:apache \/var\/www\/html<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u963f\u91cc\u4e91\u670d\u52a1\u5668\u642d\u5efaLAMP\u73af\u5883\u3002<\/p>\n","protected":false},"author":1,"featured_media":4415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[71],"tags":[74,119,75],"class_list":["post-744","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lamp","tag-lamp","tag-linux","tag-aliyun"],"_links":{"self":[{"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/posts\/744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=744"}],"version-history":[{"count":0,"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/posts\/744\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/media\/4415"}],"wp:attachment":[{"href":"http:\/\/101.37.83.176\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=744"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}