{"id":24,"date":"2025-09-05T15:09:09","date_gmt":"2025-09-05T07:09:09","guid":{"rendered":"https:\/\/blog.970515.xyz\/?p=24"},"modified":"2025-09-05T15:09:09","modified_gmt":"2025-09-05T07:09:09","slug":"vps-%e4%b8%8a%e6%89%8b%e5%8a%a8%e6%90%ad%e5%bb%ba-wordpress","status":"publish","type":"post","link":"https:\/\/blog.970515.xyz\/index.php\/2025\/09\/05\/vps-%e4%b8%8a%e6%89%8b%e5%8a%a8%e6%90%ad%e5%bb%ba-wordpress\/","title":{"rendered":"VPS \u4e0a\u624b\u52a8\u642d\u5efa WordPress"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\ud83d\ude80 \u642d\u5efa WordPress \u57fa\u7840\u6b65\u9aa4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u51c6\u5907\u73af\u5883<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e00\u53f0\u670d\u52a1\u5668\uff08VPS\uff09<\/li>\n\n\n\n<li>\u4e00\u4e2a\u57df\u540d\uff08\u53ef\u9009\uff0c\u4f46\u63a8\u8350\uff09<\/li>\n\n\n\n<li>Linux \u7cfb\u7edf\uff08\u5e38\u89c1\uff1aDebian\/Ubuntu\/CentOS\uff09<\/li>\n\n\n\n<li>\u57fa\u7840\u8f6f\u4ef6\uff1aNginx\/Apache\u3001PHP\u3001MySQL\/MariaDB<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u5b89\u88c5\u5fc5\u8981\u7ec4\u4ef6<\/h3>\n\n\n\n<p>\uff08\u4ee5 Debian\/Ubuntu \u4e3a\u4f8b\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt upgrade -y\nsudo apt install nginx mariadb-server php php-fpm php-mysql unzip curl -y\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u521b\u5efa\u6570\u636e\u5e93<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql -u root -p\n<\/code><\/pre>\n\n\n\n<p>\u8fdb\u5165 MySQL \u540e\u6267\u884c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;\nCREATE USER 'wpuser'@'localhost' IDENTIFIED BY '\u4f60\u7684\u5bc6\u7801';\nGRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';\nFLUSH PRIVILEGES;\nEXIT;\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u4e0b\u8f7d\u5e76\u914d\u7f6e WordPress<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/\nsudo curl -O https:\/\/wordpress.org\/latest.zip\nsudo unzip latest.zip\nsudo mv wordpress \/var\/www\/html\/\nsudo chown -R www-data:www-data \/var\/www\/html\/wordpress\nsudo chmod -R 755 \/var\/www\/html\/wordpress\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5. \u914d\u7f6e Nginx (\u793a\u4f8b)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/nginx\/sites-available\/wordpress\n<\/code><\/pre>\n\n\n\n<p>\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 80;\n    server_name yourdomain.com;\n\n    root \/var\/www\/html\/wordpress;\n    index index.php index.html index.htm;\n\n    location \/ {\n        try_files $uri $uri\/ \/index.php?$args;\n    }\n\n    location ~ \\.php$ {\n        include snippets\/fastcgi-php.conf;\n        fastcgi_pass unix:\/run\/php\/php7.4-fpm.sock; # \u7248\u672c\u53f7\u6309\u5b9e\u9645\u4e3a\u51c6\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>\u542f\u7528\u914d\u7f6e\u5e76\u91cd\u542f Nginx\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ln -s \/etc\/nginx\/sites-available\/wordpress \/etc\/nginx\/sites-enabled\/\nsudo nginx -t\nsudo systemctl reload nginx\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">6. \u8bbf\u95ee\u7f51\u7ad9\u5b8c\u6210\u5b89\u88c5<\/h3>\n\n\n\n<p>\u5728\u6d4f\u89c8\u5668\u6253\u5f00 <code>http:\/\/yourdomain.com<\/code><br>\u7136\u540e\u6839\u636e\u63d0\u793a\u586b\u5199\u6570\u636e\u5e93\u540d\u3001\u7528\u6237\u3001\u5bc6\u7801\u5373\u53ef\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">7.\uff08\u53ef\u9009\uff09\u66f4\u5feb\u7684\u65b9\u6cd5<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7528\u5b9d\u5854\u9762\u677f<\/strong>\uff08\u9002\u5408\u65b0\u624b\uff09\uff1a\u5b89\u88c5\u5b9d\u5854 \u2192 \u4e00\u952e\u90e8\u7f72 WordPress\u3002<\/li>\n\n\n\n<li><strong>\u7528 Docker<\/strong>\uff1a\u51e0\u6761\u547d\u4ee4\u5c31\u80fd\u8dd1\u8d77\u6765\u3002<\/li>\n\n\n\n<li><strong>\u7528 One-Click Script<\/strong>\uff1a\u4f8b\u5982 <a>WordOps<\/a> \u6216 <a>LNMP \u4e00\u952e\u5b89\u88c5\u5305<\/a>\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\ude80 \u642d\u5efa WordPress \u57fa\u7840\u6b65\u9aa4 1. \u51c6\u5907\u73af\u5883 2. \u5b89\u88c5\u5fc5\u8981\u7ec4\u4ef6 \uff08\u4ee5 Debian\/Ubuntu  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":1,"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":25,"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/posts\/24\/revisions\/25"}],"wp:attachment":[{"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.970515.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}