{"id":76,"date":"2024-02-28T05:49:05","date_gmt":"2024-02-28T05:49:05","guid":{"rendered":"https:\/\/blog.devops955.com\/swain\/?p=76"},"modified":"2025-02-22T03:31:02","modified_gmt":"2025-02-22T03:31:02","slug":"step-by-step-guide-to-deploying-wordpress-with-lemp-stack-2","status":"publish","type":"post","link":"https:\/\/blog.devops955.com\/swain\/zh\/2024\/02\/28\/step-by-step-guide-to-deploying-wordpress-with-lemp-stack-2\/","title":{"rendered":"\u624b\u628a\u624b\u6559\u4f60\u5982\u4f55\u4f7f\u7528 LEMP \u5806\u6808\u90e8\u7f72 WordPress"},"content":{"rendered":"<blockquote>\n<p>\u5927\u6982\u9605\u8bfb\u65f6\u95f4 24 \u5206\u949f<\/p>\n<\/blockquote>\n<h1>\u7b80\u4ecb<\/h1>\n<p>\u8fd9\u4efd\u7b14\u8bb0\u8bb0\u5f55\u4e86\u6211\u4f7f\u7528<strong>LEMP<\/strong>\u5806\u6808\u90e8\u7f72<strong>WordPress<\/strong>\u7f51\u7ad9\u7684\u8fc7\u7a0b\u3002\u5f00\u59cb\u4e4b\u524d\uff0c\u5148\u7b80\u8981\u4e86\u89e3\u4e00\u4e0bLEMP\u548cWordPress\u662f\u4ec0\u4e48\u3002<\/p>\n<p><strong>LEMP<\/strong>\u662f\u4e00\u4e2a\u9996\u5b57\u6bcd\u7f29\u5199\u8bcd\uff08\u4e0d\u662fLNMP\uff09\uff0c\u4ee3\u8868<strong>Linux<\/strong>\u3001<strong>Nginx<\/strong>\uff08\u53d1\u97f3\u4e3a&quot;Engine-X&quot;\uff09\u3001<strong>MySQL\/MariaDB<\/strong>\u4ee5\u53ca<strong>PHP<\/strong>\u3002\u5b83\u662f\u4e00\u4e2a\u5f3a\u5927\u4e14\u9ad8\u6548\u7684\u8f6f\u4ef6\u5806\u6808\uff0c\u5f53\u7136\uff0c\u53e6\u4e00\u79cd\u6d41\u884c\u7684\u662fLAMP\u5806\u6808\uff0c\u5b83\u5c06Nginx\u66ff\u6362\u4e3a<strong>Apache<\/strong>\uff0c\u4f46\u6211\u8d44\u6e90\u6709\u9650\uff0c\u76f4\u63a5\u4f7f\u7528Nginx\u4e86\u3002<\/p>\n<p>\u5728\u8fd9\u6b21\u90e8\u7f72\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528 <strong>Ubuntu 20.04<\/strong> \u4f5c\u4e3a\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u3002\u901a\u8fc7\u642d\u5efaLEMP\u518d\u5b89\u88c5WordPress\u6765\u90e8\u7f72\u4e00\u4e2aBlog\u7f51\u7ad9\u3002<\/p>\n<p><strong>WordPress<\/strong>\u662f\u4e16\u754c\u4e0a\u6700\u53d7\u6b22\u8fce\u7684\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf\uff08CMS\uff09\u3002\u5b83\u5141\u8bb8\u7528\u6237\u5728\u7f51\u4e0a\u521b\u5efa\u3001\u7ba1\u7406\u548c\u53d1\u5e03\u5185\u5bb9\uff0c\u800c\u4e0d\u9700\u8981\u9ad8\u7ea7\u7684\u6280\u672f\u6280\u80fd\u3002WordPress\u4ee5\u5176\u7b80\u5355\u6027\u3001\u7075\u6d3b\u6027\u548c\u5e9e\u5927\u7684\u4e3b\u9898\u4e0e\u63d2\u4ef6\u751f\u6001\u7cfb\u7edf\u800c\u95fb\u540d\uff0c\u540c\u6837\u8fd8\u6709\u5176\u4ed6\u9009\u62e9\uff0c\u4f8b\u5982Ghost\uff0c\u6216\u8005\u76f4\u63a5\u6258\u7ba1\u5230Github\u4e0a\u3002<\/p>\n<p>\u5728\u8fd9\u4e2a\u6307\u5357\u4e2d\uff0c\u6211\u5c06\u901a\u8fc7\u6211\u7684\u90e8\u7f72\u8fc7\u7a0b\uff0c\u5f15\u5bfc\u4f60\u5b8c\u6210\u5728LEMP\u5806\u6808\u4e0a\u8bbe\u7f6eWordPress\u7f51\u7ad9\u5e76\u5c3d\u91cf\u907f\u514d\u9047\u5230\u95ee\u9898\u3002<\/p>\n<p>\u95f2\u8bdd\u5c11\u8bf4\uff0c\u8fdb\u5165\u6b63\u9898\u3002<\/p>\n<h1>\u5b89\u88c5\u548c\u914d\u7f6eLEMP\u5806\u6808<\/h1>\n<p>\u5728\u6211\u4eec\u5b89\u88c5WordPress\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5728\u6211\u4eec\u7684Linux\u670d\u52a1\u5668\u4e0a\u8bbe\u7f6eLEMP\u5806\u6808\u3002\u8fd9\u91cc\u76f4\u63a5\u8df3\u8fc7\u4e86Ubuntu\u7684\u5b89\u88c5\u548c\u914d\u7f6e\uff0c\u76f8\u4fe1\u4f60\u5df2\u7ecf\u6709\u4e00\u5957Ubuntu 20.04\u670d\u52a1\u5668\u4e86\u3002<\/p>\n<h2>\u5b89\u88c5\u548c\u914d\u7f6eNginx<\/h2>\n<p>\u8981\u5728Ubuntu 20.04\u4e0a\u5b89\u88c5Nginx\uff0c\u76f4\u63a5\u53c2\u7167\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u4f60\u7684\u7ec8\u7aef\u6216\u901a\u8fc7SSH\u8fde\u63a5\u5230\u4f60\u7684\u670d\u52a1\u5668\uff08\u8fd9\u4e2a\u80af\u5b9a\u6ca1\u95ee\u9898\u5427\uff09\u3002<\/p>\n<\/li>\n<li>\n<p>\u66f4\u65b0\u5305\u5217\u8868\u4ee5\u786e\u4fdd\u4f60\u83b7\u5f97\u8f6f\u4ef6\u7684\u6700\u65b0\u7248\u672c\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo apt update<\/code><\/pre>\n<\/li>\n<li>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Nginx\uff0c\u5982\u679c\u60f3\u8981\u4f7f\u7528\u66f4\u591a\u6a21\u5757\u4e5f\u53ef\u4ee5\u5b89\u88c5extra\/full\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo apt install nginx -y<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u68c0\u67e5Nginx\u7684\u72b6\u6001\u4ee5\u786e\u4fdd\u5b83\u6b63\u5728\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl status nginx<\/code><\/pre>\n<p>\u5982\u679cNginx\u6ca1\u6709\u8fd0\u884c\uff0c\u4f60\u53ef\u4ee5\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u5b83\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl start nginx<\/code><\/pre>\n<p>\u5e76\u4e14\u4e0d\u8981\u5fd8\u8bb0\u8bbe\u7f6e\u81ea\u52a8\u542f\u52a8\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl is-enabled nginx<\/code><\/pre>\n<p>\u5982\u679c\u6ca1\u6709\u542f\u7528\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8bbe\u7f6e\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl enable nginx<\/code><\/pre>\n<\/li>\n<li>\n<p>\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u7528\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u4f60\u7684\u670d\u52a1\u5668\u7684IP\u5730\u5740\u6765\u6d4b\u8bd5Nginx\u662f\u5426\u6b63\u786e\u5b89\u88c5\u548c\u8fd0\u884c\u3002\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u9ed8\u8ba4\u7684Nginx\u6b22\u8fce\u9875\u9762\u3002<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u6ce8\u610f\uff1a\u4e0d\u8981\u5fd8\u8bb0\u914d\u7f6e\u9632\u706b\u5899\u4ee5\u786e\u4fdd\u8fdb\u5165\u6d41\u91cf\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u4f60\u7684\u670d\u52a1\u5668\u3002\u867d\u7136Ubuntu\u901a\u5e38\u4f7f\u7528<strong>UFW<\/strong>\uff08Uncomplicated Firewall\uff09\uff0c\u4f46\u6211\u5bf9 <strong>iptables<\/strong> \u66f4\u719f\u6089\uff0c\u6240\u4ee5\u6211\u5c06\u63d0\u4f9b\u4f7f\u7528iptables\u4f5c\u4e3a\u793a\u4f8b\u7684\u9632\u706b\u5899\u89c4\u5219\u3002\u8981\u5141\u8bb8Nginx\u9ed8\u8ba4\u4f7f\u7528\u7684\u7aef\u53e380\u4e0a\u7684HTTP\u6d41\u91cf\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5411iptables\u6dfb\u52a0\u89c4\u5219\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT<\/code><\/pre>\n<p>\u8fd9\u4e2a\u4f1a\u653e\u884cTCP\u7aef\u53e380\u7684\u6d41\u91cf\uff0c\u540e\u7eed\u53ef\u4ee5\u53c2\u7167\u653e\u884cTCP 443\u7aef\u53e3\uff0c\u5982\u679c\u4f60\u60f3\u4f7f\u7528HTTPS\u7684\u8bdd\u3002<\/p>\n<\/blockquote>\n<ol start=\"6\">\n<li>\n<p>\u914d\u7f6eNginx\u4ee5\u670d\u52a1\u4e8e\u4f60\u7684WordPress\u7f51\u7ad9\u3002\u4f60\u9700\u8981\u8fdb\u5165 <em>\/etc\/nginx\/sites-available<\/em> \u76ee\u5f55\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6587\u4ef6\uff08\u4e5f\u53ef\u4ee5\u76f4\u63a5\u521b\u5efa\u6587\u4ef6\uff0c\u8bb0\u5f97\u8def\u5f84\u6b63\u786e\uff09\u3002<\/p>\n<pre><code class=\"language-bash\">cd \/etc\/nginx\/sites-available\/<\/code><\/pre>\n<\/li>\n<li>\n<p>\u4e3a\u4f60\u7684WordPress\u7f51\u7ad9\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u7528\u4f60\u5b9e\u9645\u7684\u57df\u540d\u66ff\u6362 <em>blog.your_domain<\/em>\uff08\u6700\u597d\u7533\u8bf7\u4e00\u4e2a\u6b63\u5f0f\u57df\u540d\uff0c\u5982\u679c\u6d4b\u8bd5\u4e5f\u53ef\u4ee5\u7528IP\u6216\u8005\u4fee\u6539hosts\u6765\u8bbf\u95ee\uff09\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo vim blog.your_domain.conf<\/code><\/pre>\n<blockquote>\n<p>\u5728\u6b64\u4e4b\u524d\u4f60\u5e94\u8be5\u719f\u6089\u5982\u4f55\u4f7f\u7528<strong>vim<\/strong>\u4f5c\u4e3a\u6587\u672c\u7f16\u8f91\u5668\u3002\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u66f4\u76f4\u63a5\u7684\u7f16\u8f91\u5668\uff0c\u6bd4\u5982<strong>nano<\/strong>\uff0c\u4e0d\u7136\u7684\u8bdd\u5148\u627e\u4e00\u4e2a\u57fa\u672c\u7684vim\u6559\u7a0b\uff08\u6211\u6253\u7b97\u540e\u9762\u8bd5\u7740\u5199\u4e00\u70b9vim\u7684\u5185\u5bb9\uff0cvim\u8fd9\u4e2a\u7f16\u8f91\u5668\u7528\u719f\u4e86\u771f\u7684\u5f88\u5f3a\u5927\uff09\u3002<\/p>\n<\/blockquote>\n<\/li>\n<li>\n<p>\u5728\u65b0\u6587\u4ef6\u4e2d\u7684 <em>server<\/em> \u90e8\u5206\u6dfb\u52a0\u4e0b\u9762\u7684\u5185\u5bb9\u3002\u8fd9\u4e2a\u914d\u7f6e\u662f\u4e3a\u57fa\u672c\u7684WordPress\u7f51\u7ad9\u51c6\u5907\u7684\u3002\u786e\u4fdd\u7528\u4f60\u5b9e\u9645\u7684\u57df\u540d\u66ff\u6362 <em>blog.your_domain<\/em>\uff0c\u5e76\u4e14\u7528WordPress\u7a0d\u540e\u5c06\u8981\u5b89\u88c5\u7684\u6b63\u786e\u8def\u5f84\u66ff\u6362 <em>\/var\/www\/blog.your_domain<\/em> \u6216 <em>\/var\/www\/html\/blog.your_domain<\/em>\uff1a<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"language-nginx\">server {\n    listen 80;\n    server_name blog.your_domain;\n# \u6307\u5b9a\u4f60\u7684WordPress\u7684\u76ee\u5f55\uff08\u5f85\u4f1a\u513f\u9700\u8981\u5b89\u88c5\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\uff09\u3002\n    root \/var\/www\/blog.your_domain;  \n    index index.php index.html index.htm;\n\n    location \/ {\n        try_files $uri $uri\/ \/index.php?$args;\n    }\n# PHP\u5904\u7406\u90e8\u5206\uff1a\u914d\u7f6e.php\u6587\u4ef6\u7684\u5904\u7406\u65b9\u5f0f\u3002\n    location ~ \\.php$ {\n        include snippets\/fastcgi-php.conf;\n        fastcgi_pass unix:\/var\/run\/php\/php7.4-fpm.sock;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n# \u5b89\u5168\u6027\u914d\u7f6e\uff1a\u62d2\u7edd\u8bbf\u95ee\u9690\u85cf\u6587\u4ef6\u548c\u76ee\u5f55\uff08Linux\u91cc\u9762\u9690\u85cf\u6587\u4ef6\u4ee5.\u5f00\u5934\uff09\u3002\n    location ~ \/\\.ht {\n        deny all;\n    }\n# \u867d\u7136Nginx\u4e0d\u4f7f\u7528apache\u7684.htacess\u8fd9\u4e9b\u6587\u4ef6\uff0c\u4f46\u5982\u679c\u8fd9\u4e9b\u6587\u4ef6\u5b58\u5728\uff0c\u4e5f\u53ef\u4ee5\u9632\u6b62\u654f\u611f\u4fe1\u606f\u7684\u610f\u5916\u6cc4\u9732\uff08\u591a\u591a\u76ca\u5584\uff09\u3002\u5f53\u7136\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u89c4\u5219\u3002\n#    location ~ \/\\. {\n#    deny all;\n#    }\n\n    location = \/favicon.ico {\n        log_not_found off;\n        access_log off;\n    }\n\n    location = \/robots.txt {\n        allow all;\n        log_not_found off;\n        access_log off;\n    }\n}<\/code><\/pre>\n<ol start=\"9\">\n<li>\n<p>\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002\u901a\u8fc7 <em>sites-available<\/em> \u5230 <em>sites-enabled<\/em> \u7684\u8f6f\u94fe\u63a5\u6765\u542f\u7528\u8be5\u7ad9\u70b9\uff08\u76f8\u5f53\u4e8e\u5feb\u6377\u65b9\u5f0f\uff0c\u5728nginx.conf\u4e2d\u8981\u786e\u5b9a\u6709<code>include \/etc\/nginx\/sites-enabled\/*;<\/code> \u6765\u8bfb\u53d6\u5230\u8fd9\u91cc\u9762\u7684\u914d\u7f6e\u6587\u4ef6\uff09\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo ln -s \/etc\/nginx\/sites-available\/your_domain \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<\/li>\n<li>\n<p>\u6d4b\u8bd5\u4f60\u7684Nginx\u914d\u7f6e\u4ee5\u786e\u4fdd\u8bed\u6cd5\u6b63\u786e,\u901a\u5e38\u8fd9\u6837\u914d\u7f6e\u4e0d\u4f1a\u6709\u62a5\u9519\uff0c\u5982\u679c\u6709\u7684\u8bdd\u518d\u627e\u627eNginx\u76f8\u5173\u7684\u8d44\u6599\u5427\uff0c\u6ce8\u610f\u4e00\u4e0b\u6587\u4ef6\u6743\u9650\u95ee\u9898\uff0c\u914d\u7f6e\u91cc\u9762\u7684<code>{}<\/code>\u662f\u5426\u5339\u914d\uff0c\u6839\u636e\u6d4b\u8bd5\u7684\u62a5\u9519\u5e94\u8be5\u53ef\u4ee5\u5f88\u8f7b\u677e\u77e5\u9053\u95ee\u9898\u6240\u5728\u3002<\/p>\n<pre><code class=\"language-bash\">sudo nginx -t <\/code><\/pre>\n<\/li>\n<li>\n<p>\u5982\u679c\u6d4b\u8bd5\u6210\u529f\uff0c\u8bf7\u91cd\u65b0\u52a0\u8f7dNginx\u5e76\u5e94\u7528\u66f4\u6539\uff0c\u5426\u5219\u68c0\u67e5\u8f93\u51fa\u62a5\u9519\uff0c\u5e76\u91cd\u65b0\u6d4b\u8bd5\u76f4\u5230\u914d\u7f6e\u6b63\u786e\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl reload nginx<\/code><\/pre>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u5f53\u4f60\u4f7f\u7528\u547d\u4ee4 <code>sudo systemctl reload nginx<\/code> \u6216 <code>sudo nginx -s reload<\/code> \u65f6\uff0c\u4f60\u7684Nginx\u4f1a\u91cd\u65b0\u52a0\u8f7d\u5176\u914d\u7f6e\u6587\u4ef6\u800c\u4e0d\u4e2d\u65ad\u6b63\u5728\u8fdb\u884c\u7684\u8fde\u63a5\uff08\u8f6f\u91cd\u542f\uff09\u3002\u4ed6\u53ea\u4f1a\u5bf9\u65b0\u5efa\u7acb\u7684\u8fde\u63a5\u5e94\u7528\u66f4\u6539\u800c\u4e0d\u5f71\u54cd\u5f53\u524d\u5efa\u7acb\u8fde\u63a5\u7684\u7528\u6237\uff0c\u5bf9\u4e8e\u751f\u4ea7\u73af\u5883\u5341\u5206\u6709\u7528\u3002<br \/>\n\u5982\u679c\u4f60\u4f7f\u7528\u91cd\u542f\u547d\u4ee4\uff08\u5982 <code>sudo systemctl restart nginx<\/code>\uff09\u4f1a\u5b8c\u5168\u505c\u6b62\u7136\u540e\u518d\u6b21\u542f\u52a8Nginx\u670d\u52a1\u3002\u8fd9\u79cd\u65b9\u6cd5\u4f1a\u77ed\u6682\u4e2d\u65ad\u6d3b\u52a8\u8fde\u63a5\uff0c\u6d4b\u8bd5\u7684\u8bdd\u968f\u4fbf\u9009\u54ea\u79cd\u4e86\uff0c\u751f\u4ea7\u5c31\u8981\u7948\u7977\u6ca1\u4eba\u53d1\u73b0\u4e86\u3002<br \/>\n\u5f53\u7136\u5bf9\u4e8e\u50cf\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u8fd9\u6837\u7684\u66f4\u65b0\uff0c\u5efa\u8bae\u4f7f\u7528 <code>reload<\/code> \u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u66f4\u65b0\u914d\u7f6e\u800c\u4e0d\u5f71\u54cd\u6b63\u5728\u8fdb\u884c\u7684\u4e1a\u52a1\u6216\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n<\/blockquote>\n<h2>\u5b89\u88c5\u548c\u914d\u7f6e MySQL<\/h2>\n<p><strong>MySQL<\/strong> \u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08\u4e5f\u53ef\u4ee5\u7528MariaDB\uff09\uff0c\u7528\u4e8e\u5b58\u50a8\u548c\u7ba1\u7406\u6570\u636e\u3002\u8fd9\u91cc\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5b89\u88c5 MySQL \u5e76\u6267\u884c\u57fa\u672c\u7684\u5b89\u5168\u914d\u7f6e\u3002<\/p>\n<ol>\n<li>\n<p>\u5b89\u88c5 MySQL \u670d\u52a1\u5668\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo apt install mysql-server -y<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u68c0\u67e5 MySQL \u662f\u5426\u6b63\u5728\u8fd0\u884c\uff0c\u5e76\u786e\u4fdd\u5b83\u88ab\u8bbe\u7f6e\u4e3a\u5f00\u673a\u542f\u52a8\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl status mysql\nsudo systemctl is-enabled mysql<\/code><\/pre>\n<p>\u5982\u679c\u6ca1\u6709\u5f00\u673a\u542f\u52a8\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u542f\u52a8\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl start mysql\nsudo systemctl enable mysql<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u4f60\u53ef\u4ee5\u8fd0\u884c <em>MySQL<\/em> \u9644\u5e26\u7684\u9884\u6253\u5305\u5b89\u5168\u811a\u672c\uff08\u5bf9\u4e8e\u50cf\u6211\u8fd9\u6837\u7684\u5c0f\u767d\u5efa\u8bae\u8ddf\u7740\u505a\u4e00\u4e0b\uff09\u3002\u8fd9\u4e2a\u811a\u672c\u5c06\u5e2e\u52a9\u4f60\u63d0\u9ad8 MySQL \u5b89\u88c5\u7684\u5b89\u5168\u6027\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo mysql_secure_installation<\/code><\/pre>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u8fd9\u4e2a\u811a\u672c\u5c06\u5f15\u5bfc\u4f60\u901a\u8fc7\u51e0\u4e2a\u5b89\u5168\u6ce8\u610f\u4e8b\u9879\uff0c\u5305\u62ec\u8bbe\u7f6e root \u5bc6\u7801\uff08\u5982\u679c\u672a\u8bbe\u7f6e\uff09\u3001\u5220\u9664\u533f\u540d\u7528\u6237\u3001\u7981\u7528\u8fdc\u7a0b root \u767b\u5f55\u4ee5\u53ca\u5220\u9664\u6d4b\u8bd5\u6570\u636e\u5e93\u3002\u5efa\u8bae\u63a5\u53d7\u9ed8\u8ba4\u8bbe\u7f6e\uff0c\u8fd9\u4e9b\u8bbe\u7f6e\u80fd\u591f\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u5b89\u5168\u6027\uff0c\u8fd9\u91cc\u5c31\u4e0d\u5217\u4e3e\u5177\u4f53\u6b65\u9aa4\u4e86\uff0c\u53c2\u7167\u63d0\u793a\u5e94\u8be5\u5f88\u5bb9\u6613\u5b8c\u6210\u3002<\/p>\n<\/blockquote>\n<p>\u73b0\u5728 MySQL \u5df2\u7ecf\u5b89\u88c5\u5e76\u52a0\u56fa\uff0c\u4e0b\u4e00\u6b65\u662f\u4e3a WordPress \u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u548c\u7528\u6237\u3002WordPress \u4f7f\u7528\u6570\u636e\u5e93\u6765\u7ba1\u7406\u548c\u5b58\u50a8\u7ad9\u70b9\u53ca\u7528\u6237\u4fe1\u606f\uff0c\u56e0\u6b64\u5728\u5b89\u88c5 WordPress \u4e4b\u524d\u8981\u8bbe\u7f6e\u597d\u6570\u636e\u5e93\u3002<\/p>\n<ol start=\"4\">\n<li>\n<p>\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u767b\u5f55 MySQL root \u7ba1\u7406\u5458\u8d26\u6237\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo mysql -u root -p<\/code><\/pre>\n<p>\u8f93\u5165\u4e4b\u524d\u8bbe\u7f6e\u7684 root \u5bc6\u7801\u767b\u5f55\u8fdb\u53bb\u3002<\/p>\n<\/li>\n<li>\n<p>\u767b\u5f55\u540e\uff0c\u4e3a WordPress \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u3002\u7528\u4f60\u60f3\u7ed9\u6570\u636e\u5e93\u8d77\u7684\u540d\u5b57\u66ff\u6362 <em>wordpressdb<\/em> \u5b57\u6bb5\uff1a<\/p>\n<pre><code class=\"language-sql\">CREATE DATABASE wordpressdb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;<\/code><\/pre>\n<\/li>\n<li>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 MySQL \u7528\u6237\u8d26\u6237\uff0c\u8fd9\u4e2a\u8d26\u6237\u5c06\u4e13\u95e8\u7ed9 WordPress \u4f7f\u7528\u3002\u7528\u4f60\u60f3\u4f7f\u7528\u7684\u7528\u6237\u540d\u66ff\u6362 <em>wordpressuser<\/em> \u5b57\u6bb5\uff0c\u5e76\u7528\u4e00\u4e2a<strong>\u5f3a\u5bc6\u7801<\/strong>\u66ff\u6362 <em>password<\/em>\u5b57\u6bb5\uff1a<\/p>\n<pre><code class=\"language-sql\">CREATE USER &#039;wordpressuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;password&#039;;<\/code><\/pre>\n<\/li>\n<li>\n<p>\u6388\u4e88\u65b0\u521b\u5efa\u7684 <em>wordpressuser<\/em> \u7528\u6237\u5bf9 WordPress \u6570\u636e\u5e93\u7684\u5168\u90e8\u6743\u9650\uff0c\u7136\u540e\u5237\u65b0 MySQL \u6743\u9650\u4ee5\u786e\u4fdd\u5b83\u4eec\u88ab\u5e94\u7528\u5e76\u4fdd\u5b58\uff1a<\/p>\n<pre><code class=\"language-sql\">GRANT ALL PRIVILEGES ON wordpressdb.* TO &#039;wordpressuser&#039;@&#039;localhost&#039;;\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n<p>\u5b8c\u6210\u4e86\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0c\u4f60\u5e94\u8be5\u5df2\u7ecf\u6210\u529f\u521b\u5efa\u4e86\u4e00\u4e2a\u4e13\u7528\u7684\u6570\u636e\u5e93\u548c\u7528\u6237\u7ed9 WordPress \u4f7f\u7528\u3002\u8fd9\u4e9b\u51ed\u636e\u5c06\u5728 WordPress \u914d\u7f6e\u7684\u65f6\u5019\u4f7f\u7528\uff0c\u8ba9 WordPress \u80fd\u6b63\u786e\u8fde\u63a5\u5230\u6570\u636e\u5e93\u5e76\u5b58\u50a8\u7f51\u7ad9\u7684\u6570\u636e\u3002<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u4e00\u5b9a\u8bb0\u4f4f\u4fdd\u5b58\u597d\u6570\u636e\u5e93\u540d\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\u5426\u5219\u540e\u9762\u8bbe\u7f6e WordPress \u5c31\u9ebb\u70e6\u4e86\u3002<\/p>\n<\/blockquote>\n<h2>\u5b89\u88c5\u548c\u914d\u7f6e PHP<\/h2>\n<p>WordPress \u662f\u7528 <strong>PHP<\/strong> \u7f16\u5199\u7684\uff0c\u5e76\u4e14\u9700\u8981\u5b83\u6765\u6267\u884c\u5176\u811a\u672c\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u5b89\u88c5 PHP \u4ee5\u53ca\u4e00\u4e9b WordPress \u6b63\u5e38\u8fd0\u884c\u6240\u9700\u7684\u5e38\u7528\u6a21\u5757\u3002<\/p>\n<ol>\n<li>\n<p>\u5b89\u88c5 PHP \u548c\u5fc5\u8981\u7684 PHP \u6269\u5c55\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5 PHP \u4ee5\u53ca WordPress \u6240\u9700\u7684\u5e38\u7528\u6269\u5c55\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo apt install php-fpm php-mysql php-gd php-xml php-mbstring php-curl php-xmlrpc php-imagick php-zip -y<\/code><\/pre>\n<\/li>\n<li>\n<p>\u68c0\u67e5 PHP \u7248\u672c\u4ee5\u786e\u8ba4\u5b83\u5df2\u6b63\u786e\u5b89\u88c5\uff1a<\/p>\n<pre><code class=\"language-bash\">php -v<\/code><\/pre>\n<p>\u4f60\u5e94\u8be5\u4f1a\u770b\u5230 PHP \u7248\u672c\u4fe1\u606f\u663e\u793a\uff0c\u786e\u8ba4 PHP \u5df2\u6210\u529f\u5b89\u88c5\u5728\u4f60\u7684\u7cfb\u7edf\u4e0a\u3002<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>WordPress \u901a\u5e38\u53ef\u4ee5\u5728\u9ed8\u8ba4\u7684 PHP \u8bbe\u7f6e\u4e0b\u6b63\u786e\u8fd0\u884c\u3002\u5982\u679c\u9700\u8981\uff0c\u4f60\u53ef\u4ee5\u5728 php.ini \u6587\u4ef6\u4e2d\u8c03\u6574 PHP \u914d\u7f6e\u4ee5\u63d0\u9ad8\u6027\u80fd\u548c\u5b89\u5168\u6027\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\u4e0a\u4f20\u6587\u4ef6\u5927\u5c0f\u53ef\u4ee5\u6539\u4e00\u4e0b\uff0c\u5982\u679c\u4f60\u9700\u8981\u4e0a\u4f20\u6bd4\u8f83\u5927\u7684\u5185\u5bb9\uff0c\u9ed8\u8ba4\u53ea\u67092MB\u3002<br \/>\n\u5e38\u89c1\u7684\u4f4d\u7f6e\u5305\u62ec <code>\/etc\/php\/[version]\/cli\/php.ini<\/code> \u6216\u8005 <code>\/etc\/php\/[version]\/fpm\/php.ini<\/code>\u3002\u901a\u8fc7\u4fee\u6539\u5176\u4e2d\u7684 upload \u548c post \u5b57\u6bb5\u6765\u8c03\u6574\u5927\u5c0f\uff1a<\/p>\n<pre><code class=\"language-php\">upload_max_filesize = 50M\npost_max_size = 50M<\/code><\/pre>\n<\/blockquote>\n<ol start=\"3\">\n<li>\n<p>\u786e\u4fdd <strong>PHP-FPM<\/strong>\uff08FastCGI Process Manager\uff09\u662f\u6d3b\u8dc3\u7684\u5e76\u4e14\u6b63\u5728\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl status php{version}-fpm<\/code><\/pre>\n<p>\u5c06 {version} \u66ff\u6362\u4e3a\u4f60\u7684 PHP \u7248\u672c\u3002\u5982\u679c\u6ca1\u6709\u8fd0\u884c\uff0c\u4f60\u53ef\u4ee5\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u5b83\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl start php{version}-fpm<\/code><\/pre>\n<\/li>\n<li>\n<p>\u73b0\u5728\uff0cPHP \u5e94\u8be5\u5df2\u7ecf\u8bbe\u7f6e\u597d\u5e76\u53ef\u4ee5\u5f00\u59cb\u4f60\u7684 WordPress \u5b89\u88c5\u3002\u6700\u540e\u786e\u4fdd PHP-FPM \u5728\u670d\u52a1\u5668\u542f\u52a8\u65f6\u4e5f\u8981\u81ea\u52a8\u542f\u52a8\u3002\u548c\u524d\u9762\u4e00\u6837\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl enable php{version}-fpm<\/code><\/pre>\n<\/li>\n<\/ol>\n<h1>\u5b89\u88c5\u548c\u914d\u7f6e WordPress<\/h1>\n<h2>\u5b89\u88c5 WordPress<\/h2>\n<p>\u65e2\u7136 LEMP \u5806\u6808\u5df2\u7ecf\u5b8c\u5168\u914d\u7f6e\u597d\u4e86\uff0c\u73b0\u5728\u53ea\u9700\u8981\u5b89\u88c5 WordPress \u5c31\u53ef\u4ee5\u8f7b\u677e\u542f\u52a8\u4f60\u7684\u7f51\u7ad9\u4e86\u3002<\/p>\n<ol>\n<li>\u4e0b\u8f7d WordPress\uff1a<br \/>\n\u9996\u5148\uff0c\u8fdb\u5165\u5230\u4f60\u7f51\u7ad9\u7684\u6839\u76ee\u5f55\uff08\u4e5f\u53ef\u4ee5\u653e\u5728\u4e34\u65f6\u76ee\u5f55<code>\/tmp<\/code>\uff0c\u8bb0\u5f97\u89e3\u538b\u65f6\u6ce8\u610f\u8def\u5f84\uff09\u3002\u5c06 <em>blog.your_domain<\/em> \u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u7684\u57df\u540d\u6216\u76ee\u5f55\u8def\u5f84\uff1a<\/p>\n<pre><code class=\"language-bash\">cd \/var\/www\/blog.your_domain<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u7136\u540e\uff0c\u4f7f\u7528 <strong>wget<\/strong> \u547d\u4ee4\u4e0b\u8f7d\u6700\u65b0\u7684 WordPress \u53d1\u5e03\u7248\u672c\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo wget https:\/\/wordpress.org\/latest.tar.gz<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u6ca1\u6709 wget\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 <code>sudo apt install wget<\/code> \u6765\u5b89\u88c5\u5b83\uff0c\u4e5f\u53ef\u4ee5\u7528 <strong>curl<\/strong> \u6765\u5b8c\u6210\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo curl -O https:\/\/wordpress.org\/latest.tar.gz<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u89e3\u538b WordPress\uff1a<br \/>\n\u5c06 WordPress \u89e3\u538b\u5230\u5f53\u524d\u76ee\u5f55\uff0c\u7136\u540e\u6e05\u7406\u6389\u4e34\u65f6\u6587\u4ef6\u548c\u76ee\u5f55\uff0c\u4f7f\u7528 <strong>rm<\/strong> \u65f6\u9700\u8981\u591a\u52a0\u6ce8\u610f\u3002<\/p>\n<pre><code class=\"language-bash\">tar -xzvf latest.tar.gz\nmv wordpress\/* .\/\nrmdir wordpress\nmv latest.tar.gz \/tmp<\/code><\/pre>\n<\/li>\n<li>\n<p>\u8c03\u6574\u6240\u6709\u6743\u548c\u6743\u9650\uff1a<br \/>\n\u8c03\u6574\u6587\u4ef6\u7684\u6240\u6709\u6743\u548c\u6743\u9650\uff0c\u4ee5\u786e\u4fdd WordPress \u80fd\u591f\u6b63\u5e38\u5de5\u4f5c\uff08\u9ed8\u8ba4\u60c5\u51b5\u5e94\u8be5\u662f\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u7684\uff09\u3002\u5982\u679c\u4e0d\u884c\uff0c\u8bf7\u68c0\u67e5\u6743\u9650\uff0c\u6267\u884c\u547d\u4ee4\u65f6\u5c06 <em>www-data<\/em>\uff08\u9ed8\u8ba4\u7528\u6237\uff09 \u66ff\u6362\u4e3a\u4f60\u7684 Web \u670d\u52a1\u5668\u7528\u6237\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo chown -R www-data:www-data \/var\/www\/blog.your_domain<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2>\u914d\u7f6e WordPress<\/h2>\n<ol>\n<li>\u8bbe\u7f6e WordPress\uff1a<br \/>\n\u590d\u5236 WordPress \u793a\u4f8b\u914d\u7f6e\u6587\u4ef6\u6765\u521b\u5efa\u4e00\u4e2a\u65b0\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-bash\">cp wp-config-sample.php wp-config.php<\/code><\/pre>\n<p>\u7136\u540e\u7f16\u8f91 <em>wp-config.php<\/em> \u6587\u4ef6\uff0c\u6dfb\u52a0\u4f60\u7684\u6570\u636e\u5e93\u8fde\u63a5\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<pre><code class=\"language-bash\">sudo vim wp-config.php<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u586b\u5199\u6570\u636e\u5e93\u4fe1\u606f\uff0c\u8f93\u5165\u4f60\u5728 MySQL \u8bbe\u7f6e\u6b65\u9aa4\u4e2d\u521b\u5efa\u7684\u540d\u79f0\u3001\u7528\u6237\u548c\u5bc6\u7801\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff0c\u8bf7\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\uff1a<\/p>\n<pre><code class=\"language-php\">\/** The name of the database for WordPress *\/\ndefine( &#039;DB_NAME&#039;, &#039;wordpressdb&#039; ); \/\/ \u5c06 &#039;wordpressdb&#039; \u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u7684\u6570\u636e\u5e93\u540d\u79f0\n\n\/** Database username *\/\ndefine( &#039;DB_USER&#039;, &#039;wordpressuser&#039; ); \/\/ \u5c06 &#039;wordpressuser&#039; \u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u7684\u6570\u636e\u5e93\u7528\u6237\u540d\n\n\/** Database password *\/\ndefine( &#039;DB_PASSWORD&#039;, &#039;password&#039; ); \/\/ \u5c06 &#039;password&#039; \u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u7684\u6570\u636e\u5e93\u5bc6\u7801\n\n\/** Database hostname *\/\ndefine( &#039;DB_HOST&#039;, &#039;localhost&#039; ); \/\/ \u901a\u5e38\u662f &#039;localhost&#039;\uff0c\u4f46\u5982\u679c\u4f60\u7684\u8bbe\u7f6e\u4e0d\u540c\u5c31\u9700\u8981\u4fee\u6539\n\n\/** Database charset to use in creating database tables. *\/\ndefine( &#039;DB_CHARSET&#039;, &#039;utf8&#039; ); \/\/ \u63a8\u8350\u4fdd\u7559\u4e3a &#039;utf8&#039;\u7f16\u7801\n\n\/** The database collate type. Don&#039;t change this if in doubt. *\/\ndefine( &#039;DB_COLLATE&#039;, &#039;&#039; ); \/\/ \u4e0d\u7528\u6539<\/code><\/pre>\n<ol start=\"2\">\n<li>\u6b22\u8fce\u5f00\u59cb WordPress \u4e4b\u65c5\uff01<br \/>\n\u73b0\u5728\uff0c\u5728\u7f51\u9875\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u4f60\u7684\u7f51\u7ad9 <em><a href=\"http:\/\/blog.your_domain\">http:\/\/blog.your_domain<\/a><\/em>\u3002\u4f60\u5e94\u8be5\u4f1a\u770b\u5230 WordPress \u5b89\u88c5\u5f15\u5bfc\u9875\u9762\u3002\u6309\u7167\u5c4f\u5e55\u4e0a\u7684\u6307\u793a\u9009\u62e9\u8bed\u8a00\uff0c\u5e76\u586b\u5199\u7ad9\u70b9\u4fe1\u606f\u548c\u7ba1\u7406\u5458\u8be6\u7ec6\u4fe1\u606f\uff08\u4e00\u5b9a\u8981\u8bb0\u5f55\u597d\uff0c\u7ad9\u70b9\u7684\u7ba1\u7406\u9700\u8981\u7528\u5230\uff09\u3002\u5b8c\u6210\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0c\u4f60\u7684 WordPress \u7f51\u7ad9\u5e94\u8be5\u5df2\u5b89\u88c5\u5e76\u53ef\u4ee5\u4f7f\u7528\uff0c\u540c\u65f6\u5e94\u8be5\u751f\u6210\u4e86\u4e00\u4e2a sample \u9875\u9762\u3002\u4f46\u5728\u4f60\u5f00\u59cb\u53d1\u5e03\u5185\u5bb9\u4e4b\u524d\uff0c\u4f60\u5e94\u8be5<strong>\u542f\u7528HTTPS<\/strong>\u3002<\/li>\n<\/ol>\n<h1>\u7528 HTTPS \u4fdd\u62a4\u4f60\u7684 WordPress \u7f51\u7ad9<\/h1>\n<p>\u5728\u5f53\u4eca\u7684\u7f51\u7edc\u73af\u5883\u4e2d\uff0c\u786e\u4fdd\u4f60\u7684\u7f51\u7ad9\u4f7f\u7528 HTTPS \u81f3\u5173\u91cd\u8981\u3002<strong>HTTPS<\/strong> \u52a0\u5bc6\u4e86\u7528\u6237\u7684\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u548c\u4f60\u7684\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u6570\u636e\uff0c\u4f7f\u653b\u51fb\u8005\u66f4\u96be\u62e6\u622a\u548c\u7be1\u6539\u6570\u636e\u3002\u8fd9\u5bf9\u4e8e\u50cf WordPress \u535a\u5ba2\u8fd9\u6837\u7684\u7f51\u7ad9\u5c24\u5176\u91cd\u8981\uff0c\u4f60\u4e00\u5b9a\u4f1a\u63d0\u4ea4\u4e2a\u4eba\u4fe1\u606f\uff08\u8d26\u53f7\u3001\u5bc6\u7801\u7b49\u7b49\uff09\u3002<\/p>\n<p>\u5728\u63a5\u4e0b\u6765\u7684\u6307\u5357\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528 <strong>Let's Encrypt<\/strong> \u63d0\u4f9b\u7684\u514d\u8d39\u3001\u81ea\u52a8\u5316\u548c\u5f00\u653e\u7684\u8bc1\u4e66\u6765\u914d\u7f6e HTTPS\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 <strong>Certbot<\/strong> \u6765\u8f7b\u677e\u5730\u4ece Let's Encrypt \u83b7\u53d6\u548c\u66f4\u65b0\u8bc1\u4e66\u3002<\/p>\n<h2>\u5b89\u88c5\u548c\u914d\u7f6e Certbot<\/h2>\n<p>1a. \u5b89\u88c5 Certbot \u548c Nginx \u63d2\u4ef6\u81ea\u52a8\u5316\u7533\u8bf7\u5b89\u88c5\u8bc1\u4e66\uff08\u8bf4\u5b9e\u8bdd\uff0c\u6211\u6ca1\u6d4b\u8bd5\u8fc7\uff0c\u4f46\u662f\u770b\u8d77\u6765\u5e94\u8be5\u5341\u5206\u7b80\u5355\uff09\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo apt install certbot python3-certbot-nginx<\/code><\/pre>\n<p>2a. \u83b7\u53d6\u8bc1\u4e66\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 --nginx \u53c2\u6570\u6765\u81ea\u52a8\u83b7\u53d6\u5e76\u5b89\u88c5\u8bc1\u4e66\uff0c\u5e76\u8ba9\u5b83\u5e2e\u4f60\u914d\u7f6e Nginx \u5e76\u4f7f\u7528\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo certbot --nginx<\/code><\/pre>\n<p>\u6309\u7167\u63d0\u793a\u8f93\u5165\u4f60\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff0c\u540c\u610f\u670d\u52a1\u6761\u6b3e\uff0c\u5e76\u51b3\u5b9a\u662f\u5426\u8981\u5c06 HTTP \u6d41\u91cf\u91cd\u5b9a\u5411\u5230 HTTPS\uff08\u63a8\u8350\u8fd9\u6837\u505a\uff09\u3002<\/p>\n<p>\u5982\u679c\u8fd9\u4e2a\u65b9\u6cd5\u4e0d\u592a\u987a\u5229\uff08\u6216\u8005\u6700\u5f00\u59cb\u6ca1\u53d1\u73b0\u8fd9\u79cd\u65b9\u6cd5...\uff09\uff0c\u4f60\u53ef\u4ee5\u5c1d\u8bd5\u624b\u52a8\u7533\u8bf7\u8bc1\u4e66\u5e76\u5728 Nginx \u4e0a\u914d\u7f6e HTTPS\uff0c\u53ea\u9700\u8981\u53c2\u8003\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<p>1b. \u624b\u52a8\u83b7\u53d6\u8bc1\u4e66\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo certbot certonly<\/code><\/pre>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u4f1a\u83b7\u53d6\u8bc1\u4e66\uff0c\u4f46\u4e0d\u4f1a\u4fee\u6539\u4f60\u7684 Nginx \u914d\u7f6e\u3002\u8f93\u5165\u6b64\u547d\u4ee4\u540e\uff0c\u6309\u7167\u63d0\u793a\u9009\u62e9 <code>2: Sgin up a temporary webserver (standalone)<\/code> \u5b8c\u6210\u9a8c\u8bc1\u8fc7\u7a0b\u3002\u5927\u81f4\u662f\u4ee5\u4e0b\u51e0\u6b65\uff1a<\/p>\n<ul>\n<li>\u8f93\u5165\u4f60\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3002<\/li>\n<li>\u540c\u610f\u670d\u52a1\u6761\u6b3e\u3002<\/li>\n<li>\u8f93\u5165\u4f60\u60f3\u8981\u83b7\u53d6\u8bc1\u4e66\u7684\u57df\u540d\u3002<\/li>\n<li>\u7b49\u5f85\u9a8c\u8bc1\u901a\u8fc7\u7b7e\u53d1\u8bc1\u4e66\u3002<\/li>\n<\/ul>\n<blockquote>\n<p>\u6ce8\u610f\uff1a\u83b7\u5f97\u7684\u8bc1\u4e66\u9ed8\u8ba4\u4f1a\u5b58\u50a8\u5728 <em>\/etc\/letsencrypt\/live\/your_domain\/<\/em>\u3002\u8bb0\u4f4f\u8fd9\u4e2a\u8def\u5f84\uff0c\u56e0\u4e3a\u4f60\u5c06\u7528\u5b83\u5728\u540e\u9762\u914d\u7f6e Nginx \u4f7f\u7528 SSL \u8bc1\u4e66\u3002<\/p>\n<\/blockquote>\n<p>2b. \u914d\u7f6e Nginx \u4f7f\u7528 SSL \u8bc1\u4e66<br \/>\n\u4e00\u65e6\u4f60\u6709\u4e86\u8bc1\u4e66\uff0c\u4f60\u9700\u8981\u914d\u7f6e Nginx \u6765\u4f7f\u7528\u5b83\u3002\u9996\u5148\uff0c\u6253\u5f00\u4f60\u57df\u540d\u7684 Nginx \u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo vim \/etc\/nginx\/sites-available\/blog.your_domain<\/code><\/pre>\n<p>\u5728 <strong>server<\/strong> \u90e8\u5206\u914d\u7f6e\u542f\u7528 HTTPS\uff0c\u5c06 <em>blog.your_domain<\/em> \u66ff\u6362\u4e3a\u4f60\u7684\u5b9e\u9645\u57df\u540d\uff1a<\/p>\n<pre><code class=\"language-nginx\">server {\n    listen 443 ssl http2;  # \u542f\u7528 HTTPS\uff0c\u901a\u5e38\u76d1\u542c443\u7aef\u53e3\n    server_name blog.your_domain;\n    ssl_certificate \/etc\/letsencrypt\/live\/your_domain\/fullchain.pem;  # \u521a\u624d\u7684\u8bc1\u4e66\u4fdd\u5b58\u4f4d\u7f6e\n    ssl_certificate_key \/etc\/letsencrypt\/live\/your_domain\/privkey.pem;  #\u670d\u52a1\u5668\u7684\u79c1\u94a5\n\n    # ... (\u5176\u4ed6\u914d\u7f6e)\n\n}<\/code><\/pre>\n<p>\u5982\u679c\u8981\u4fdd\u7559 http \u8bbf\u95ee\uff0c\u5efa\u8bae\u5c06\u5b83<strong>\u91cd\u5b9a\u5411<\/strong>\u5230 https\uff0c\u8fd9\u6837\u66f4\u52a0\u5b89\u5168\uff08\u4e5f\u53ef\u4ee5\u5b8c\u5168\u4e0d\u4f7f\u7528http\uff09\uff1a<\/p>\n<pre><code class=\"language-nginx\">server {\n    listen 80;\n    server_name blog.your_domain;\n    return 301 https:\/\/$server_name$request_uri;\n}<\/code><\/pre>\n<ol start=\"3\">\n<li>\u6d4b\u8bd5\u548c\u91cd\u65b0\u52a0\u8f7d Nginx \u914d\u7f6e<br \/>\n\u66f4\u65b0\u914d\u7f6e\u540e\uff0c\u6d4b\u8bd5\u4ee5\u786e\u4fdd\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo nginx -t<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u5982\u679c\u6d4b\u8bd5\u6210\u529f\uff0c\u91cd\u65b0\u52a0\u8f7d Nginx \u4ee5\u5e94\u7528\u66f4\u6539\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl reload nginx<\/code><\/pre>\n<ol start=\"4\">\n<li>SSL \u8bc1\u4e66\u7684\u81ea\u52a8\u7eed\u671f<br \/>\nLet's Encrypt \u8bc1\u4e66\u7684\u6709\u6548\u671f\u4e3a 90 \u5929\u3002\u4f46\u662f\u5728\u5b89\u88c5\u4e86 Certbot \u540e\uff0c\u5e94\u8be5\u4f1a\u81ea\u52a8\u8bbe\u7f6e\u4e00\u4e2a <em>timer<\/em> \u5728\u8bc1\u4e66\u5230\u671f\u524d\u81ea\u52a8\u7eed\u671f\uff08\u9ed8\u8ba4\u6bcf\u5929\u68c0\u67e52\u6b21\uff1f\uff09\u3002<br \/>\n\u8981\u9a8c\u8bc1\u81ea\u52a8\u7eed\u671f\u8fc7\u7a0b\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo systemctl list-timers | grep certbot<\/code><\/pre>\n<p>\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u4e00\u4e2a\u5b9a\u65f6\u5668\u6761\u76ee\uff0c\u4f8b\u5982 <strong>certbot.timer<\/strong>\u3002\u8fd9\u8868\u793a\u5df2\u8bbe\u7f6e\u4e00\u4e2a systemd \u5b9a\u65f6\u5668\u6765\u5904\u7406\u7eed\u671f\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u8981\u6d4b\u8bd5\u7eed\u671f\u662f\u5426\u6b63\u5e38\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u624b\u52a8\u89e6\u53d1\u5b83\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo certbot renew --dry-run<\/code><\/pre>\n<blockquote>\n<p>--dry-run \u9009\u9879\u53ea\u4f1a\u6a21\u62df\u7eed\u671f\u8fc7\u7a0b\uff0c\u800c\u4e0d\u4f1a\u5bf9\u4f60\u5f53\u524d\u8bc1\u4e66\u505a\u4efb\u4f55\u5b9e\u9645\u66f4\u6539\u3002\u5982\u679c\u8fd9\u4e2a\u547d\u4ee4\u8fd0\u884c\u6ca1\u6709\u4efb\u4f55\u9519\u8bef\uff0c\u4f60\u7684\u81ea\u52a8\u7eed\u671f\u8bbe\u7f6e\u5e94\u8be5\u914d\u7f6e\u6b63\u786e\uff0c\u5426\u5219\u7684\u8bdd\u5c31\u53ea\u80fd\u7b49\u7740\u6536\u5230\u7eed\u671f\u5931\u8d25\u7684\u90ae\u4ef6\u53bb\u624b\u52a8\u7eed\u671f\u4e86\u3002 <\/p>\n<\/blockquote>\n<h1>\u603b\u7ed3<\/h1>\n<p>\u73b0\u5728\uff0c\u4f60\u5e94\u8be5\u5df2\u7ecf\u5b8c\u6210\u4e86\u8fd9\u4e2a LEMP \u5806\u6808\u90e8\u7f72 WordPress \u7684\u6307\u5357\uff01\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u4f60\u5e94\u8be5\u5df2\u7ecf\u5728\u81ea\u5df1\u7684 LEMP \u670d\u52a1\u5668\u4e0a\u6210\u529f\u90e8\u7f72\u4e86\u4e00\u4e2a\u6b63\u5e38\u8fd0\u884c\u7684 WordPress \u7f51\u7ad9\u3002\u5e0c\u671b\u8fd9\u4e2a\u6587\u6863\u6e05\u6670\u76f4\u89c2\uff0c\u6ca1\u6709\u8ba9\u4f60\u9047\u5230\u5176\u4ed6\u7684\u56f0\u96be\u3002<\/p>\n<p>\u4e00\u5f00\u59cb\u7684\u65f6\u5019\u90e8\u7f72 WordPress \u7f51\u7ad9\u770b\u8d77\u6765\u662f\u4e00\u9879\u8270\u5de8\u7684\u4efb\u52a1\uff0c\u56e0\u4e3a\u6211\u6ca1\u4ec0\u4e48\u7ecf\u9a8c\uff0c\u4f46\u73b0\u5728\u770b\u770b\u4f3c\u4e4e\u548c\u7ec4\u88c5\u73a9\u5177\u4e00\u6837\u7b80\u5355\uff08\u5427\uff1f\uff09\u3002\u8fd9\u4e2a\u6587\u6863\u5e94\u8be5\u8bb2\u6e05\u695a\u4e86\u8bbe\u7f6e Linux\u3001Nginx\u3001MySQL \u548c PHP \u7684\u7ec6\u8282\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u9057\u6f0f\u6216\u8005\u9047\u5230\u4ec0\u4e48\u95ee\u9898\uff0c\u76f8\u4fe1\u4f60\u5df2\u7ecf\u7528\u9ad8\u8d85\u7684\u6280\u5de7\u89e3\u51b3\u4e86\uff08\u5427\uff1f\uff09\u3002<\/p>\n<p>\u5efa\u7acb WordPress Blog \u7684\u65c5\u7a0b\u5176\u5b9e\u624d\u521a\u521a\u5f00\u59cb\uff0c\u63a5\u4e0b\u6765\u4f60\u8fd8\u8981\u548c\u65b0 WordPress \u7f51\u7ad9\u5171\u540c\u5192\u9669\uff0c\u5c1d\u8bd5\u4e0d\u540c\u7684\u4e3b\u9898\u3001\u63d2\u4ef6\u548c\u8bbe\u7f6e\uff0c\u4f7f\u4f60\u7684\u7f51\u7ad9\u66f4\u52a0\u7f8e\u89c2\uff0c\u72ec\u4e00\u65e0\u4e8c\u3002\u6700\u91cd\u8981\u7684\u662f\uff0c\u7ee7\u7eed\u5b66\u4e60\u548c\u63a2\u7d22 \u672a\u6765\u5e7f\u9614\u7684\u53ef\u80fd\u6027\u3002<\/p>\n<p>\u5982\u679c\u4f60\u9047\u5230\u4efb\u4f55\u969c\u788d\uff0c\u4e0d\u8981\u72b9\u8c6b\uff0c\u56de\u987e\u4e00\u904d\u8fc7\u7a0b\uff0c\u5f53\u7136\uff0c\u4f60\u8fd8\u53ef\u4ee5\u5bfb\u627e\u5176\u4ed6\u7684\u4e30\u5bcc\u5e76\u4e14\u66f4\u5b9e\u7528\uff0c\u66f4\u7ec6\u81f4\u7684\u6307\u5bfc\u3002\u5305\u62ec WordPress \u548c\u5f00\u53d1\u8005\u793e\u533a\u90fd\u6709\u76f8\u5f53\u591a\u7684\u8d44\u6599\uff0c\u5e76\u4e14\u5341\u5206\u6709\u7528\u3002<\/p>\n<p>\u6700\u540e\u7684\u6700\u540e\uff0c\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u7ed9\u4f60\u5e26\u6765\u5e2e\u52a9\uff0c\u81f3\u5c11\u5728\u5b8c\u6210\u4e86\u8fd9\u6837\u4e00\u4ef6\u4e8b\u4e4b\u540e\uff0c\u8fd8\u662f\u6709\u4e0d\u5c11\u7684\u6210\u5c31\u611f\u548c\u6ee1\u8db3\u611f\uff0c\u5e0c\u671b\u81ea\u5df1\u80fd\u591f\u575a\u6301\u4e0b\u53bb\uff0c\u7ee7\u7eed\u5b8c\u5584\uff0c\u5e76\u4e14\u5206\u4eab\u66f4\u591a\u7684\u5185\u5bb9\u7ed9\u9700\u8981\u7684\u4eba\u3002\u5728\u8fd9\u4e2a\u4e16\u754c\u7559\u4e0b\u4e00\u70b9\u5b58\u5728\u7684\u75d5\u8ff9\u3002<\/p>\n<blockquote>\n<p>\u53c2\u8003\u7f51\u7ad9<br \/>\n<a href=\"https:\/\/developer.wordpress.org\/advanced-administration\/server\/web-server\/nginx\/\">https:\/\/developer.wordpress.org\/advanced-administration\/server\/web-server\/nginx\/<\/a><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u6982\u9605\u8bfb\u65f6\u95f4 24 \u5206\u949f \u7b80\u4ecb \u8fd9\u4efd\u7b14\u8bb0\u8bb0\u5f55\u4e86\u6211\u4f7f\u7528LEMP\u5806\u6808\u90e8\u7f72WordPress\u7f51\u7ad9\u7684\u8fc7\u7a0b\u3002\u5f00\u59cb\u4e4b\u524d\uff0c\u5148\u7b80\u8981\u4e86\u89e3\u4e00\u4e0bLEMP\u548cWordPress\u662f\u4ec0\u4e48\u3002 LEMP\u662f\u4e00\u4e2a\u9996\u5b57\u6bcd\u7f29\u5199\u8bcd\uff08\u4e0d\u662fLNMP\uff09\uff0c\u4ee3\u8868Linux\u3001Nginx\uff08\u53d1\u97f3\u4e3a&quot;Engine-X&quot;\uff09\u3001MySQL\/MariaDB\u4ee5\u53caPHP\u3002\u5b83\u662f\u4e00\u4e2a\u5f3a\u5927\u4e14\u9ad8\u6548\u7684\u8f6f\u4ef6\u5806\u6808\uff0c\u5f53\u7136\uff0c\u53e6\u4e00\u79cd\u6d41\u884c\u7684\u662fLAMP\u5806\u6808\uff0c\u5b83\u5c06Nginx\u66ff\u6362\u4e3aApache\uff0c\u4f46\u6211\u8d44\u6e90\u6709\u9650\uff0c\u76f4\u63a5\u4f7f\u7528Nginx\u4e86\u3002 \u5728\u8fd9\u6b21\u90e8\u7f72\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528 Ubuntu 20.04 \u4f5c\u4e3a\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u3002\u901a\u8fc7\u642d\u5efaLEMP\u518d\u5b89\u88c5WordPress\u6765\u90e8\u7f72\u4e00\u4e2aBlog\u7f51\u7ad9\u3002 WordPress\u662f\u4e16\u754c\u4e0a\u6700\u53d7\u6b22\u8fce\u7684\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf\uff08CMS\uff09\u3002\u5b83\u5141\u8bb8\u7528\u6237\u5728\u7f51\u4e0a\u521b\u5efa\u3001\u7ba1\u7406\u548c\u53d1\u5e03\u5185\u5bb9\uff0c\u800c\u4e0d\u9700\u8981\u9ad8\u7ea7\u7684\u6280\u672f\u6280\u80fd\u3002WordPress\u4ee5\u5176\u7b80\u5355\u6027\u3001\u7075\u6d3b\u6027\u548c\u5e9e\u5927\u7684\u4e3b\u9898\u4e0e\u63d2\u4ef6\u751f\u6001\u7cfb\u7edf\u800c\u95fb\u540d\uff0c\u540c\u6837\u8fd8\u6709\u5176\u4ed6\u9009\u62e9\uff0c\u4f8b\u5982Ghost\uff0c\u6216\u8005\u76f4\u63a5\u6258\u7ba1\u5230Github\u4e0a\u3002 \u5728\u8fd9\u4e2a\u6307\u5357\u4e2d\uff0c\u6211\u5c06\u901a\u8fc7\u6211\u7684\u90e8\u7f72\u8fc7\u7a0b\uff0c\u5f15\u5bfc\u4f60\u5b8c\u6210\u5728LEMP\u5806\u6808\u4e0a\u8bbe\u7f6eWordPress\u7f51\u7ad9\u5e76\u5c3d\u91cf\u907f\u514d\u9047\u5230\u95ee\u9898\u3002 \u95f2\u8bdd\u5c11\u8bf4\uff0c\u8fdb\u5165\u6b63\u9898\u3002 \u5b89\u88c5\u548c\u914d\u7f6eLEMP\u5806\u6808 \u5728\u6211\u4eec\u5b89\u88c5WordPress\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5728\u6211\u4eec\u7684Linux\u670d\u52a1\u5668\u4e0a\u8bbe\u7f6eLEMP\u5806\u6808\u3002\u8fd9\u91cc\u76f4\u63a5\u8df3\u8fc7\u4e86Ubuntu\u7684\u5b89\u88c5\u548c\u914d\u7f6e\uff0c\u76f8\u4fe1\u4f60\u5df2\u7ecf\u6709\u4e00\u5957Ubuntu 20.04\u670d\u52a1\u5668\u4e86\u3002 \u5b89\u88c5\u548c\u914d\u7f6eNginx \u8981\u5728Ubuntu 20.04\u4e0a\u5b89\u88c5Nginx\uff0c\u76f4\u63a5\u53c2\u7167\u4ee5\u4e0b\u6b65\u9aa4\uff1a \u6253\u5f00\u4f60\u7684\u7ec8\u7aef\u6216\u901a\u8fc7SSH\u8fde\u63a5\u5230\u4f60\u7684\u670d\u52a1\u5668\uff08\u8fd9\u4e2a\u80af\u5b9a\u6ca1\u95ee\u9898\u5427\uff09\u3002 \u66f4\u65b0\u5305\u5217\u8868\u4ee5\u786e\u4fdd\u4f60\u83b7\u5f97\u8f6f\u4ef6\u7684\u6700\u65b0\u7248\u672c\uff1a sudo apt update \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Nginx\uff0c\u5982\u679c\u60f3\u8981\u4f7f\u7528\u66f4\u591a\u6a21\u5757\u4e5f\u53ef\u4ee5\u5b89\u88c5extra\/full\uff1a sudo apt install nginx -y \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u68c0\u67e5Nginx\u7684\u72b6\u6001\u4ee5\u786e\u4fdd\u5b83\u6b63\u5728\u8fd0\u884c\uff1a sudo systemctl status nginx \u5982\u679cNginx\u6ca1\u6709\u8fd0\u884c\uff0c\u4f60\u53ef\u4ee5\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u5b83\uff1a sudo systemctl start nginx \u5e76\u4e14\u4e0d\u8981\u5fd8\u8bb0\u8bbe\u7f6e\u81ea\u52a8\u542f\u52a8\uff1a sudo systemctl is-enabled nginx \u5982\u679c\u6ca1\u6709\u542f\u7528\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8bbe\u7f6e\uff1a sudo systemctl enable nginx \u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u7528\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u4f60\u7684\u670d\u52a1\u5668\u7684IP\u5730\u5740\u6765\u6d4b\u8bd5Nginx\u662f\u5426\u6b63\u786e\u5b89\u88c5\u548c\u8fd0\u884c\u3002\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u9ed8\u8ba4\u7684Nginx\u6b22\u8fce\u9875\u9762\u3002 \u6ce8\u610f\uff1a\u4e0d\u8981\u5fd8\u8bb0\u914d\u7f6e\u9632\u706b\u5899\u4ee5\u786e\u4fdd\u8fdb\u5165\u6d41\u91cf\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u4f60\u7684\u670d\u52a1\u5668\u3002\u867d\u7136Ubuntu\u901a\u5e38\u4f7f\u7528UFW\uff08Uncomplicated Firewall\uff09\uff0c\u4f46\u6211\u5bf9 iptables \u66f4\u719f\u6089\uff0c\u6240\u4ee5\u6211\u5c06\u63d0\u4f9b\u4f7f\u7528iptables\u4f5c\u4e3a\u793a\u4f8b\u7684\u9632\u706b\u5899\u89c4\u5219\u3002\u8981\u5141\u8bb8Nginx\u9ed8\u8ba4\u4f7f\u7528\u7684\u7aef\u53e380\u4e0a\u7684HTTP\u6d41\u91cf\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5411iptables\u6dfb\u52a0\u89c4\u5219\uff1a&#8230;<\/p>\n","protected":false},"author":3,"featured_media":75,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[27],"tags":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/blog.devops955.com\/swain\/wp-content\/uploads\/sites\/2\/2024\/02\/wp.png","_links":{"self":[{"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/posts\/76"}],"collection":[{"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":6,"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":552,"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/posts\/76\/revisions\/552"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/media\/75"}],"wp:attachment":[{"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.devops955.com\/swain\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}