{"id":652816,"date":"2025-08-12T07:28:14","date_gmt":"2025-08-12T07:28:14","guid":{"rendered":"http:\/\/puo.cn\/?p=652816"},"modified":"2025-08-20T16:43:19","modified_gmt":"2025-08-20T08:43:19","slug":"%e9%98%b2%e6%ad%a2%e9%bb%91%e5%ae%a2%e5%88%a9%e7%94%a8xmlrpc-php%e6%8e%a5%e5%8f%a3%e5%88%86%e5%b8%83%e5%bc%8f%e6%9a%b4%e5%8a%9b%e7%a0%b4%e8%a7%a3wordpress%e7%bd%91%e7%ab%99","status":"publish","type":"post","link":"http:\/\/puo.cn\/?p=652816","title":{"rendered":"\u9632\u6b62\u9ed1\u5ba2\u5229\u7528xmlrpc.php\u63a5\u53e3\u5206\u5e03\u5f0f\u66b4\u529b\u7834\u89e3WordPress\u7f51\u7ad9"},"content":{"rendered":"<section style=\"padding: 20px; user-select: text; color: #222222; font-size: 16px; font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Microsoft YaHei Light', sans-serif; margin-bottom: 0px;\" data-pm-slice=\"0 0 []\">\n<p style=\"margin-top: 0px; margin-bottom: 16px; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\" data-pm-slice=\"0 0 []\">\u901a\u8fc7\u4e4b\u524d\u7684\u64cd\u4f5c\uff0c\u6211\u5df2\u7ecf\u642d\u5efa\u597d\u4e86wordpress\u4e2a\u4eba\u7f51\u7ad9\uff0c\u4f46\u6ca1\u8fc7\u591a\u4e45\uff0c\u5c31\u6536\u5230\u4e86\u670d\u52a1\u5668\u63d0\u4f9b\u5546\u544a\u8b66\uff1aCPU\u8d44\u6e90\u5360\u7528\u8fc7\u9ad8\u3002\u901a\u8fc7\u65e5\u5fd7\u6392\u67e5\uff08\u8fdb\u5165\u201cmy_website\u201d\u6587\u4ef6\u5939\u540e\uff0c\u8f93\u5165\u547d\u4ee4\uff1a<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">docker logs wordpress_nginx 2&gt;&amp;1 | tail -n 500<\/code>\uff09\uff0c\u9501\u5b9a\u4e3a\uff1a\u9ed1\u5ba2\u66b4\u529b\u653b\u51fb\u5f0f\u5237 xmlrpc.php \u63a5\u53e3\uff08\u65e5\u5fd7\u4e2d\u80fd\u770b\u5230\u5f88\u591a\u4e2aip\uff0c\u4e0d\u505c\u7684\u91cd\u590d POST\uff0c\u7c7b\u4f3c\u8fd9\u6837\uff1aPOST \/\/xmlrpc.php HTTP\/1.1&#8230;\uff09\u3002<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 16px; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u7ecf\u67e5\u8be2\uff0cxmlrpc.php\u662f WordPress \u63d0\u4f9b\u7684\u4e00\u4e2a\u65e9\u671f API \u63a5\u53e3\uff0c\u7528\u4e8e\u5141\u8bb8\u8fdc\u7a0b\u53d1\u5e03\uff08\u4f8b\u5982\u901a\u8fc7\u624b\u673aApp\u53d1\u6587\u7ae0\uff09\uff0c\u9ed1\u5ba2\u5229\u7528\u8fd9\u4e2a\u63a5\u53e3\uff0c\u901a\u8fc7\u4e00\u6b21 POST \u8bf7\u6c42\u5c31\u53ef\u4ee5\u5c1d\u8bd5\u6210\u767e\u4e0a\u5343\u4e2a\u7528\u6237\u540d\u548c\u5bc6\u7801\u7684\u7ec4\u5408\uff0c\u8fd9\u6bd4\u653b\u51fb\u767b\u5f55\u9875\u9762 wp-login.php \u6548\u7387\u9ad8\u5f97\u591a\u3002<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 16px; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u6211\u7684\u7f51\u7ad9\u867d\u7136\u8bbe\u7f6e\u4e86\u6bcf\u79d210\u4e2a\u8bf7\u6c42\u7684\u9650\u5236\uff0c\u4f46\u653b\u51fb\u8005\u7528\u66f4\u4f4e\u7684\u9891\u7387\u653b\u51fb\uff0c\u4e14\u91c7\u7528\u5927\u91cfip\u5206\u5e03\u5f0f\u653b\u51fb\u7684\u65b9\u5f0f\uff0c\u5e76\u638c\u63e1\u4e86\u7ba1\u7406\u5458\u7528\u6237\u540d\uff08\u901a\u8fc7\u8bbf\u95ee https:\/\/anjir.top\/?author=1\u83b7\u53d6\uff09\uff0c\u7406\u8bba\u4e0a\uff0c\u53ea\u8981\u65f6\u95f4\u5145\u8db3\uff0c\u5bc6\u7801\u4e00\u5b9a\u4f1a\u88ab\u653b\u7834\u3002\u53c8\u56e0\u4e3a\u7f51\u7ad9\u8bbe\u7f6e\u4e3b\u8981\u7f13\u5b58\u9759\u6001\u8d44\u6e90\uff0c\u4e0d\u7f13\u5b58\u52a8\u6001\u8bf7\u6c42\uff0c\u6bcf\u4e00\u6b21 POST \u8bf7\u6c42\uff0cNginx \u90fd\u4f1a\u628a\u5b83\u8f6c\u53d1\u7ed9\u540e\u9762\u7684 WordPress (PHP-FPM) \u5904\u7406\u3002WordPress \u9700\u8981\u8fde\u63a5\u6570\u636e\u5e93\u3001\u9a8c\u8bc1\u4fe1\u606f\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4f1a\u6d88\u8017\u5927\u91cf\u7684 CPU \u548c\u5185\u5b58\uff0c\u6240\u4ee5\u5bfc\u81f4CPU\u8d44\u6e90\u5360\u7528\u8fc7\u9ad8\u544a\u8b66\u3002<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 16px; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u5176\u5b9e\u6709\u4e2a\u5f88\u7b80\u5355\u7684\u89e3\u51b3\u65b9\u6848\uff1a\u76f4\u63a5\u5728 Nginx \u5c42\u62d2\u7edd\u4efb\u4f55\u5bf9xmlrpc.php\u8fd9\u4e2a\u6587\u4ef6\u7684\u8bbf\u95ee\uff0c\u7136\u540e\u53ea\u901a\u8fc7WordPress\u540e\u53f0\u53d1\u5e03\u6587\u7ae0\u5c31\u884c\u4e86\u3002\u4f46\u6211\u4e2a\u4eba\u8fd8\u662f\u6709\u7528\u5230xmlrpc\u63a5\u53e3\u7684\u573a\u666f\uff0c\u6240\u4ee5\u4e0d\u80fd\u5b8c\u5168\u5c01\u5835\u4e86\u3002\u901a\u8fc7\u54a8\u8be2AI\uff0c\u6211\u627e\u5230\u4e86\u201cNginx + Fail2ban\u201d\u65b9\u6848\uff0c\u5b8c\u7f8e\u89e3\u51b3\u4e86\u73b0\u9636\u6bb5\u7684\u9700\u6c42\u3002<strong style=\"font-weight: 600;\">\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u8bb0\u5f55\uff1a\u4f7f\u7528\u201cNginx + Fail2ban\u201d\u65b9\u6848\uff0c\u89e3\u51b3\u9ed1\u5ba2\u5229\u7528xmlrpc.php\u63a5\u53e3\u3001wp-login.php\u9875\u9762\u66b4\u529b\u7834\u89e3WordPress\u7f51\u7ad9\u7684\u95ee\u9898\u3002<\/strong><\/p>\n<h2 style=\"margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; padding-bottom: 0.3em; font-size: 1.5em; border-bottom: 1px solid #d7dde3; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u7b80\u53555\u4e2a\u6b65\u9aa4<\/h2>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 0px; margin-bottom: 16px; padding-left: 2em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\n<li><strong style=\"font-weight: 600;\">\u542f\u7528\u5e76\u914d\u7f6e\u9632\u706b\u5899 UFW<\/strong><\/li>\n<li style=\"margin-top: 0.25em;\"><strong style=\"font-weight: 600;\">\u4fee\u6539 Nginx \u914d\u7f6e\uff0c\u8bb0\u5f55\u66f4\u8be6\u7ec6\u7684\u65e5\u5fd7<\/strong><\/li>\n<li style=\"margin-top: 0.25em;\"><strong style=\"font-weight: 600;\">\u914d\u7f6e Fail2ban<\/strong><\/li>\n<li style=\"margin-top: 0.25em;\"><strong style=\"font-weight: 600;\">\u8bbe\u7f6e\u767d\u540d\u5355\u5e76\u91cd\u542f Fail2ban<\/strong><\/li>\n<li style=\"margin-top: 0.25em;\"><strong style=\"font-weight: 600;\">\u68c0\u67e5\u5c01\u7981\u6548\u679c<\/strong><\/li>\n<\/ol>\n<h3 style=\"margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; font-size: 1.25em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u7b2c\u4e00\u6b65\uff1a\u542f\u7528\u5e76\u914d\u7f6e\u9632\u706b\u5899 UFW<\/h3>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 0px; margin-bottom: 16px; padding-left: 2em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\n<li>\n<section>\u5b89\u88c5:<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">apt update &amp;&amp; apt install ufw\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\">\n<section>\u8bbe\u7f6e\u9ed8\u8ba4\u89c4\u5219:<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">ufw default deny incoming\r\nufw default allow outgoing\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\">\n<section>\u5f00\u653e\u5fc5\u8981\u7aef\u53e3:<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">ufw allow ssh\r\nufw allow http\r\nufw allow https\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\">\n<section>\u542f\u7528 (\u8bf7\u786e\u4fdd\u5df2\u653e\u884cSSH):<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">ufw\u00a0<span style=\"color: #ffa657;\">enable<\/span>\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\">\n<section>\u68c0\u67e5\u72b6\u6001:<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">ufw status\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<\/ol>\n<h3 style=\"margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; font-size: 1.25em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u7b2c\u4e8c\u6b65\uff1a\u4fee\u6539 Nginx \u914d\u7f6e\uff0c\u8bb0\u5f55\u66f4\u8be6\u7ec6\u7684\u65e5\u5fd7<\/h3>\n<p style=\"margin-top: 0px; margin-bottom: 16px; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u4e3a\u4e86\u8ba9 Fail2ban \u80fd\u66f4\u597d\u5730\u5de5\u4f5c\uff0c\u6211\u4eec\u9700\u8981\u8ba9 Nginx \u5728\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">POST<\/code>\u8bf7\u6c42\u7684\u5177\u4f53\u5185\u5bb9\u3002\u8fd9\u4f1a\u7a0d\u5fae\u589e\u52a0\u65e5\u5fd7\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u4f46\u5bf9\u4e8e\u5b89\u5168\u6765\u8bf4\u662f\u503c\u5f97\u7684\u3002<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 0px; margin-bottom: 16px; padding-left: 2em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\n<li><strong style=\"font-weight: 600;\">\u4fee\u6539 Nginx \u4e3b\u914d\u7f6e\u6587\u4ef6\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">nginx.conf<\/code><\/strong>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u6211\u4eec\u9700\u8981\u4fee\u6539 Nginx \u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\uff0c\u800c\u4e0d\u662f\u6211\u4eec\u7ad9\u70b9\u7684\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">app.conf<\/code>\u3002\u7531\u4e8e\u6211\u4eec\u5728 Docker \u4e2d\u8fd0\u884c\uff0c\u8fd9\u4e2a\u6587\u4ef6\u5728\u5bb9\u5668\u5185\u90e8\u3002\u6700\u7b80\u5355\u7684\u529e\u6cd5\u662f\u628a\u5b83\u590d\u5236\u51fa\u6765\uff0c\u4fee\u6539\uff0c\u7136\u540e\u901a\u8fc7\u5377\u6620\u5c04\u6302\u8f7d\u56de\u53bb\u3002<\/p>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u4ece\u5bb9\u5668\u4e2d\u590d\u5236\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">nginx.conf<\/code>\u5230\u5bbf\u4e3b\u673a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\"><span style=\"color: #ffa657;\">cd<\/span>\u00a0~\/my_website\r\n<span style=\"color: #8b949e;\"># \u4e3a\u4e3b\u914d\u7f6e\u6587\u4ef6\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55<\/span>\r\n<span style=\"color: #ffa657;\">mkdir<\/span>\u00a0-p .\/nginx\/main-conf\r\n<span style=\"color: #8b949e;\"># \u4ece\u6b63\u5728\u8fd0\u884c\u7684 nginx \u5bb9\u5668\u4e2d\u590d\u5236\u6587\u4ef6<\/span>\r\ndocker\u00a0<span style=\"color: #ffa657;\">cp<\/span>\u00a0wordpress_nginx:\/etc\/nginx\/nginx.conf .\/nginx\/main-conf\/nginx.conf\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u7f16\u8f91\u590d\u5236\u51fa\u6765\u7684\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">nginx.conf<\/code><\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">nano .\/nginx\/main-conf\/nginx.conf\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u627e\u5230\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">log_format main<\/code>\uff0c\u4fee\u6539\u4e3a\uff08\u5373\u672b\u5c3e\u6dfb\u52a0\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">$request_body<\/code>\u53d8\u91cf\uff0c\u8ba9\u5b83\u8bb0\u5f55 POST \u7684\u5185\u5bb9\uff09\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0px; margin: 0px; background: 0px 0px transparent; border-radius: 6px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; overflow-wrap: normal;\">log_format main '$remote_addr - $remote_user [$time_local] \"$request\" '\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 '$status $body_bytes_sent \"$http_referer\" '\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 '\"$http_user_agent\" \"$http_x_forwarded_for\" \"$request_body\"';\r\n<\/code><\/pre>\n<\/li>\n<li style=\"margin-top: 0.25em;\"><strong style=\"font-weight: 600;\">\u4fee\u6539 docker-compose.yml \u6302\u8f7d\u914d\u7f6e<\/strong>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u5728 my_website \u76ee\u5f55\u4e0b\u521b\u5efa\u65e5\u5fd7\u6587\u4ef6\u5939\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\"><span style=\"color: #ffa657;\">mkdir<\/span>\u00a0-p .\/nginx\/logs\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u4fee\u6539 docker-compose.yml\uff0c\u4e3a nginx \u670d\u52a1\u6dfb\u52a0\u65e5\u5fd7\u5377\u6620\u5c04\uff0c\u548c\u6302\u8f7d\u6211\u4eec\u4fee\u6539\u540e\u7684\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">nginx.conf<\/code><\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">nano docker-compose.yml\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u5728 nginx \u670d\u52a1\u7684\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">volumes<\/code>\u00a0\u90e8\u5206\uff0c\u65b0\u589e\u4e24\u884c\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\"><span style=\"color: #79c0ff;\">volumes:<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/nginx\/main-conf\/nginx.conf:\/etc\/nginx\/nginx.conf:ro<\/span><span style=\"color: #8b949e;\"># &lt;--- \u65b0\u589e<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/nginx\/logs:\/var\/log\/nginx<\/span><span style=\"color: #8b949e;\"># &lt;--- \u65b0\u589e<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/nginx\/conf.d:\/etc\/nginx\/conf.d<\/span>\r\n<\/code><\/pre>\n<\/li>\n<li style=\"margin-top: 0.25em;\"><strong style=\"font-weight: 600;\">\u5207\u6362\u7f51\u7edc\u6a21\u5f0f\u4e3a host<\/strong><br \/>\n<section>\uff08\u5220\u9664 ports\uff0c\u6dfb\u52a0 network_mode\uff09<\/p>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u6211\u4eec\u8ba9 Nginx \u5bb9\u5668\u76f4\u63a5\u4f7f\u7528\u5bbf\u4e3b\u673a\u7684\u7f51\u7edc\u3002\u8fd9\u6837\uff0cNginx \u5c31\u80fd\u76f4\u63a5\u770b\u5230\u6765\u81ea\u5916\u90e8\u7684\u3001\u672a\u7ecf Docker NAT \u8f6c\u6362\u7684\u539f\u59cb\u8bf7\u6c42\uff0c\u4ece\u800c\u83b7\u53d6\u5230\u771f\u5b9e\u7684\u5ba2\u6237\u7aef\u516c\u7f51 IP\u3002<\/p>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u7ee7\u7eed\u5bf9docker-compose.yml\u4e2d\u7684 nginx \u670d\u52a1\u8fdb\u884c\u5982\u4e0b\u4fee\u6539\uff1a a. \u5220\u9664 ports \u90e8\u5206\uff1a\u5728 host \u6a21\u5f0f\u4e0b\uff0c\u5bb9\u5668\u76f4\u63a5\u76d1\u542c\u5bbf\u4e3b\u673a\u7684\u7aef\u53e3\uff0c\u4e0d\u518d\u9700\u8981\u7aef\u53e3\u6620\u5c04\u3002 b. \u6dfb\u52a0 network_mode: &#8220;host&#8221;\u3002 c. \u4fee\u6539 wordpress \u7684\u8fde\u63a5\u65b9\u5f0f\uff1a\u7531\u4e8e Nginx \u73b0\u5728\u548c\u5bbf\u4e3b\u673a\u5728\u540c\u4e00\u4e2a\u7f51\u7edc\u547d\u540d\u7a7a\u95f4\uff0c\u5b83\u4e0d\u80fd\u518d\u901a\u8fc7\u670d\u52a1\u540d wordpress \u6765\u8fde\u63a5\u4e86\u3002\u5b83\u9700\u8981\u901a\u8fc7\u5bbf\u4e3b\u673a\u7684 localhost (127.0.0.1) \u548c WordPress \u5bb9\u5668\u6620\u5c04\u51fa\u6765\u7684\u7aef\u53e3\u6765\u8fde\u63a5\u3002\u6240\u4ee5\u6211\u4eec\u4e5f\u8981\u4fee\u6539 wordpress \u670d\u52a1\u3002<\/p>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u8bf7\u5c06 docker-compose.yml \u6587\u4ef6\u4e2d\u7684 nginx \u548c wordpress \u670d\u52a1\u90e8\u5206\uff0c\u4fee\u6539\u4e3a\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\"><span style=\"color: #79c0ff;\">wordpress:<\/span>\r\n<span style=\"color: #79c0ff;\">image:<\/span><span style=\"color: #a5d6ff;\">wordpress:php8.2-fpm<\/span>\r\n<span style=\"color: #79c0ff;\">container_name:<\/span><span style=\"color: #a5d6ff;\">wordpress_fpm<\/span>\r\n<span style=\"color: #79c0ff;\">restart:<\/span><span style=\"color: #a5d6ff;\">always<\/span>\r\n<span style=\"color: #8b949e;\"># \u65b0\u589e ports \u6620\u5c04\uff0c\u8ba9 fpm \u7684 9000 \u7aef\u53e3\u66b4\u9732\u7ed9\u5bbf\u4e3b\u673a<\/span>\r\n<span style=\"color: #79c0ff;\">ports:<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">\"127.0.0.1:9000:9000\"<\/span>\r\n<span style=\"color: #79c0ff;\">depends_on:<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">db<\/span>\r\n<span style=\"color: #79c0ff;\">volumes:<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/wordpress\/html:\/var\/www\/html<\/span>\r\n<span style=\"color: #79c0ff;\">environment:<\/span>\r\n<span style=\"color: #79c0ff;\">WORDPRESS_DB_HOST:<\/span><span style=\"color: #a5d6ff;\">db:3306<\/span>\r\n<span style=\"color: #79c0ff;\">WORDPRESS_DB_USER:<\/span><span style=\"color: #a5d6ff;\">'wordpress_user'<\/span>\r\n<span style=\"color: #79c0ff;\">WORDPRESS_DB_PASSWORD:<\/span><span style=\"color: #a5d6ff;\">'YOUR_STRONG_USER_PASSWORD'<\/span>\r\n<span style=\"color: #79c0ff;\">WORDPRESS_DB_NAME:<\/span><span style=\"color: #a5d6ff;\">'wordpress'<\/span>\r\n<span style=\"color: #8b949e;\"># wordpress \u4ecd\u7136\u5728 app-network \u4e2d\uff0c\u4ee5\u4fbf\u8fde\u63a5 db<\/span>\r\n<span style=\"color: #79c0ff;\">networks:<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">app-network<\/span>\r\n\r\n<span style=\"color: #79c0ff;\">nginx:<\/span>\r\n<span style=\"color: #79c0ff;\">image:<\/span><span style=\"color: #a5d6ff;\">nginx:1.27.0-alpine<\/span>\r\n<span style=\"color: #79c0ff;\">container_name:<\/span><span style=\"color: #a5d6ff;\">wordpress_nginx<\/span>\r\n<span style=\"color: #79c0ff;\">restart:<\/span><span style=\"color: #a5d6ff;\">always<\/span>\r\n<span style=\"color: #8b949e;\"># \u5173\u952e\u4fee\u6539\uff1a\u4f7f\u7528 host \u7f51\u7edc\u6a21\u5f0f<\/span>\r\n<span style=\"color: #79c0ff;\">network_mode:<\/span><span style=\"color: #a5d6ff;\">\"host\"<\/span>\r\n<span style=\"color: #8b949e;\"># \u4e0d\u518d\u9700\u8981 ports \u6620\u5c04<\/span>\r\n<span style=\"color: #8b949e;\"># ports:<\/span>\r\n<span style=\"color: #8b949e;\"># \u00a0 - \"80:80\"<\/span>\r\n<span style=\"color: #8b949e;\"># \u00a0 - \"443:443\"<\/span>\r\n<span style=\"color: #79c0ff;\">volumes:<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/nginx\/main-conf\/nginx.conf:\/etc\/nginx\/nginx.conf:ro<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/nginx\/logs:\/var\/log\/nginx<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/nginx\/conf.d:\/etc\/nginx\/conf.d<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/nginx\/cache:\/var\/cache\/nginx<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/wordpress\/html:\/var\/www\/html:ro<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/certbot\/conf:\/etc\/letsencrypt<\/span>\r\n<span style=\"color: #f2cc60;\">-<\/span><span style=\"color: #a5d6ff;\">.\/certbot\/www:\/var\/www\/certbot<\/span>\r\n<span style=\"color: #8b949e;\"># \u5728 host \u6a21\u5f0f\u4e0b\uff0cnginx \u4e0d\u518d\u5c5e\u4e8e app-network<\/span>\r\n<span style=\"color: #8b949e;\"># networks:<\/span>\r\n<span style=\"color: #8b949e;\"># \u00a0 - app-network<\/span>\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\"><strong style=\"font-weight: 600;\">\u4fee\u6539 Nginx \u7ad9\u70b9\u914d\u7f6e\u6587\u4ef6 app.conf<\/strong>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u7531\u4e8e Nginx \u73b0\u5728\u9700\u8981\u901a\u8fc7 localhost \u6765\u8fde\u63a5 WordPress\uff0c\u6211\u4eec\u9700\u8981\u4fee\u6539 PHP-FPM \u7684\u8f6c\u53d1\u5730\u5740\u3002<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0px; margin: 0px; background: 0px 0px transparent; border-radius: 6px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; overflow-wrap: normal;\">nano .\/nginx\/conf.d\/app.conf\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u627e\u5230 location ~ .php$ { &#8230; } \u5757\uff0c\u5c06 fastcgi_pass wordpress:9000; \u4fee\u6539\u4e3a fastcgi_pass 127.0.0.1:9000;<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0px; margin: 0px; background: 0px 0px transparent; border-radius: 6px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; overflow-wrap: normal;\">location ~ .php$ {\r\n\u00a0 \u00a0 # ... (\u5176\u4ed6\u914d\u7f6e) ...\r\n\u00a0 \u00a0 # \u8fde\u63a5\u5230\u5bbf\u4e3b\u673a\u7684 9000 \u7aef\u53e3\uff0c\u8be5\u7aef\u53e3\u5df2\u6620\u5c04\u5230 WordPress \u5bb9\u5668\r\n\u00a0 \u00a0 fastcgi_pass 127.0.0.1:9000;\r\n\u00a0 \u00a0 # ... (\u5176\u4ed6\u914d\u7f6e) ...\r\n}\r\n<\/code><\/pre>\n<\/li>\n<li style=\"margin-top: 0.25em;\"><strong style=\"font-weight: 600;\">\u91cd\u542f<\/strong><br \/>\n<section>\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">docker compose down\r\ndocker compose up -d\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<\/ol>\n<h3 style=\"margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; font-size: 1.25em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u7b2c\u4e09\u6b65\uff1a\u914d\u7f6e Fail2ban<\/h3>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 0px; margin-bottom: 16px; padding-left: 2em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\n<li>\n<section>\u5b89\u88c5\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">apt install fail2ban -y\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\">\n<section>\u521b\u5efa jail \u914d\u7f6e\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">nano \/etc\/fail2ban\/jail.d\/wordpress-zerotolerance.conf\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u5c06\u4ee5\u4e0b\u5b9a\u5236\u597d\u7684\u5185\u5bb9\u7c98\u8d34\u8fdb\u53bb\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\"><span style=\"color: #1f6feb; font-weight: bold;\">[wordpress-xmlrpc]<\/span>\r\n<span style=\"color: #79c0ff;\">enabled<\/span>\u00a0 =\u00a0<span style=\"color: #79c0ff;\">true<\/span>\r\n<span style=\"color: #79c0ff;\">port<\/span>\u00a0 \u00a0 \u00a0= http,https\r\n<span style=\"color: #79c0ff;\">filter<\/span>\u00a0 \u00a0= wordpress-xmlrpc\r\n<span style=\"color: #79c0ff;\">logpath<\/span>\u00a0 = \/root\/my_website\/nginx\/logs\/access.log\r\n<span style=\"color: #8b949e;\"># \u4efb\u4f55\u4e00\u6b21\u5339\u914d\u90fd\u7acb\u5373\u89e6\u53d1<\/span>\r\n<span style=\"color: #79c0ff;\">maxretry<\/span>\u00a0=\u00a0<span style=\"color: #79c0ff;\">1<\/span>\r\n<span style=\"color: #8b949e;\"># \u5c01\u7981\u65f6\u95f4\u4e3a30\u5929<\/span>\r\n<span style=\"color: #79c0ff;\">bantime<\/span>\u00a0 =\u00a0<span style=\"color: #79c0ff;\">30<\/span>d\r\n<span style=\"color: #8b949e;\"># findtime \u5728 maxretry=1 \u65f6\u610f\u4e49\u4e0d\u5927\uff0c\u4f46\u6700\u597d\u4fdd\u7559<\/span>\r\n<span style=\"color: #79c0ff;\">findtime<\/span>\u00a0=\u00a0<span style=\"color: #79c0ff;\">1<\/span>m\r\n\r\n<span style=\"color: #1f6feb; font-weight: bold;\">[wordpress-login]<\/span>\r\n<span style=\"color: #79c0ff;\">enabled<\/span>\u00a0 =\u00a0<span style=\"color: #79c0ff;\">true<\/span>\r\n<span style=\"color: #79c0ff;\">port<\/span>\u00a0 \u00a0 \u00a0= http,https\r\n<span style=\"color: #79c0ff;\">filter<\/span>\u00a0 \u00a0= wordpress-login\r\n<span style=\"color: #79c0ff;\">logpath<\/span>\u00a0 = \/root\/my_website\/nginx\/logs\/access.log\r\n<span style=\"color: #8b949e;\"># \u4efb\u4f55\u4e00\u6b21\u5339\u914d\u90fd\u7acb\u5373\u89e6\u53d1<\/span>\r\n<span style=\"color: #79c0ff;\">maxretry<\/span>\u00a0=\u00a0<span style=\"color: #79c0ff;\">1<\/span>\r\n<span style=\"color: #8b949e;\"># \u5c01\u7981\u65f6\u95f4\u4e3a1\u5929<\/span>\r\n<span style=\"color: #79c0ff;\">bantime<\/span>\u00a0 =\u00a0<span style=\"color: #79c0ff;\">1<\/span>d\r\n<span style=\"color: #79c0ff;\">findtime<\/span>\u00a0=\u00a0<span style=\"color: #79c0ff;\">1<\/span>m\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\">\n<section>\u521b\u5efa\u5bf9\u5e94\u7684\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">filter<\/code>\u00a0(\u8fc7\u6ee4\u5668) \u6587\u4ef6<\/p>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u4e3a\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">xmlrpc.php<\/code>\u00a0\u521b\u5efa filter<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">nano \/etc\/fail2ban\/filter.d\/wordpress-xmlrpc.conf\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u7c98\u8d34\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\"><span style=\"color: #1f6feb; font-weight: bold;\">[Definition]<\/span>\r\n<span style=\"color: #79c0ff;\">failregex<\/span>\u00a0= ^&lt;HOST&gt; - .*\u00a0<span style=\"color: #a5d6ff;\">\"POST \/+xmlrpc.php HTTP\/.*\r\nignoreregex =\r\n<\/span><\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u4ee5\u53ca\u4e3a\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">wp-login.php<\/code>\u00a0\u521b\u5efa filter<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">nano \/etc\/fail2ban\/filter.d\/wordpress-login.conf\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u7c98\u8d34\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\"><span style=\"color: #1f6feb; font-weight: bold;\">[Definition]<\/span>\r\n<span style=\"color: #79c0ff;\">failregex<\/span>\u00a0= ^&lt;HOST&gt; - .*\u00a0<span style=\"color: #a5d6ff;\">\"POST \/+wp-login.php.*\r\nignoreregex =\r\n<\/span><\/code><\/pre>\n<\/section>\n<\/li>\n<\/ol>\n<h3 style=\"margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; font-size: 1.25em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u7b2c\u56db\u6b65\uff1a\u8bbe\u7f6e\u767d\u540d\u5355\u5e76\u91cd\u542f Fail2ban<\/h3>\n<p style=\"margin-top: 0px; margin-bottom: 16px; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\u8fd9\u4e00\u6b65\u81f3\u5173\u91cd\u8981\uff0c\u9632\u6b62\u4f60\u88ab\u81ea\u5df1\u9501\u5728\u5916\u9762\u3002<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 0px; margin-bottom: 16px; padding-left: 2em; color: #24292f; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\">\n<li>\n<section>\u7f16\u8f91 jail.local \u6dfb\u52a0\u4f60\u81ea\u5df1\u7684 IP<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">nano \/etc\/fail2ban\/jail.local\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u627e\u5230\u6216\u6dfb\u52a0\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">ignoreip<\/code>\u00a0\u8fd9\u4e00\u884c\uff0c\u5e76\u52a0\u4e0a\u4f60\u81ea\u5df1\u7684\u672c\u673a IP\u6bb5\uff08\u767e\u5ea6\u201cip\u201d,\u5bb6\u7528\u5bbd\u5e26\u52a8\u6001ip\u524d3\u6bb5\u4e00\u822c\u4e0d\u53d8\uff0c\u6700\u540e\u4e00\u6bb5\u5168\u5305\u542b\u5373\u53ef\uff0c\u6bd4\u5982\u767e\u5ea6\u67e5\u8be2\u5230\u4f60\u6b64\u65f6\u7684ip\u662f\uff1a117.100.100.100\uff0c\u90a3\u4e48\u52a0\u767d\u7684ip\u6bb5\u53ef\u4ee5\u586b\uff1a117.100.100.0\/24\uff09\u3002<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\"><span style=\"color: #1f6feb; font-weight: bold;\">[DEFAULT]<\/span>\r\n<span style=\"color: #79c0ff;\">ignoreip<\/span>\u00a0=\u00a0<span style=\"color: #79c0ff;\">127.0<\/span>.<span style=\"color: #79c0ff;\">0.1<\/span>\/<span style=\"color: #79c0ff;\">8<\/span>\u00a0::<span style=\"color: #79c0ff;\">1<\/span><span style=\"color: #79c0ff;\">117.100<\/span>.<span style=\"color: #79c0ff;\">100.0<\/span>\/<span style=\"color: #79c0ff;\">24<\/span>\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\">\n<section>\u91cd\u542f Fail2ban \u4f7f\u6240\u6709\u914d\u7f6e\u751f\u6548<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">systemctl restart fail2ban\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<li style=\"margin-top: 0.25em;\">\n<section>\u68c0\u67e5 Fail2ban \u72b6\u6001<\/p>\n<pre style=\"border-radius: 6px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: #f6f8fa;\"><code style=\"white-space: pre-wrap; color: #c9d1d9; background: 0px 0px transparent; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 1em; margin: 0px; border-radius: 6px; word-break: normal; border: 0px; display: block; overflow: auto visible; line-height: inherit; overflow-wrap: normal;\">fail2ban-client status\r\n<\/code><\/pre>\n<p style=\"margin-top: 16px; margin-bottom: 16px;\">\u4f60\u5e94\u8be5\u80fd\u770b\u5230\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">Jail list:<\/code>\u00a0\u4e0b\u9762\u6709\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">wordpress-login<\/code>\u00a0\u548c\u00a0<code style=\"font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13.6px; padding: 0.2em 0.4em; margin: 0px; white-space: break-spaces; background-color: rgba(175, 184, 193, 0.2); border-radius: 6px;\">wordpress-xmlrpc<\/code>\u00a0\u8fd9\u4e24\u4e2a\u6d3b\u52a8\u7684 jail\u3002<\/p>\n<\/section>\n<\/li>\n<\/ol>\n<p style=\"line-height: 1.6em; margin: 1em 0px;\">\n<h3 style=\"color: inherit; font-weight: 600; font-size: 1.424em; line-height: 1.3; margin-block: 1em 0px;\">\u7b2c\u4e94\u6b65\uff1a\u68c0\u67e5\u5c01\u7981\u6548\u679c<\/h3>\n<p style=\"line-height: 1.6em; margin: 1em 0px;\"><strong style=\"color: #222222; font-weight: 600;\">wp-login.php\u5c01\u7981\u9a8c\u8bc1<\/strong>:<br \/>\na.\u00a0<strong style=\"color: #222222; font-weight: 600;\">\u8fdb\u884c\u6d4b\u8bd5<\/strong>:<\/p>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: disc; margin: 1.25em 0px;\">\n<li style=\"margin-top: 0.1em; margin-bottom: 0.1em;\">\n<p style=\"line-height: 1.6em; margin: 0px;\">\u7528\u4f60\u7684<strong style=\"color: #222222; font-weight: 600;\">\u624b\u673a\u7f51\u7edc<\/strong>\uff08\u4e0d\u8981\u7528\u5e38\u7528 Wi-Fi\uff09\u8bbf\u95ee https:\/\/anjir.top\/wp-login.php\u3002<\/p>\n<\/li>\n<li style=\"margin-top: 0.1em; margin-bottom: 0.1em;\">\n<p style=\"line-height: 1.6em; margin: 0px;\"><strong style=\"color: #222222; font-weight: 600;\">\u53ea\u8f93\u5165\u4e00\u6b21<\/strong>\u9519\u8bef\u7684\u5bc6\u7801\u3002<\/p>\n<\/li>\n<li style=\"margin-top: 0.1em; margin-bottom: 0.1em;\">\n<p style=\"line-height: 1.6em; margin: 0px;\">\u7136\u540e\u5c1d\u8bd5\u5237\u65b0\u9875\u9762\u6216\u518d\u6b21\u8bbf\u95ee\u3002\u4f60\u5e94\u8be5\u4f1a\u53d1\u73b0\u7f51\u7ad9\u5df2\u7ecf\u65e0\u6cd5\u8bbf\u95ee\u4e86\u3002<\/p>\n<\/li>\n<li style=\"margin-top: 0.1em; margin-bottom: 0.1em;\">\n<p style=\"line-height: 1.6em; margin: 0px;\">\u56de\u5230\u670d\u52a1\u5668\uff0c\u6267\u884c fail2ban-client status wordpress-login\uff0c\u4f60\u4f1a\u770b\u5230\u4f60\u624b\u673a\u7684 IP \u5df2\u7ecf\u88ab\u5217\u5165\u4e86\u5c01\u7981\u5217\u8868\u3002<\/p>\n<\/li>\n<\/ul>\n<p style=\"line-height: 1.6em; margin: 1em 0px;\">b.\u00a0<strong style=\"color: #222222; font-weight: 600;\">\u7ec3\u4e60\u89e3\u5c01<\/strong>:<br \/>\n\u65e2\u7136\u6d4b\u8bd5\u6210\u529f\u4e86\uff0c\u5c31\u7ec3\u4e60\u4e00\u4e0b\u89e3\u5c01\u81ea\u5df1\u7684\u624b\u673aIP\u5427\u3002<\/p>\n<section style=\"display: flex; background-color: #fafafa; border: 1px solid #f0f0f0;\">\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: disc; margin: 0px; flex-shrink: 0; counter-reset: line 0; padding: 0.875em 0px 0.875em 0.875em; white-space: normal; width: fit-content;\">\n<li style=\"margin: 0px; font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, 'Liberation Mono', 'Courier New', monospace; padding: 0px; display: list-item; text-align: right; line-height: 1.75em; font-size: 0.875em; list-style-type: none; color: rgba(0, 0, 0, 0.25);\">\n<section>1<\/section>\n<\/li>\n<li style=\"margin: 0px; font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, 'Liberation Mono', 'Courier New', monospace; padding: 0px; display: list-item; text-align: right; line-height: 1.75em; font-size: 0.875em; list-style-type: none; color: rgba(0, 0, 0, 0.25);\">\n<section>2<\/section>\n<\/li>\n<\/ul>\n<pre style=\"margin: 0px; padding: 0px; overflow: auto;\"><code style=\"font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, 'Liberation Mono', 'Courier New', monospace; color: #5c5c5c; background: unset; font-size: 0.875em; vertical-align: baseline; padding: 1em; display: block; line-height: 1.75em;\"><span style=\"color: #007400;\"># \u5047\u8bbe\u4f60\u624b\u673aIP\u662f 222.222.222.222<\/span>\r\nfail2ban-client unban\u00a0<span style=\"color: #1c00cf;\">222.222.222.222<\/span>\r\n<\/code><\/pre>\n<\/section>\n<p style=\"line-height: 1.6em; margin: 1em 0px;\"><strong style=\"color: #222222; font-weight: 600;\">xmlrpc.php\u5c01\u7981\u9a8c\u8bc1<\/strong>:<\/p>\n<p style=\"line-height: 1.6em; margin: 1em 0px;\">\u6253\u5f002\u4e2aSSH \u7ec8\u7aef\u8fde\u63a5\u670d\u52a1\u5668\u7a97\u53e3\uff0c\u4e00\u4e2a\u7528\u6765\u64cd\u4f5c\u767b\u5f55\uff0c\u53e6\u4e00\u4e2a\u7528\u6765\u770b\u65e5\u5fd7\u3002<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin: 1.25em 0px 0em; padding: 0px; list-style-type: decimal;\">\n<li style=\"padding-left: 0.1em; margin-left: 2em; margin-top: 0.1em; margin-bottom: 0.1em;\">\n<p style=\"line-height: 1.6em; margin: 0px;\"><strong style=\"color: #222222; font-weight: 600;\">\u76d1\u63a7\u65e5\u5fd7<\/strong>:<\/p>\n<section style=\"display: flex; background-color: #fafafa; border: 1px solid #f0f0f0;\">\n<pre style=\"margin: 0px; padding: 0px; overflow: auto;\"><code style=\"font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, 'Liberation Mono', 'Courier New', monospace; color: #5c5c5c; background: unset; font-size: 0.875em; vertical-align: baseline; padding: 1em; display: block; line-height: 1.75em;\">tail -f\u00a0<span style=\"color: #0e0eff;\">\/root\/my<\/span>_website<span style=\"color: #0e0eff;\">\/nginx\/<\/span>logs\/access.log\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: disc; margin: 0px; flex-shrink: 0; counter-reset: line 0; padding: 0.875em 0px 0.875em 0.875em; white-space: normal; width: fit-content;\">\n<li style=\"margin: 0px; font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, 'Liberation Mono', 'Courier New', monospace; padding: 0px; display: list-item; text-align: right; line-height: 1.75em; font-size: 0.875em; list-style-type: none; color: rgba(0, 0, 0, 0.25);\">\n<section><\/section>\n<\/li>\n<li style=\"padding-left: 0.1em; margin-left: 2em; margin-top: 0.1em; margin-bottom: 0.1em;\">\n<p style=\"line-height: 1.6em; margin: 0px;\"><strong style=\"color: #222222; font-weight: 600;\">\u7b49\u5f85\u65b0\u7684\u653b\u51fb\u65e5\u5fd7\u51fa\u73b0<\/strong>\u3002\u5f53\u4e0b\u4e00\u6761\u7c7b\u4f3c 5.101.157.127 &#8230; &#8220;POST \/xmlrpc.php &#8230;&#8221; \u7684\u65e5\u5fd7\u51fa\u73b0\u65f6\uff0cFail2ban \u5c31\u4f1a\u7acb\u523b\u5339\u914d\u5230\u5b83\u3002<\/p>\n<\/li>\n<li style=\"padding-left: 0.1em; margin-left: 2em; margin-top: 0.1em; margin-bottom: 0.1em;\">\n<p style=\"line-height: 1.6em; margin: 0px;\"><strong style=\"color: #222222; font-weight: 600;\">\u68c0\u67e5 Fail2ban \u72b6\u6001<\/strong>:<br \/>\n\u7a0d\u7b49\u7247\u523b\u540e\uff0c\u518d\u6b21\u6267\u884c\uff1a<\/p>\n<section style=\"display: flex; background-color: #fafafa; border: 1px solid #f0f0f0;\">\n<pre style=\"margin: 0px; padding: 0px; overflow: auto;\"><code style=\"font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, 'Liberation Mono', 'Courier New', monospace; color: #5c5c5c; background: unset; font-size: 0.875em; vertical-align: baseline; padding: 1em; display: block; line-height: 1.75em;\">fail2ban-<span style=\"color: #aa0d91;\">client<\/span>\u00a0status wordpress-xmlrpc\r\n<\/code><\/pre>\n<\/section>\n<\/li>\n<\/ul>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: disc; margin: 0px; flex-shrink: 0; counter-reset: line 0; padding: 0.875em 0px 0.875em 0.875em; white-space: normal; width: fit-content;\">\n<li style=\"margin: 0px; font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, 'Liberation Mono', 'Courier New', monospace; padding: 0px; display: list-item; text-align: right; line-height: 1.75em; font-size: 0.875em; list-style-type: none; color: rgba(0, 0, 0, 0.25);\">\n<section><\/section>\n<\/li>\n<\/ul>\n<p style=\"line-height: 1.6em; margin: 1em 0px;\">\u8fd9\u4e00\u6b21\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230 Currently failed \u548c Total failed \u7684\u8ba1\u6570\u589e\u52a0\u4e86\uff0c\u5e76\u4e14 Banned IP list \u4e2d\u51fa\u73b0\u4e86\u65b0\u7684\u88ab\u5c01\u7981\u7684 IP\u3002<\/p>\n<\/section>\n<section><\/section>\n<p style=\"display: none;\">\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u8fc7\u4e4b\u524d\u7684\u64cd\u4f5c\uff0c\u6211\u5df2\u7ecf\u642d\u5efa\u597d\u4e86wordpress\u4e2a\u4eba\u7f51\u7ad9\uff0c\u4f46\u6ca1\u8fc7\u591a\u4e45\uff0c\u5c31\u6536\u5230\u4e86\u670d\u52a1\u5668\u63d0\u4f9b\u5546\u544a\u8b66\uff1aCPU\u8d44\u6e90\u5360\u7528\u8fc7\u9ad8\u3002\u901a\u8fc7\u65e5\u5fd7\u6392\u67e5\uff08\u8fdb\u5165\u201cmy_website\u201d\u6587\u4ef6\u5939\u540e\uff0c\u8f93\u5165\u547d\u4ee4\uff1adocker logs wordpress_nginx 2&#038;g&#8230;<\/p>\n","protected":false},"author":1,"featured_media":652817,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127,136],"tags":[31],"topic":[342],"class_list":["post-652816","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-i","category-136","tag-wordpress","topic-wordpress"],"_links":{"self":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/652816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=652816"}],"version-history":[{"count":1,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/652816\/revisions"}],"predecessor-version":[{"id":652818,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/652816\/revisions\/652818"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/media\/652817"}],"wp:attachment":[{"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=652816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=652816"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=652816"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=652816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}