{"id":238535,"date":"2022-04-05T08:32:10","date_gmt":"2022-04-05T00:32:10","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=238535"},"modified":"2022-03-24T13:33:08","modified_gmt":"2022-03-24T05:33:08","slug":"wordpress-mysql","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/wordpress-mysql.html","title":{"rendered":"\u5982\u4f55\u628a WordPress \u7f51\u7ad9\u8fc1\u79fb\u5230\u65b0\u4e3b\u673a"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4f7f\u7528\u8fd9\u4e2a\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u8fc1\u79fb\u4e00\u4e2a\u7f51\u7ad9\u4ee5\u53ca\u7ba1\u7406\u9632\u706b\u5899\u914d\u7f6e\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4f60\u6709\u8fc7\u628a\u4e00\u4e2a WordPress \u7f51\u7ad9\u8fc1\u79fb\u5230\u4e00\u53f0\u65b0\u4e3b\u673a\u4e0a\u7684\u9700\u6c42\u5417\uff1f\u6211\u66fe\u7ecf\u8fc1\u79fb\u8fc7\u597d\u591a\u6b21\uff0c\u8fc1\u79fb\u8fc7\u7a0b\u76f8\u5f53\u7b80\u5355\u3002\u5f53\u7136\uff0c\u7684\u7684\u5e02\u573a\u65f6\u5019\u6211\u90fd\u4e0d\u4f1a\u7528\u901a\u7528\u7684\u63a8\u8350\u65b9\u6cd5\uff0c\u8fd9\u6b21\u4e5f\u4e0d\u4f8b\u5916 \u2014\u2014 \u6211\u7528\u66f4\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u8fd9\u624d\u662f\u6211\u63a8\u8350\u7684\u65b9\u6cd5\u3002<\/p>\n

\u8fd9\u4e2a\u8fc1\u79fb\u65b9\u6cd5\u6ca1\u6709\u7834\u574f\u6027\uff0c\u56e0\u6b64\u5982\u679c\u51fa\u4e8e\u67d0\u4e9b\u539f\u56e0\u4f60\u9700\u8981\u8fd8\u539f\u5230\u539f\u6765\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u5f88\u5bb9\u6613\u53ef\u4ee5\u5b9e\u73b0\u3002<\/p>\n

\u4e00\u4e2a WordPress \u7f51\u7ad9\u7684\u7ec4\u6210\u90e8\u5206<\/strong><\/div>\n

\u8fd0\u884c\u4e00\u4e2a\u57fa\u4e8e WordPress \u7684\u7f51\u7ad9\u6709\u4e09\u4e2a\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff1aWordPress \u672c\u8eab\uff0c\u4e00\u4e2a web<\/span> \u670d\u52a1\u5668\uff0c\u5982 Apache<\/span>\uff08\u6211\u6b63\u5728\u7528\uff09\uff0c\u4ee5\u53ca MariaDB<\/span>\u3002MariaDB<\/span> \u662f MySQL<\/span> \u7684\u4e00\u4e2a\u5206\u652f\uff0c\u529f\u80fd\u76f8\u4f3c\u3002<\/p>\n

\u4e1a\u754c\u6709\u5927\u91cf\u7684 Web<\/span> \u670d\u52a1\u5668\uff0c\u7531\u4e8e\u6211\u4f7f\u7528\u4e86 Apache<\/span> \u5f88\u957f\u65f6\u95f4\uff0c\u56e0\u6b64\u6211\u63a8\u8350\u7528 Apache<\/span>\u3002\u4f60\u53ef\u80fd\u9700\u8981\u628a Apache<\/span> \u7684\u914d\u7f6e\u65b9\u6cd5\u6539\u6210\u4f60\u7528\u7684 Web \u670d\u52a1\u5668\u7684\u65b9\u6cd5\u3002<\/p>\n

\u521d\u59cb\u914d\u7f6e<\/strong><\/div>\n

\u6211\u4f7f\u7528\u4e00\u53f0 Linux \u4e3b\u673a\u4f5c\u4e3a\u9632\u706b\u5899\u548c\u7f51\u7edc\u8def\u7531\u3002\u5728\u6211\u7684\u7f51\u7edc\u4e2d Web<\/span> \u670d\u52a1\u5668\u662f\u53e6\u4e00\u53f0\u4e3b\u673a\u3002\u6211\u7684\u5185\u90e8\u7f51\u7edc\u4f7f\u7528\u7684\u662f C \u7c7b\u79c1\u6709\u7f51\u7edc\u5730\u5740\u8303\u56f4\uff0c\u6309 \u65e0\u7c7b\u522b\u57df\u95f4\u8def\u7531\u65b9\u5f0f\u7b80\u5355\u5730\u8bb0\u4f5c 192.168.0.0\/24\u3002<\/p>\n

\u5bf9\u4e8e\u9632\u706b\u5899\uff0c\u76f8\u6bd4\u4e8e\u66f4\u590d\u6742\u7684 firewalld<\/span>\uff0c\u6211\u66f4\u559c\u6b22\u7528\u975e\u5e38\u7b80\u5355\u7684 IPTables<\/span>\u3002\u8fd9\u4efd\u9632\u706b\u5899\u914d\u7f6e\u4e2d\u7684\u4e00\u884c\u4f1a\u628a 80 \u7aef\u53e3\uff08HTTP\uff09\u63a5\u6536\u5230\u7684\u5305\u53d1\u9001\u7ed9 Web<\/span> \u670d\u52a1\u5668\u3002\u5728 \/etc\/sysconfig\/iptables <\/span>\u6587\u4ef6\u4e2d\uff0c\u4f60\u53ef\u4ee5\u5728\u6ce8\u91ca\u4e2d\u770b\u5230\uff0c\u6211\u6dfb\u52a0\u4e86\u89c4\u5219\uff0c\u628a\u5176\u4ed6\u5165\u7ad9\u670d\u52a1\u5668\u8fde\u63a5\u8f6c\u53d1\u5230\u540c\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u5408\u9002\u7684\u7aef\u53e3\u3002<\/p>\n

# Reroute ports for inbound connections to the appropriate web\/email\/etc server.\r\n# HTTPD goes to 192.168.0.75\r\n-A PREROUTING -d 45.20.209.41\/255.255.255.248 -p tcp -m tcp --dport 80 \\\r\n  -j DNAT --to-destination 192.168.0.75:80\r\n<\/pre>\n

\u6211\u4f7f\u7528\u547d\u540d\u865a\u62df\u4e3b\u673a\u6765\u914d\u7f6e\u539f\u6765\u7684 Apache Web<\/span> \u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u6211\u5728\u8fd9\u4e2a HTTPD<\/span> \u5b9e\u4f8b\u4e0a\u8fd0\u884c\u7740\u591a\u4e2a\u7f51\u7ad9\u3002\u4f7f\u7528\u547d\u540d\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u662f\u4e2a\u4e0d\u9519\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\uff08\u50cf\u6211\u4e00\u6837\uff09\u672a\u6765\u4f60\u53ef\u80fd\u4f1a\u5728\u8fd0\u884c\u5176\u4ed6\u7684\u7f51\u7ad9\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u4f7f\u5176\u53d8\u5f97\u5bb9\u6613\u3002<\/p>\n

\/etc\/httpd\/conf\/httpd.conf <\/span>\u4e2d\u9700\u8981\u8fc1\u79fb\u7684\u865a\u62df\u4e3b\u673a\u7684\u7f51\u7ad9\u76f8\u5173\u90e8\u5206\u8bf7\u53c2\u8003\u4e0b\u9762\u4ee3\u7801\u3002\u8fd9\u4e2a\u7247\u6bb5\u4e2d\u4e0d\u6d89\u53ca\u5230 IP \u5730\u5740\u7684\u4fee\u6539\uff0c\u56e0\u6b64\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u65f6\u4e0d\u9700\u8981\u4fee\u6539\u3002<\/p>\n

\r\n   ServerName www.website1.org\r\n   ServerAlias server.org\r\nDocumentRoot \"\/var\/website1\/html\"\r\n   ErrorLog \"logs\/error_log\"\r\n   ServerAdmin me@website1.org\r\n \r\n<Directory \"\/var\/website1\/html\">\r\n      Options Indexes FollowSymLinks\r\n \r\nAllowOverride None\r\n      Require all granted\r\n \r\n\r\n\r\n<\/pre>\n

\u5728\u8fc1\u79fb\u4e4b\u524d\uff0c\u4f60\u9700\u8981\u5728 httpd.conf <\/span>\u7684\u6700\u9876\u7aef\u9644\u8fd1\u627e\u5230 Listen <\/span>\u58f0\u660e\u5e76\u4fee\u6539\u6210\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\u3002\u8fd9\u4e2a\u5730\u5740\u662f\u670d\u52a1\u5668\u7684\u771f\u5b9e\u79c1\u6709 IP \u5730\u5740\uff0c\u4e0d\u662f\u516c\u5f00 IP \u5730\u5740\u3002<\/p>\n

Listen 192.168.0.75:80\r\n<\/pre>\n

\u4f60\u9700\u8981\u4fee\u6539\u65b0\u4e3b\u673a\u4e0a Listen<\/span> \u7684 IP \u5730\u5740\u3002<\/p>\n

\u524d\u671f\u5de5\u4f5c<\/strong><\/div>\n

\u51c6\u5907\u5de5\u4f5c\u5206\u4e3a\u4ee5\u4e0b\u4e09\u6b65\uff1a<\/p>\n

1.\u5b89\u88c5\u670d\u52a1
\n2.\u914d\u7f6e\u9632\u706b\u5899
\n3.\u914d\u7f6e web \u670d\u52a1\u5668<\/p>\n

\u5b89\u88c5 Apache \u548c MariaDB<\/strong><\/div>\n

\u5982\u679c\u4f60\u7684\u65b0\u670d\u52a1\u5668\u4e0a\u8fd8\u6ca1\u6709 Apache<\/span> \u548c MariaDB<\/span>\uff0c\u90a3\u4e48\u5c31\u5b89\u88c5\u5b83\u4eec\u3002WordPress \u7684\u5b89\u88c5\u4e0d\u662f\u5fc5\u8981\u7684\u3002<\/p>\n

dnf -y install httpd mariadb\r\n<\/pre>\n
\u65b0\u670d\u52a1\u5668\u9632\u706b\u5899\u914d\u7f6e<\/strong><\/div>\n

\u786e\u8ba4\u4e0b\u65b0\u670d\u52a1\u5668\u4e0a\u7684\u9632\u706b\u5899\u5141\u8bb8\u8bbf\u95ee 80 \u7aef\u53e3\u3002\u4f60_\u6bcf\u53f0_\u7535\u8111\u4e0a\u90fd\u6709\u4e00\u4e2a\u9632\u706b\u5899\uff0c\u5bf9\u5417\uff1f\u5927\u90e8\u5206\u73b0\u4ee3\u53d1\u884c\u7248\u4f7f\u7528\u7684\u521d\u59cb\u5316\u914d\u7f6e\u5305\u542b\u7684\u9632\u706b\u5899\u4f1a\u963b\u6b62\u6240\u6709\u8fdb\u6765\u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u4ee5\u6b64\u6765\u63d0\u9ad8\u5b89\u5168\u7b49\u7ea7\u3002<\/p>\n

\u4e0b\u9762\u7247\u6bb5\u7684\u7b2c\u4e00\u884c\u5185\u5bb9\u53ef\u80fd\u5df2\u7ecf\u5728\u4f60\u7684 IPTables<\/span> \u6216\u5176\u4ed6\u57fa\u4e8e\u9632\u706b\u5899\u7684\u7f51\u7edc\u8fc7\u6ee4\u5668\u4e2d\u5b58\u5728\u4e86\u3002\u5b83\u6807\u8bc6\u5df2\u7ecf\u88ab\u8bc6\u522b\u4e3a\u6765\u81ea\u53ef\u63a5\u53d7\u6765\u6e90\u7684\u5165\u7ad9\u5305\uff0c\u5e76\u7ed5\u8fc7\u540e\u9762\u7684\u5176\u5b83 INPUT<\/span> \u8fc7\u6ee4\u89c4\u5219\uff0c\u8fd9\u6837\u53ef\u4ee5\u8282\u7701\u65f6\u95f4\u548c CPU \u5468\u671f\u3002\u7247\u6bb5\u4e2d\u6700\u540e\u4e00\u884c\u6807\u8bc6\u5e76\u653e\u884c 80 \u7aef\u53e3\u65b0\u8fdb\u6765\u7684\u8bf7\u6c42\u5230 HTTPD<\/span> \u7684\u8fde\u63a5\u3002<\/p>\n

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\r\n<\u5220\u8282>\r\n# HTTP\r\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT\r\n<\/pre>\n

\u4e0b\u9762\u7684\u793a\u4f8b \/etc\/sysconfig\/iptables<\/span> \u6587\u4ef6\u662f IPTables<\/span> \u6700\u5c11\u89c4\u5219\u7684\u4f8b\u5b50\uff0c\u53ef\u4ee5\u5141\u8bb8 SSH<\/span>\uff08\u7aef\u53e3 22\uff09\u548c HTTPD<\/span>\uff08\u7aef\u53e3 80\uff09\u8fde\u63a5\u3002<\/p>\n

*filter\r\n:INPUT ACCEPT [0:0]\r\n:FORWARD ACCEPT [0:0]\r\n:OUTPUT ACCEPT [0:0]\r\n-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\r\n-A INPUT -p icmp -j ACCEPT\r\n-A INPUT -i lo -j ACCEPT\r\n# SSHD\r\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT\r\n# HTTP\r\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT\r\n# Final disposition for unmatched packets\r\n-A INPUT -j REJECT --reject-with icmp-host-prohibited\r\n-A FORWARD -j REJECT --reject-with icmp-host-prohibited\r\nCOMMIT\r\n<\/pre>\n

\u5728\u65b0\u670d\u52a1\u5668\u4e3b\u673a\u4e0a\u6211\u9700\u8981\u505a\u7684\u5c31\u662f\u5728 \/etc\/sysconfig\/iptables<\/span> \u6587\u4ef6\u7684\u9632\u706b\u5899\u89c4\u5219\u91cc\u6dfb\u52a0\u4e0a\u9762\u7247\u6bb5\u7684\u6700\u540e\u4e00\u884c\uff0c\u7136\u540e\u91cd\u65b0\u52a0\u8f7d\u4fee\u6539\u540e\u7684\u89c4\u5219\u96c6\u3002<\/p>\n

iptables-restore \/etc\/sysconfig\/iptables\r\n<\/pre>\n

\u5927\u90e8\u5206\u57fa\u4e8e\u7ea2\u5e3d\u7684\u53d1\u884c\u7248\u672c\uff0c\u5982 Fedora\uff0c\u4f7f\u7528\u7684\u662f firewalld<\/span>\u3002\u6211\u53d1\u73b0\u5bf9\u4e8e\u5b83\u7684\u9002\u7528\u573a\u666f\uff08\u5982\u5bb6\u7528\u3001\u5c0f\u5230\u4e2d\u578b\u4f01\u4e1a\uff09\u800c\u8a00\uff0c\u5b83\u8fc7\u4e8e\u590d\u6742\uff0c\u56e0\u6b64\u6211\u4e0d\u7528\u5b83\u3002\u6211\u5efa\u8bae\u4f60\u53c2\u7167 firewalld<\/span> \u7f51\u9875 \u6765\u5411 firewalld<\/span> \u6dfb\u52a0\u5165\u7ad9\u7aef\u53e3 80\u3002<\/p>\n

\u4f60\u7684\u9632\u706b\u5899\u53ca\u5176\u914d\u7f6e\u53ef\u80fd\u8ddf\u8fd9\u4e2a\u6709\u4e9b\u5dee\u5f02\uff0c\u4f46\u6700\u7ec8\u7684\u76ee\u7684\u662f\u5141\u8bb8\u65b0 Web \u670d\u52a1\u5668 80 \u7aef\u53e3\u63a5\u6536 HTTPD \u8fde\u63a5\u3002<\/p>\n

HTTPD \u914d\u7f6e<\/strong><\/div>\n

\u5728 \/etc\/httpd\/conf\/httpd.conf <\/span>\u6587\u4ef6\u4e2d\u914d\u7f6e HTTPD<\/span>\u3002\u50cf\u4e0b\u9762\u4e00\u6837\u5728 Listen <\/span>\u7247\u6bb5\u4e2d\u8bbe\u7f6e IP \u5730\u5740\u3002\u6211\u7684\u65b0 Web \u670d\u52a1\u5668 IP \u5730\u5740\u662f 192.168.0.125\u3002<\/p>\n

Listen 192.168.0.125:80\r\n<\/pre>\n

\u590d\u5236\uff08\u5bf9\u5e94\u8981\u8fc1\u79fb\u7684\u7f51\u7ad9\u7684\uff09 VirtualHost<\/span> \u7247\u6bb5\uff0c\u7c98\u8d34\u5230\u65b0\u670d\u52a1\u5668\u4e0a httpd.conf<\/span> \u6587\u4ef6\u7684\u672b\u5c3e\u3002<\/p>\n

\u8fc1\u79fb\u8fc7\u7a0b<\/strong><\/div>\n

\u53ea\u6709\u4e24\u7ec4\u6570\u636e\u9700\u8981\u8fc1\u79fb\u5230\u65b0\u670d\u52a1\u5668 \u2014\u2014 \u6570\u636e\u5e93\u672c\u8eab\u548c\u7f51\u7ad9\u76ee\u5f55\u7ed3\u6784\u3002\u628a\u4e24\u4e2a\u76ee\u5f55\u6253\u5305\u6210 tar \u6587\u6863\u3002<\/p>\n

cd \/var ; tar -cvf \/tmp\/website.tar website1\/\r\ncd \/var\/lib ; tar -cvf \/tmp\/database.tar mysql\/\r\n<\/pre>\n

\u628a\u4e24\u4e2a tar \u6587\u4ef6\u590d\u5236\u5230\u65b0\u670d\u52a1\u5668\u3002\u6211\u901a\u5e38\u4f1a\u628a\u8fd9\u7c7b\u6587\u4ef6\u653e\u5230 \/tmp<\/span> \u4e0b\uff0c\u8fd9\u4e2a\u76ee\u5f55\u5c31\u662f\u7528\u6765\u505a\u8fd9\u79cd\u4e8b\u7684\u3002\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u628a tar \u6587\u6863\u89e3\u538b\u5230\u6b63\u786e\u7684\u76ee\u5f55\u3002<\/p>\n

cd \/var ; tar -xvf \/tmp\/website.tar\r\ncd \/var\/lib ; tar -xvf \/tmp\/database.tar\r\n<\/pre>\n

WordPress <\/span>\u7684\u6240\u6709\u6587\u4ef6\u90fd\u5728 \/var\/website1<\/span> \u4e0b\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u5728\u65b0\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u5b83\u3002\u65b0\u670d\u52a1\u5668\u4e0a\u4e0d\u9700\u8981\u6267\u884c WordPress <\/span>\u5b89\u88c5\u8fc7\u7a0b\u3002<\/p>\n

\u8fd9\u4e2a\u76ee\u5f55\u5c31\u662f\u9700\u8981\u8fc1\u79fb\u5230\u65b0\u670d\u52a1\u5668\u4e0a\u7684\u5168\u90e8\u5185\u5bb9\u3002<\/p>\n

\u6700\u540e\u4e00\u6b65\u662f\u542f\u52a8\uff08\u6216\u91cd\u542f\uff09mysqld <\/span>\u548c httpd <\/span>\u670d\u52a1\u5b88\u62a4\u8fdb\u7a0b\u3002WrodPress <\/span>\u4e0d\u662f\u4e00\u4e2a\u670d\u52a1\uff0c\u56e0\u6b64\u4e0d\u4f7f\u7528\u5b88\u62a4\u8fdb\u7a0b\u7684\u65b9\u5f0f\u6765\u542f\u52a8\u3002<\/p>\n

systemctl start mysqld ; systemctl start httpd\r\n<\/pre>\n

\u542f\u52a8\u4e4b\u540e\uff0c\u4f60\u5e94\u8be5\u68c0\u67e5\u4e0b\u8fd9\u4e9b\u670d\u52a1\u7684\u72b6\u6001\u3002<\/p>\n

systemctl status mysqld\r\n\u25cf mariadb.service - MariaDB 10.5 database server\r\n    Loaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: disabled)\r\n    Active: active (running) since Sat 2021-08-21 14:03:44 EDT; 4 days ago\r\n        Docs: man:mariadbd(8)\r\nhttps:\/\/mariadb.com\/kb\/en\/library\/systemd\/\r\n   Process: 251783 ExecStartPre=\/usr\/libexec\/mariadb-check-socket (code=exited, status=0\/SUCCESS)\r\n   Process: 251805 ExecStartPre=\/usr\/libexec\/mariadb-prepare-db-dir mariadb.service (code=exited, status=0\/SUCCESS)\r\n   Process: 251856 ExecStartPost=\/usr\/libexec\/mariadb-check-upgrade (code=exited, status=0\/SUCCESS)\r\n Main PID: 251841 (mariadbd)\r\n      Status: \"Taking your SQL requests now...\"\r\n      Tasks: 15 (limit: 19003)\r\n    Memory: 131.8M\r\n        CPU: 1min 31.793s\r\n    CGroup: \/system.slice\/mariadb.service\r\n\u2514\u2500251841 \/usr\/libexec\/mariadbd --basedir=\/usr\r\nAug 21 14:03:43 simba.stmarks-ral.org systemd[1]: Starting MariaDB 10.5 database server...\r\nAug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: Database MariaDB is probably initialized in \/var\/lib\/mysql already, n>\r\nAug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: If this is not the case, make sure the \/var\/lib\/mysql is empty before>\r\nAug 21 14:03:44 simba.stmarks-ral.org mariadbd[251841]: 2021-08-21 14:03:44 0 [Note] \/usr\/libexec\/mariadbd (mysqld 10.5.11-MariaDB) startin>\r\nAug 21 14:03:44 simba.stmarks-ral.org systemd[1]: Started MariaDB 10.5 database server.\r\nsystemctl status httpd\r\n\u25cf httpd.service - The Apache HTTP Server\r\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/httpd.service; enabled; vendor preset: disabled)\r\n   Drop-In: \/usr\/lib\/systemd\/system\/httpd.service.d\r\n\u2514\u2500php-fpm.conf\r\n      Active: active (running) since Sat 2021-08-21 14:08:39 EDT; 4 days ago\r\n        Docs: man:httpd.service(8)\r\n   Main PID: 252458 (httpd)\r\n      Status: \"Total requests: 10340; Idle\/Busy workers 100\/0;Requests\/sec: 0.0294; Bytes served\/sec: 616 B\/sec\"\r\n        Tasks: 278 (limit: 19003)\r\n      Memory: 44.7M\r\n        CPU: 2min 31.603s\r\n   CGroup: \/system.slice\/httpd.service\r\n\u251c\u2500252458 \/usr\/sbin\/httpd -DFOREGROUND\r\n\u251c\u2500252459 \/usr\/sbin\/httpd -DFOREGROUND\r\n\u251c\u2500252460 \/usr\/sbin\/httpd -DFOREGROUND\r\n\u251c\u2500252461 \/usr\/sbin\/httpd -DFOREGROUND\r\n\u251c\u2500252462 \/usr\/sbin\/httpd -DFOREGROUND\r\n\u2514\u2500252676 \/usr\/sbin\/httpd -DFOREGROUND\r\nAug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Starting The Apache HTTP Server...\r\nAug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: AH00112: Warning: DocumentRoot [\/var\/teststmarks-ral\/html] does not exist\r\nAug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: Server configured, listening on: port 80\r\nAug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Started The Apache HTTP Server.\r\n<\/pre>\n
\u6700\u7ec8\u7684\u4fee\u6539<\/strong><\/div>\n

\u73b0\u5728\u6240\u9700\u7684\u670d\u52a1\u90fd\u5df2\u7ecf\u8fd0\u884c\u4e86\uff0c\u4f60\u53ef\u4ee5\u628a \/etc\/sysconfig\/iptables<\/span> \u6587\u4ef6\u4e2d HTTDP<\/span> \u7684\u9632\u706b\u5899\u89c4\u5219\u6539\u6210\u4e0b\u9762\u7684\u6837\u5b50\uff1a<\/p>\n

-A PREROUTING -d 45.20.209.41\/255.255.255.248 -p tcp -m tcp --dport 80 \\\r\n  -j DNAT --to-destination 192.168.0.125:80\r\n<\/pre>\n

\u7136\u540e\u91cd\u65b0\u52a0\u8f7d\u8bbe\u7f6e\u7684 IPTables \u89c4\u5219\u3002<\/p>\n

iptables-restore \/etc\/sysconfig\/iptables\r\n<\/pre>\n

\u7531\u4e8e\u9632\u706b\u5899\u89c4\u5219\u662f\u5728\u9632\u706b\u5899\u4e3b\u673a\u4e0a\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u628a\u5916\u90e8 DNS <\/span>\u5165\u53e3\u6539\u6210\u6307\u5411\u65b0\u670d\u52a1\u5668\u3002\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u5185\u90e8 DNS<\/span> \u670d\u52a1\u5668\uff0c\u90a3\u4e48\u4f60\u9700\u8981\u628a IP \u5730\u5740\u6539\u6210\u5185\u90e8 DNS <\/span>\u6570\u636e\u5e93\u91cc\u7684 A \u8bb0\u5f55\u3002\u5982\u679c\u4f60\u6ca1\u6709\u7528\u5185\u90e8 DNS<\/span> \u670d\u52a1\u5668\uff0c\u90a3\u4e48\u8bf7\u786e\u4fdd\u4e3b\u673a \/etc\/hosts<\/span> \u6587\u4ef6\u91cc\u65b0\u670d\u52a1\u5668\u5730\u5740\u8bbe\u7f6e\u5f97\u6ca1\u6709\u95ee\u9898\u3002<\/p>\n

\u6d4b\u8bd5\u548c\u6e05\u7406<\/strong><\/div>\n

\u8bf7\u786e\u4fdd\u5bf9\u65b0\u914d\u7f6e\u8fdb\u884c\u6d4b\u8bd5\u3002\u9996\u5148\uff0c\u505c\u6b62\u65e7\u670d\u52a1\u5668\u4e0a\u7684 mysqld<\/span> \u548c httpd<\/span> \u670d\u52a1\u3002\u7136\u540e\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u7f51\u7ad9\u3002\u5982\u679c\u4e00\u5207\u7b26\u5408\u9884\u671f\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u5173\u6389\u65e7\u670d\u52a1\u5668\u4e0a\u7684 mysqld <\/span>\u548c httpd<\/span>\u3002\u5982\u679c\u6709\u5931\u8d25\uff0c\u4f60\u53ef\u4ee5\u628a IPTables<\/span> \u7684\u8def\u7531\u89c4\u5219\u6539\u56de\u53bb\u5230\u65e7\u670d\u52a1\u5668\u4e0a\uff0c\u76f4\u5230\u95ee\u9898\u89e3\u51b3\u3002<\/p>\n

\u4e4b\u540e\u6211\u628a MySQL <\/span>\u548c HTTPD<\/span> \u4ece\u65e7\u670d\u52a1\u5668\u4e0a\u5220\u9664\u4e86\uff0c\u8fd9\u6837\u6765\u786e\u4fdd\u5b83\u4eec\u4e0d\u4f1a\u610f\u5916\u5730\u88ab\u542f\u52a8\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u5c31\u662f\u8fd9\u4e48\u7b80\u5355\u3002\u4e0d\u9700\u8981\u6267\u884c\u6570\u636e\u5e93\u5bfc\u51fa\u548c\u5bfc\u5165\u7684\u8fc7\u7a0b\uff0c\u56e0\u4e3a mysql<\/span> \u76ee\u5f55\u4e0b\u6240\u6709\u9700\u8981\u7684\u4e1c\u897f\u90fd\u5df2\u7ecf\u590d\u5236\u8fc7\u53bb\u4e86\u3002\u9700\u8981\u6267\u884c\u5bfc\u51fa\/\u5bfc\u5165\u8fc7\u7a0b\u7684\u573a\u666f\u662f\uff1a\u6709\u7f51\u7ad9\u81ea\u5df1\u7684\u6570\u636e\u5e93\u4e4b\u5916\u7684\u6570\u636e\u5e93\uff1bMariaDB \u5b9e\u4f8b\u4e0a\u8fd8\u6709\u5176\u4ed6\u7f51\u7ad9\uff0c\u800c\u4f60\u4e0d\u60f3\u628a\u8fd9\u4e9b\u7f51\u7ad9\u590d\u5236\u5230\u65b0\u670d\u52a1\u5668\u4e0a\u3002<\/p>\n

\u8fc1\u79fb\u65e7\u670d\u52a1\u5668\u4e0a\u7684\u5176\u4ed6\u7f51\u7ad9\u4e5f\u5f88\u5bb9\u6613\u3002\u5176\u4ed6\u7f51\u7ad9\u4f9d\u8d56\u7684\u6240\u6709\u6570\u636e\u5e93\u90fd\u5df2\u7ecf\u968f\u7740 MariaDB<\/span> \u7684\u8fc1\u79fb\u88ab\u8f6c\u79fb\u5230\u4e86\u65b0\u670d\u52a1\u5668\u4e0a\u3002\u4f60\u53ea\u9700\u8981\u628a \/var\/website<\/span> \u76ee\u5f55\u8fc1\u79fb\u5230\u65b0\u670d\u52a1\u5668\uff0c\u6dfb\u52a0\u5408\u9002\u7684\u865a\u62df\u4e3b\u673a\u7247\u6bb5\uff0c\u7136\u540e\u91cd\u542f HTTPD\u3002<\/p>\n

\u6211\u9075\u5faa\u8fd9\u4e2a\u8fc7\u7a0b\u628a\u5f88\u591a\u4e2a\u7f51\u7ad9\u4ece\u4e00\u4e2a\u670d\u52a1\u5668\u8fc1\u79fb\u5230\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\uff0c\u6bcf\u6b21\u90fd\u6ca1\u6709\u95ee\u9898\u3002<\/p>\n


\n

via:\u00a0https:\/\/opensource.com\/article\/21\/9\/migrate-wordpress<\/a><\/p>\n

\u4f5c\u8005\uff1aDavid Both<\/a>\u00a0\u9009\u9898\uff1alujun9972<\/a>\u00a0\u8bd1\u8005\uff1alxbwolf<\/a>\u00a0\u6821\u5bf9\uff1awxy<\/a><\/p>\n

\u672c\u6587\u7531\u00a0LCTT<\/a>\u00a0\u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a>\u00a0\u8363\u8a89\u63a8\u51fa<\/p>\n

<\/section>\n","protected":false},"excerpt":{"rendered":"

\u4f60\u6709\u8fc7\u628a\u4e00\u4e2a WordPress \u7f51\u7ad9\u8fc1\u79fb\u5230\u4e00\u53f0\u65b0\u4e3b\u673a\u4e0a\u7684\u9700\u6c42\u5417\uff1f\u6211\u66fe\u7ecf\u8fc1\u79fb\u8fc7\u597d\u591a\u6b21\uff0c\u8fc1\u79fb\u8fc7\u7a0b\u76f8\u5f53\u7b80\u5355\u3002\u5f53\u7136\uff0c […]<\/p>\n","protected":false},"author":1890,"featured_media":238555,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-238535","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/238535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1890"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=238535"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/238535\/revisions"}],"predecessor-version":[{"id":238557,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/238535\/revisions\/238557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/238555"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=238535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=238535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=238535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}