{"id":177,"date":"2026-01-19T00:17:50","date_gmt":"2026-01-18T16:17:50","guid":{"rendered":"http:\/\/blog.maoyulong.club:30080\/?p=177"},"modified":"2026-05-27T11:51:33","modified_gmt":"2026-05-27T03:51:33","slug":"2026%e6%96%b0%e5%b9%b4%e8%ae%a1%e5%88%92-blog-%e5%a4%8d%e6%b4%bb%e8%ae%a1%e5%88%92","status":"publish","type":"post","link":"https:\/\/blog.maoyulong.club\/?p=177","title":{"rendered":"2026\u65b0\u5e74\u8ba1\u5212 &#038; blog \u590d\u6d3b\u8ba1\u5212"},"content":{"rendered":"<p>blog\u7684wordpress\u7684\/var\/www\/html\u6301\u4e45\u5316\u51fa\u73b0\u4e86\u610f\u5916\u7684\u4e22\u5931\uff0c\u5728\u5de5\u4f5c\u4e4b\u540e\uff0c\u5f88\u957f\u4e00\u6bb5\u65f6\u95f4\uff0c\u6ca1\u6709\u7cbe\u529b\u53bb\u4fee\u590d\u8fd9\u4e9b\u95ee\u9898\uff0c\u5bfc\u81f4\u5b9e\u9645\u4e0a\u5f88\u957f\u4e00\u6bb5\u65f6\u95f4\uff08\u534a\u5e74\u5de6\u53f3\uff09\uff0cblog\u662f\u7f3a\u5e2d\u7684\uff0c\u65b0\u7684\u4e00\u5e74\uff0c\u6216\u8bb8\u5e94\u8be5\u7f1d\u7f1d\u8865\u8865\u8fd9\u4e9b\u95ee\u9898\u4e86\u3002<\/p>\n<p>\u76ee\u524d\u670d\u52a1\u5668\u6070\u5de7\u53ea\u6709\u8fd9\u4e00\u4e2a\u6700\u6838\u5fc3\u7684\u670d\u52a1\u4e22\u5931\u4e86\uff0c\u68c0\u67e5\u4e0b\u6765\uff0c\u5a92\u4f53\u7ad9\u3001\u4e91\u76d8\u7b49\u8d44\u6e90\u90fd\u8fd8\u6d3b\u7740\u3002\u9700\u8981\u64cd\u4f5c\u7684\u4e8b\u60c5\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u4fee\u590dblog<\/li>\n<li>\u5907\u4efd\u914d\u7f6e\u7c7b\u7684\u6301\u4e45\u5316\u6570\u636e<\/li>\n<li>\u5347\u7ea7kubernetes<\/li>\n<li>\u5347\u7ea7kubersphere\u9762\u677f<\/li>\n<\/ol>\n<p>\u5bf9\u4e8e\u5907\u4efd\uff0c\u53ef\u4ee5\u4f7f\u7528longhorn\u7684\u5907\u4efd\u65b9\u6848\u5b58\u50a8\u5728\u5bf9\u8c61\u5b58\u50a8\u4e2d\uff0c\u5728\u6b64\u65b9\u6848\u5b9e\u65bd\u524d\uff0c\u5e94\u8003\u8651kubectl cp \u547d\u4ee4\u4fdd\u5b58\u5728\u4e3b\u673a\u4e2d\u8fd9\u6837\u5bf9\u4e8ehomelab\u66f4\u7b80\u5355\u5b9e\u7528\u7684\u65b9\u6848<\/p>\n<p>\u76ee\u524dblog\u7684mysql\u6570\u636e\u4ecd\u5b58\u5728\uff0c\u6211\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684wordpress\uff0c\u7406\u8bba\u4e0a\u8fd9\u53ea\u4f1a\u4e22\u5931\u90e8\u5206\u76ae\u80a4\u6570\u636e\uff0c\u4ee5\u53ca\u5a92\u4f53\u5e93\u3002<\/p>\n<blockquote><p>\u987a\u5e26\u4e00\u63d0\uff0c\u5f88\u4e45\u6ca1\u6709\u505a\u8fd9\u4ef6\u4e8b\u60c5\u4e86\uff0c\u53d1\u73b0kubernetes\u5b98\u7f51\u4e0a\u9762\u5df2\u7ecf\u66f4\u65b0\u4e86\u6559\u7a0b\uff1a<\/p>\n<p><a href=\"https:\/\/kubernetes.io\/zh-cn\/docs\/tutorials\/stateful-application\/mysql-wordpress-persistent-volume\/\">\u793a\u4f8b\uff1a\u4f7f\u7528\u6301\u4e45\u5377\u90e8\u7f72 WordPress \u548c MySQL | Kubernetes<\/a><\/p><\/blockquote>\n<p>\u4f46\u662f\u5728kubernetes\u4e2d\u8fd8\u5b58\u5728\u4e00\u4e2a\u95ee\u9898\u5c31\u662f\uff1awordpress\u542f\u52a8\u65f6\u4f1a\u786e\u8ba4url\u914d\u7f6e\uff0c\u4f46\u662f\u4f60\u9700\u8981\u8fdb\u5165wordpress\u624d\u80fd\u8c03\u6574\u8fd9\u4e2a\u53c2\u6570\u3002\u800c\u4e14\u5f88\u53ef\u80fd\uff0cwp-admin\u7b49\u914d\u7f6e\u4e2d\u7684url\u548c\u6570\u636e\u5e93\u4e0d\u5339\u914d\uff0c\u51fa\u73b0\u4e86\u5176\u4ed6\u7684\u95ee\u9898\u3002<\/p>\n<p>\u8fdb\u5165\u6570\u636e\u5e93\uff0c\u67e5\u770b\u5230wordpress\u7684url\u8bbe\u7f6e\uff1a<\/p>\n<pre><code>mysql&gt; SELECT option_name, option_value\n    -&gt; FROM wp_options\n    -&gt; WHERE option_name IN ('siteurl', 'home');\n+-------------+-----------------------------+\n| option_name | option_value                |\n+-------------+-----------------------------+\n| home        | https:\/\/blog.maoyulong.club |\n| siteurl     | https:\/\/blog.maoyulong.club |\n+-------------+-----------------------------+\n2 rows in set (0.00 sec)\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u5b9e\u9645\u4e0a\u53ef\u4ee5\u901a\u8fc7wp-cli\u6765\u89e3\u51b3\uff0c\u4f46\u662f\u5b98\u65b9\u955c\u50cf\u662f\u6ca1\u6709\u5b89\u88c5\u7684\uff0c\u6211\u4eec\u76f4\u63a5\u4fee\u6539\u6570\u636e\u5e93\u548c\u914d\u7f6e\u6587\u4ef6\uff1b<\/p>\n<pre><code>UPDATE wp_options \nSET option_value = 'http:\/\/blog.maoyulong.club:30080' \nWHERE option_name IN ('siteurl', 'home');\n<\/code><\/pre>\n<p>\u914d\u7f6e\u6587\u4ef6\u4f5c\u5982\u4e0b\u4fee\u6539\uff0c\u5728wp-config.php \u91cc\u9762\u63d2\u5165\u5982\u4e0b\u8bed\u53e5\uff1a<\/p>\n<pre><code class=\"language-php\" lang=\"php\">\/\/ \u5f3a\u5236\u8bbe\u7f6e\u7ad9\u70b9URL\ndefine('WP_HOME', 'http:\/\/&lt;NODE_IP&gt;:&lt;NODE_PORT&gt;');\ndefine('WP_SITEURL', 'http:\/\/&lt;NODE_IP&gt;:&lt;NODE_PORT&gt;');\n<\/code><\/pre>\n<p>\u6b64\u65f6\u91cd\u5efa\u5bb9\u5668\uff0c\u5df2\u7ecf\u53ef\u4ee5\u8bbf\u95ee\u4e86\uff0c\u4f46\u662f\u4f1a\u51fa\u73b0\u7a7a\u767d\u9875\u9762<\/p>\n<p>\u4f46\u662f\u901a\u8fc7f12\u6211\u4eec\u53d1\u73b0\uff0c\u5934\u90e8\u4fe1\u606f\u662f\u5b8c\u6574\u7684\uff0c\u4f46\u662fbody\u6ca1\u6709\u5b9e\u9645\u5185\u5bb9\uff0c\u6839\u636e\u6b64\u524d\u4e22\u5931\u7684\u6570\u636e\u6765\u770b\uff0c\u7591\u4f3c\u662f\u4e3b\u9898\u6587\u4ef6\u7684\u4e22\u5931\uff0c\u6211\u4eec\u5c1d\u8bd5\u5728\u6570\u636e\u5e93\u6062\u590d\u9ed8\u8ba4\u4e3b\u9898\u3002<\/p>\n<p>\u67e5\u770b<code>\/var\/www\/html\/wp-content\/themes<\/code> \u786e\u8ba4\u9ed8\u8ba4\u4e3b\u9898\u540d\u79f0\uff0c\u6709\u4ee5\u4e0b\u4e09\u4e2a\uff1a<\/p>\n<pre><code class=\"language-shell\" lang=\"shell\">root@wrodpress-5f87d49fb6-bbhwm:\/var\/www\/html\/wp-content\/themes# ls\nindex.php  twentytwenty  twentytwentyone  twentytwentytwo\n<\/code><\/pre>\n<p>\u66f4\u65b0\u6570\u636e\u5e93\uff1a<\/p>\n<pre><code class=\"language-mysql\" lang=\"mysql\">UPDATE wp_options \nSET option_value = 'twentytwentytwo' \nWHERE option_name IN ('template', 'stylesheet');\n\nUPDATE wp_options \nSET option_value = 'Twenty Twenty-Two' \nWHERE option_name = 'current_theme';\n<\/code><\/pre>\n<p>\u4e4b\u524d\u7684\u4e3b\u9898\u627e\u4e0d\u5230\u4e86\uff0c\u5148\u4e34\u65f6\u7528sakura\u9876\u5c97\u5427= =<\/p>\n<p>\u53e6\uff1a\u6b64\u540e\u4e00\u6bb5\u65f6\u95f4blog\u7684\u56fe\u7247\u5e93\u6682\u65f6\u5904\u4e8e\u4e22\u5931\u72b6\u6001\uff0c\u5f71\u54cd\u89c2\u611f\u7684\u5c01\u9762\u7b49\u5c06\u4f1a\u9010\u6b65\u8865\u9f50<\/p>\n","protected":false},"excerpt":{"rendered":"<p>blog\u7684wordpress\u7684\/var\/www\/html\u6301\u4e45\u5316\u51fa\u73b0\u4e86\u610f\u5916\u7684\u4e22\u5931\uff0c\u5728\u5de5\u4f5c\u4e4b\u540e\uff0c\u5f88\u957f\u4e00\u6bb5\u65f6\u95f4\uff0c\u6ca1\u6709 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":180,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=177"}],"version-history":[{"count":2,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":196,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/posts\/177\/revisions\/196"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/media\/180"}],"wp:attachment":[{"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}