{"id":4535,"date":"2025-07-10T23:33:57","date_gmt":"2025-07-10T14:33:57","guid":{"rendered":"https:\/\/eternalsphere.net\/echoes\/?p=4535"},"modified":"2026-06-06T09:18:01","modified_gmt":"2026-06-06T00:18:01","slug":"ek9ttw0o3khebkt","status":"publish","type":"post","link":"https:\/\/eternalsphere.net\/echoes\/index.php\/2025\/07\/10\/ek9ttw0o3khebkt\/","title":{"rendered":"VPS \u4e0a\u4f7f\u7528 Duplicator \u8fc1\u79fb WordPress \u5e76\u914d\u7f6e Apache + MySQL + SSL \u5b9e\u8df5\u8bb0\u5f55"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u8fd1\u671f\u5728\u4e00\u53f0 VPS \u4e0a\u5b8c\u6210\u4e86 WordPress \u7684\u8fc1\u79fb\u53ca\u91cd\u5efa\uff0c\u4f7f\u7528 Duplicator \u63d2\u4ef6\u5bfc\u51fa\u7684\u5b8c\u6574\u5305\uff0c\u7ed3\u5408 Apache\u3001MySQL \u548c Certbot \u914d\u7f6e\uff0c\u6574\u7406\u4e86\u8be6\u7ec6\u64cd\u4f5c\u6d41\u7a0b\u4e0e\u9047\u5230\u7684\u9519\u8bef\u89e3\u51b3\u65b9\u6848\uff0c\u4f9b\u53c2\u8003\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u57fa\u7840\u73af\u5883\u51c6\u5907<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u670d\u52a1\u5668\u73af\u5883\uff1aUbuntu \u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt update<br>sudo apt upgrade -y<br>sudo apt install apache2 mysql-server php php-mysql libapache2-mod-php php-zip unzip -y<br>sudo systemctl enable apache2 mysql<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 MySQL \u914d\u7f6e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">MySQL \u5728\u65b0\u7248\u4e2d\u9ed8\u8ba4\u901a\u8fc7 <code>auth_socket<\/code> \u767b\u5f55\uff0c\u65e0\u9700\u5bc6\u7801\u3002\u5982\u679c\u9700\u8981\u4f7f\u7528\u5bc6\u7801\u767b\u5f55\uff0c\u53ef\u6267\u884c\u4ee5\u4e0b SQL\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '\u81ea\u5b9a\u4e49\u5bc6\u7801';<br>FLUSH PRIVILEGES;<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\u6570\u636e\u5e93\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u9700\u4f7f\u7528 root \u7528\u6237\u8fde\u63a5\uff0c\u53ef\u76f4\u63a5\u5728 <code>wp-config.php<\/code> \u914d\u7f6e\u4e2d\u586b\u5199 root \u8d26\u6237\u53ca\u5bf9\u5e94\u5bc6\u7801\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Apache \u865a\u62df\u4e3b\u673a\u914d\u7f6e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6 <code>\/etc\/apache2\/sites-available\/example.com.conf<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apacheCopyEdit<code>&lt;VirtualHost *:80&gt;\n    ServerName example.com\n    ServerAlias www.example.com\n    DocumentRoot \/var\/www\/example.com\n\n    &lt;Directory \/var\/www\/example.com&gt;\n        AllowOverride All\n        Require all granted\n    &lt;\/Directory&gt;\n\n    ErrorLog ${APACHE_LOG_DIR}\/example_error.log\n    CustomLog ${APACHE_LOG_DIR}\/example_access.log combined\n&lt;\/VirtualHost&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u542f\u7528\u7ad9\u70b9\u5e76\u91cd\u8f7d Apache\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo a2ensite example.com.conf<br>sudo a2enmod rewrite<br>sudo systemctl reload apache2<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u4e0a\u4f20\u5e76\u89e3\u538b Duplicator \u5305<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 <code>\/var\/www\/example.com<\/code> \u4e2d\u4e0a\u4f20 <code>installer.php<\/code> \u53ca <code>.zip<\/code> \u6587\u4ef6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e38\u89c1\u9519\u8bef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>If you're seeing this text when browsing to the installer, it means your web server is not set up properly. Please contact your host and ask them to enable \"PHP\" processing on your account.<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\u65b9\u6848\uff1a\u5b89\u88c5\u5e76\u542f\u7528 PHP \u6a21\u5757<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt install php libapache2-mod-php php-mysql php-zip -y<br>sudo systemctl restart apache2<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 ZipArchive \u6269\u5c55\u95ee\u9898<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u9519\u8bef\u63d0\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>NOTICE: ZipArchive is not enabled on this server...<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt install php-zip -y<br>sudo systemctl restart apache2<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f9d\u7136\u65e0\u6cd5\u81ea\u52a8\u89e3\u538b\uff0c\u53ef\u624b\u52a8\u6267\u884c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cd \/var\/www\/example.com<br>unzip package_archive.zip<br>rm \/var\/www\/example.com\/wp-content\/object-cache.php<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Duplicator \u5b89\u88c5\u5668\u4e2d\u9009\u62e9\u300cAdvanced \u2192 Manual Extract\u300d\u7ee7\u7eed\u6062\u590d\u6d41\u7a0b\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Redis \u7f13\u5b58\u62a5\u9519<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u9519\u8bef\u63d0\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Error establishing a Redis connection<br>To disable Redis, delete the object-cache.php file in the \/wp-content\/ directory.<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\u65b9\u6848\uff1a\u5220\u9664 <code>object-cache.php<\/code> \u6587\u4ef6\u5373\u53ef\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rm \/var\/www\/example.com\/wp-content\/object-cache.php<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Certbot \u5b89\u88c5 SSL<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo apt install certbot python3-certbot-apache -y<br>sudo certbot --apache -d example.com -d www.example.com<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u63d2\u4ef6\u7981\u7528\uff08Jetpack \u7b49\uff09<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u9047\u5230\u63d0\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Plugin Jetpack disabled by default<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u5728 WordPress \u540e\u53f0\u63d2\u4ef6\u7ba1\u7406\u4e2d\u91cd\u65b0\u542f\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 wp-cli \u67e5\u770b\u548c\u64cd\u4f5c\u63d2\u4ef6\u72b6\u6001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wp plugin list<br>wp plugin activate jetpack<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">wp-cli \u5b9e\u9645\u4f1a\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u7684 <code>wp_options<\/code> \u8868\uff0c<code>active_plugins<\/code> \u9879\u76ee\u4fdd\u5b58\u4e86\u6240\u6709\u6fc0\u6d3b\u7684\u63d2\u4ef6\u5217\u8868\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u8fc1\u79fb\u5b8c\u6210\u540e\u5b89\u5168\u6e05\u7406<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u767b\u5f55\u540e\u53f0\u540e\u786e\u8ba4\u5220\u9664 Duplicator \u5b89\u88c5\u6587\u4ef6<\/li>\n\n\n\n<li>\u68c0\u67e5\u662f\u5426\u5f00\u542f\u81ea\u52a8\u91cd\u5b9a\u5411\u5230 HTTPS<\/li>\n\n\n\n<li>\u786e\u8ba4\u7ad9\u70b9\u9996\u9875\u4e0e\u540e\u53f0\u5747\u6b63\u5e38\u8bbf\u95ee<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udcac \u603b\u7ed3<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u6b21 VPS \u4e0a\u7684 WordPress \u8fc1\u79fb\u8fc7\u7a0b\u4e2d\uff0c\u4e3b\u8981\u9047\u5230\u4ee5\u4e0b\u51e0\u4e2a\u5178\u578b\u95ee\u9898\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP \u672a\u542f\u7528\u5bfc\u81f4\u5b89\u88c5\u5668\u76f4\u63a5\u663e\u793a\u4ee3\u7801<\/li>\n\n\n\n<li>\u7f3a\u5c11 ZipArchive \u6269\u5c55\u5bfc\u81f4\u65e0\u6cd5\u81ea\u52a8\u89e3\u538b<\/li>\n\n\n\n<li>Redis \u7f13\u5b58\u672a\u914d\u7f6e\u5bfc\u81f4\u8fde\u63a5\u9519\u8bef<\/li>\n\n\n\n<li>\u63d2\u4ef6\u81ea\u52a8\u7981\u7528\u9700\u8981\u624b\u52a8\u91cd\u65b0\u542f\u7528<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u4e00\u7cfb\u5217\u8be6\u7ec6\u7684\u6392\u67e5\u4e0e\u547d\u4ee4\u914d\u7f6e\uff0c\u6700\u7ec8\u5b8c\u6210\u4e86\u8fc1\u79fb\u5e76\u4e0a\u7ebf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd1\u671f\u5728\u4e00\u53f0 VPS \u4e0a\u5b8c\u6210\u4e86 WordPress \u7684\u8fc1\u79fb\u53ca\u91cd\u5efa\uff0c\u4f7f\u7528 Duplicator \u63d2\u4ef6\u5bfc\u51fa\u7684\u5b8c\u6574\u5305\uff0c\u7ed3\u5408 Apache\u3001MySQL \u548c Certbot \u914d\u7f6e\uff0c\u6574\u7406\u4e86\u8be6\u7ec6\u64cd\u4f5c\u6d41\u7a0b\u4e0e\u9047\u5230\u7684\u9519\u8bef\u89e3\u51b3\u65b9\u6848\uff0c\u4f9b\u53c2\u8003\u3002 \u2705 \u57fa\u7840\u73af\u5883\u51c6\u5907 \u670d\u52a1\u5668\u73af\u5883\uff1aUbuntu \u7cfb\u7edf sudo apt updatesudo apt upgrade -ysudo apt install apache2 mysql-server php php-mysql libapache2-mod-php php-zip unzip -ysudo systemctl enable apache2 mysql \u2705 MySQL \u914d\u7f6e MySQL \u5728\u65b0\u7248\u4e2d\u9ed8\u8ba4\u901a\u8fc7 auth_socket \u767b\u5f55\uff0c\u65e0\u9700\u5bc6\u7801\u3002\u5982\u679c\u9700\u8981\u4f7f\u7528\u5bc6\u7801\u767b\u5f55\uff0c\u53ef\u6267\u884c\u4ee5\u4e0b SQL\uff1a ALTER USER &#8216;root&#8217;@&#8217;localhost&#8217; IDENTIFIED WITH mysql_native_password BY &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[193],"tags":[],"class_list":["post-4535","post","type-post","status-publish","format-standard","hentry","category-abjh3eiun5cktvl"],"_links":{"self":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/comments?post=4535"}],"version-history":[{"count":1,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4535\/revisions"}],"predecessor-version":[{"id":4536,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4535\/revisions\/4536"}],"wp:attachment":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/media?parent=4535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/categories?post=4535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/tags?post=4535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}