{"id":6633,"date":"2023-01-11T11:37:15","date_gmt":"2023-01-11T03:37:15","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=6633"},"modified":"2023-01-11T11:37:15","modified_gmt":"2023-01-11T03:37:15","slug":"linux%e4%b8%8a%e5%a6%82%e4%bd%95%e6%9e%b6%e8%a8%adwordpress-%e6%8c%87%e4%bb%a4%e7%af%87","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/uncategorized\/linux%e4%b8%8a%e5%a6%82%e4%bd%95%e6%9e%b6%e8%a8%adwordpress-%e6%8c%87%e4%bb%a4%e7%af%87\/","title":{"rendered":"Linux\u4e0a\u5982\u4f55\u67b6\u8a2dWordPress \u6307\u4ee4\u7bc7"},"content":{"rendered":"<p>\u5728 Linux \u4e0a\u67b6\u8a2d Apache \u4ee5\u53ca WordPress \u7684\u65b9\u6cd5\u5982\u4e0b:<\/p>\n<p>\u5b89\u88dd Apache \u548c PHP\uff1a<\/p>\n<pre><code class=\"line-numbers\">sudo apt-get update\nsudo apt-get install apache2\nsudo apt-get install php libapache2-mod-php\n<\/code><\/pre>\n<p>\u5b89\u88dd\u6240\u9700\u5957\u4ef6:<\/p>\n<p>&#8220;`sudo apt-get install php-mysql php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip&#8220;`<br \/>\n\u5b89\u88dd MySQL<br \/>\n&#8220;`sudo apt-get install mysql-server&#8220;`<br \/>\n\u555f\u52d5 Apache \u4f3a\u670d\u5668:<br \/>\n&#8220;`sudo systemctl start apache2&#8220;`<br \/>\n\u78ba\u8a8d Apache \u6b63\u5728\u904b\u884c:<br \/>\n&#8220;`sudo systemctl status apache2&#8220;`<br \/>\n\u4e0b\u8f09\u4e26\u5b89\u88dd WordPress:<\/p>\n<pre><code class=\"line-numbers\">cd \/tmp\ncurl -O https:\/\/wordpress.org\/latest.tar.gz\ntar xzvf latest.tar.gz\n<\/code><\/pre>\n<p>\u5c07 WordPress \u653e\u5165 Apache \u7db2\u9801\u76ee\u9304:<\/p>\n<p>&#8220;`sudo rsync -av wordpress\/* \/var\/www\/html\/&#8220;`<br \/>\n\u5efa\u7acb\u4e00\u500b WordPress \u8cc7\u6599\u5eab\u53ca\u4f7f\u7528\u8005<\/p>\n<pre><code class=\"line-numbers\">mysql -u root -p\n&gt; create database wordpress;\n&gt; create user 'wpuser'@'localhost' identified by 'password';\n&gt; grant all on wordpress.* to 'wpuser'@'localhost';\n<\/code><\/pre>\n<p>\u4fee\u6539\u7db2\u9801\u76ee\u9304\u7684\u6b0a\u9650:<\/p>\n<p>&#8220;`sudo chown -R www-data:www-data \/var\/www\/html&#8220;`<br \/>\n\u4fee\u6539 Apache \u8a2d\u5b9a:<\/p>\n<pre><code class=\"line-numbers\">sudo a2enmod rewrite\nsudo service apache2 restart\n<\/code><\/pre>\n<p>\u8a2d\u5b9a\u8cc7\u6599\u5eab<br \/>\n\u6253\u958b\u4f60\u7684\u700f\u89bd\u5668, \u8f38\u5165http:\/\/localhost, \u4e26\u57f7\u884c\u5b89\u88dd<br \/>\n\u8f38\u5165\u4f60\u525b\u525b\u8a2d\u5b9a\u7684\u8cc7\u6599\u5eab\u8cc7\u8a0a<br \/>\n\u9032\u884c\u5f8c\u7e8c\u8a2d\u5b9a<br \/>\n\u6e05\u7406\u5b89\u88dd\u6a94<\/p>\n<pre><code class=\"line-numbers\">rm -rf \/tmp\/latest.tar.gz\nrm -rf \/tmp\/wordpress\n<\/code><\/pre>\n<p>\u5b8c\u6210\u5f8c,\u4f60\u5c31\u80fd\u5728\u4f60\u7684\u700f\u89bd\u5668\u4e2d\u770b\u5230\u4f60\u7684WordPress\u4e86.<br \/>\n\u6ce8\u610f:<\/p>\n<p>\u4e0a\u8ff0\u547d\u4ee4\u50c5\u4f9b\u53c3\u8003\uff0c\u5728\u5be6\u969b\u64cd\u4f5c\u4e2d\u8acb\u6839\u64da\u4f60\u7684\u7cfb\u7d71\u74b0\u5883\u9032\u884c\u8abf\u6574<\/p>\n<p>\u8a18\u5f97\u70baWordPress\u8a2d\u5b9a\u5b89\u5168\u7684\u7ba1\u7406\u54e1\u5bc6\u78bc, \u4e26\u5b9a\u671f\u66f4\u65b0\u4f60\u7684\u8edf\u9ad4<br \/>\n\u5efa\u8b70\u5728\u67b6\u8a2d\u904e\u7a0b\u4e2d\u53c3\u8003\u5b98\u65b9\u6587\u4ef6\u9032\u884c\u8a2d\u5b9a,\u4ee5\u78ba\u4fdd\u5b89\u88dd\u6b63\u78ba<br \/>\n\u5982\u679c\u4f60\u6709\u9632\u706b\u7246\u958b\u555f,\u8a18\u5f97\u958b\u555fhttp\u548chttps\u7684\u9023\u63a5<br \/>\n\u5982\u679c\u4f60\u60f3\u8981\u5c0d\u4f60\u7684\u7db2\u7ad9\u9032\u884c\u914d\u7f6e\uff0c\u8acb\u78ba\u8a8d\u4f60\u7684 Apache \u8a2d\u5b9a\u6a94\u7684\u4f4d\u7f6e(\u4f8b\u5982 \/etc\/httpd\/conf\/httpd.conf)<br \/>\n\u53e6\u5916\uff0c\u6709\u8a31\u591a\u5176\u4ed6\u7684\u65b9\u6cd5\u53ef\u4ee5\u5728 Linux \u4e0a\u67b6\u8a2d Apache\uff0c\u800c\u67b6\u8a2d WordPress \u66f4\u662f\u76f8\u7576\u5bb9\u6613\u3002\u5982\u679c\u4f60\u9047\u5230\u4e86\u4efb\u4f55\u554f\u984c\uff0c\u8acb\u96a8\u6642\u767c\u554f.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Linux \u4e0a\u67b6\u8a2d Apache \u4ee5\u53ca Wor&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-6633","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-1IZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=6633"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6633\/revisions"}],"predecessor-version":[{"id":6634,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6633\/revisions\/6634"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=6633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=6633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=6633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}