{"id":74,"date":"2020-03-22T21:46:18","date_gmt":"2020-03-22T13:46:18","guid":{"rendered":"http:\/\/iotch.xyz\/?p=74"},"modified":"2020-03-22T21:46:18","modified_gmt":"2020-03-22T13:46:18","slug":"ubuntu%e4%b8%8b%e6%90%ad%e5%bb%ba%e4%b8%aa%e4%ba%ba%e5%8d%9a%e5%ae%a2wordpress","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=74","title":{"rendered":"Ubuntu\u4e0b\u642d\u5efa\u4e2a\u4eba\u535a\u5ba2WordPress"},"content":{"rendered":"\n<p class=\"has-text-color has-vivid-red-color\"><a href=\"https:\/\/blog.csdn.net\/qq_43645472\/article\/details\/97165582?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2&amp;utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/blog.csdn.net\/qq_43645472\/article\/details\/97165582?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2&amp;utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2<\/a><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u51c6\u5907LAMP\u73af\u5883<br>LAMP \u662f Linux\u3001Apache\u3001MySQL \u548c PHP \u7684\u7f29\u5199\uff0c\u662f WordPress \u7cfb\u7edf\u4f9d\u8d56\u7684\u57fa\u7840\u8fd0\u884c\u73af\u5883\u3002\u6211\u4eec\u5148\u6765\u51c6\u5907 LAMP \u73af\u5883\uff1a<\/li><\/ol>\n\n\n\n<p>\u5b89\u88c5 Apache2<\/p>\n\n\n\n<p>sudo apt-get install apache2 -y<br><\/p>\n\n\n\n<p>\u5b89\u88c5 PHP \u7ec4\u4ef6<\/p>\n\n\n\n<p>sudo apt-get install php7.0 -y<br><\/p>\n\n\n\n<p>\u5b89\u88c5php\u76f8\u5173\u7ec4\u4ef6<\/p>\n\n\n\n<p>sudo apt-get install libapache2-mod-php7.0<br><\/p>\n\n\n\n<p>\u5b89\u88c5Mysql\u670d\u52a1<\/p>\n\n\n\n<p>sudo apt-get install mysql-server -y<br><\/p>\n\n\n\n<p>php MySQL\u76f8\u5173\u7ec4\u4ef6<\/p>\n\n\n\n<p>sudo apt-get install php7.0-mysql<br><\/p>\n\n\n\n<p>\u5b89\u88c5 phpmyadmin<br>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u60a8\u9700\u8981\u6839\u636e\u63d0\u793a\u9009\u62e9 apache2 \uff0c\u518d\u8f93\u5165root\u5bc6\u7801 \u548c\u6570\u636e\u5e93\u5bc6\u7801\uff1a<\/p>\n\n\n\n<p>sudo apt-get install phpmyadmin -y<br><br>sudo ln -s \/usr\/share\/phpmyadmin \/var\/www\/html\/phpmyadmin #\u5efa\u7acb \/var\/www\/html \u4e0b\u7684\u8f6f\u8fde\u63a5\uff1a<br><br>sudo service mysql restart #\u91cd\u542f MySQL \u670d\u52a1<br><br>sudo systemctl restart apache2.service #\u91cd\u542f Apache \u670d\u52a1<br><br>2.\u5b89\u88c5\u5e76\u914d\u7f6eWordpress<br>\u5b89\u88c5 WordPress<\/p>\n\n\n\n<p>\u4e0b\u8f7d\u4e00\u4e2a WordPress \u538b\u7f29\u5305\uff1a(\u7248\u672c\u968f\u610f\uff0c\u60f3\u7528\u6700\u65b0\u7248\u7684\u53ef\u4ee5\u53bb\u5b98\u7f51\u4e0b\u8f7d\uff0c\u8fd9\u91cc\u7528\u7684\u662f4.7\u7248\u672c)<\/p>\n\n\n\n<p>wget https:\/\/cn.wordpress.org\/wordpress-4.7.4-zh_CN.zip<br><\/p>\n\n\n\n<p>\u89e3\u538b\u8fd9\u4e2a\u538b\u7f29\u5305<\/p>\n\n\n\n<p>sudo unzip wordpress-4.7.4-zh_CN.zip<br><br>\u4e3a wordpress \u914d\u7f6e\u4e00\u4e2a\u6570\u636e\u5e93<\/p>\n\n\n\n<p>\u8fdb\u5165 mysql\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u540e\uff0c\u6309\u63d0\u793a\u8f93\u5165\u60a8MySQL\u5bc6\u7801:<\/p>\n\n\n\n<p>mysql -u root -p<br><\/p>\n\n\n\n<p>\u4e3a wordpress \u521b\u5efa\u4e00\u4e2a\u53ebworkpress\u7684\u6570\u636e\u5e93\uff1a<\/p>\n\n\n\n<p>CREATE DATABASE workpress;<br><\/p>\n\n\n\n<p>\u4e3a \u8fd9\u4e2a\u6570\u636e\u5e93\u8bbe\u7f6e\u4e00\u4e2a\u7528\u6237\u4e3a workpressuser\uff1a<\/p>\n\n\n\n<p>CREATE USER workpressuser;<br><\/p>\n\n\n\n<p>\u4e3a\u8fd9\u4e2a\u7528\u6237\u914d\u7f6e\u4e00\u4e2a\u5bc6\u7801\u4e3a password123\uff1a<\/p>\n\n\n\n<p>SET PASSWORD FOR workpressuser= PASSWORD(\"password123\");<br><\/p>\n\n\n\n<p>\u4e3a\u8fd9\u4e2a\u7528\u6237\u914d\u7f6e\u6570\u636e\u5e93\u7684\u8bbf\u95ee\u6743\u9650\uff1a<\/p>\n\n\n\n<p>GRANT ALL PRIVILEGES ON workpress.* TO workpressuser IDENTIFIED BY\"password123\";<br><\/p>\n\n\n\n<p>\u751f\u6548\u8fd9\u4e9b\u914d\u7f6e<\/p>\n\n\n\n<p>FLUSH PRIVILEGES;<br><\/p>\n\n\n\n<p>\u7136\u540e\u9000\u51fa mysql<\/p>\n\n\n\n<p>exit;<br><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>\u914d\u7f6e wordpress<\/li><\/ol>\n\n\n\n<p>\u7531\u4e8ePHP\u9ed8\u8ba4\u8bbf\u95ee \/var\/www\/html\/ \u6587\u4ef6\u5939\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u628a wordpress \u6587\u4ef6\u5939\u91cc\u7684\u6587\u4ef6\u90fd\u590d\u5236\u5230 \/var\/www\/html\/ \u6587\u4ef6\u5939<\/p>\n\n\n\n<p>sudo mv wordpress\/* \/var\/www\/html\/<br><\/p>\n\n\n\n<p>\u4fee\u6539\u4e00\u4e0b \/var\/www\/html\/ \u76ee\u5f55\u6743\u9650\uff1a<\/p>\n\n\n\n<p>sudo chmod -R 777 \/var\/www\/html\/<br><\/p>\n\n\n\n<p>\u5c06apache\u6307\u5b9a\u5230index.html<\/p>\n\n\n\n<p>sudo mv \/var\/www\/html\/index.html \/var\/www\/html\/index~.html<br><\/p>\n\n\n\n<p>\u91cd\u542f Apache \u670d\u52a1\uff1a<\/p>\n\n\n\n<p>sudo systemctl restart apache2.service<br><br>\u5b89\u88c5\u5230\u6b64\u5df2\u7ecf\u5168\u90e8\u5b8c\u6210\u4e86\uff0c\u4f60\u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u7528\u4f60\u7684ip\u767b\u9646\u5230\u4f60\u7684\u4e2a\u4eba\u535a\u5ba2\u7f51\u7ad9\u4e86\uff0c\u7136\u540e\u8fdb\u884c\u4e00\u7cfb\u5217\u5b89\u88c5\u5c31\u53ef\u4ee5\u4e86\uff0c\u6570\u636e\u5e93\u540d\u548c\u7528\u6237\u540d\u8ddf\u5bc6\u7801\u586b\u4e0a\u9762\u521a\u521a\u65b0\u5efa\u7684\uff0c\u5176\u4ed6\u7684\u9ed8\u8ba4\u5c31ok\u4e86\u3002\u5982\u679c\u4f60\u7531\u57df\u540d\u7684\u8bdd\uff0c\u8fdb\u5165\u540e\u53f0\u540e\u53ef\u4ee5\u5728\u8bbe\u7f6e\u91cc\u628aip\u6362\u6210\u57df\u540d\uff0c\u7136\u540e\u4ee5\u540e\u5c31\u53ef\u4ee5\u7528\u57df\u540d\u8bbf\u95ee\u4e86\u3002<br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3aCSDN\u535a\u4e3b\u300cM\u9648\u300d\u7684\u539f\u521b\u6587\u7ae0\uff0c\u9075\u5faa CC 4.0 BY-SA \u7248\u6743\u534f\u8bae\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u539f\u6587\u51fa\u5904\u94fe\u63a5\u53ca\u672c\u58f0\u660e\u3002<br>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/blog.csdn.net\/qq_43645472\/java\/article\/details\/97165582<\/p>\n<button class=\"simplefavorite-button\" data-postid=\"74\" 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>https:\/\/blog.csdn.net\/qq_43645472\/article\/details\/97165582?depth_ &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-ubuntn"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/74","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=74"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}