折腾:
期间,接着去服务器中安装最新版本的WordPress。
wordpress 下载
Create your stunning website on WordPress.com
Releases | WordPress.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | [root@VM_0_10_centos xxx] # wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz --2018-12-05 22:34:05-- https: //cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz Resolving cn.wordpress.org (cn.wordpress.org)... 198.143.164.252 Connecting to cn.wordpress.org (cn.wordpress.org)|198.143.164.252|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 9082696 (8.7M) [application/octet-stream] Saving to: ordpress-4.9.4-zh_CN.tar.gz 100%[=========================================================================================================================================>] 9,082,696 2.42MB/s in 4.0s 2018-12-05 22:34:10 (2.19 MB/s) - ordpress-4.9.4-zh_CN.tar.gzsaved [9082696/9082696] [root@VM_0_10_centos xxx] # ll total 8908 -rw-r--r-- 1 root root 18081 Dec 5 22:19 toDelete_index.html -rw-r--r-- 1 root root 9082696 Feb 8 2018 wordpress-4.9.4-zh_CN.tar.gz [root@VM_0_10_centos xxx] # tar xvf wordpress-4.9.4-zh_CN.tar.gz [root@VM_0_10_centos xxx] # ll total 8912 -rw-r--r-- 1 root root 18081 Dec 5 22:19 toDelete_index.html drwxr-xr-x 5 nobody 65534 4096 Feb 8 2018 wordpress -rw-r--r-- 1 root root 9082696 Feb 8 2018 wordpress-4.9.4-zh_CN.tar.gz [root@VM_0_10_centos xxx] # cd wordpress/ [root@VM_0_10_centos wordpress] # ll total 188 -rw-r--r-- 1 nobody 65534 418 Sep 25 2013 index.php -rw-r--r-- 1 nobody 65534 19935 Jan 7 2018 license.txt -rw-r--r-- 1 nobody 65534 7001 Feb 8 2018 readme.html -rw-r--r-- 1 nobody 65534 5434 Sep 23 2017 wp-activate.php drwxr-xr-x 9 nobody 65534 4096 Feb 8 2018 wp-admin -rw-r--r-- 1 nobody 65534 364 Dec 19 2015 wp-blog-header.php -rw-r--r-- 1 nobody 65534 1627 Aug 29 2016 wp-comments-post.php -rw-r--r-- 1 nobody 65534 2930 Feb 8 2018 wp-config-sample.php drwxr-xr-x 5 nobody 65534 4096 Feb 8 2018 wp-content -rw-r--r-- 1 nobody 65534 3669 Aug 20 2017 wp-cron.php drwxr-xr-x 18 nobody 65534 12288 Feb 8 2018 wp-includes -rw-r--r-- 1 nobody 65534 2422 Nov 21 2016 wp-links-opml.php -rw-r--r-- 1 nobody 65534 3306 Aug 22 2017 wp-load.php -rw-r--r-- 1 nobody 65534 36583 Oct 13 2017 wp-login.php -rw-r--r-- 1 nobody 65534 8048 Jan 11 2017 wp-mail.php -rw-r--r-- 1 nobody 65534 16246 Oct 4 2017 wp-settings.php -rw-r--r-- 1 nobody 65534 30071 Oct 19 2017 wp-signup.php -rw-r--r-- 1 nobody 65534 4620 Oct 24 2017 wp-trackback.php -rw-r--r-- 1 nobody 65534 3065 Sep 1 2016 xmlrpc.php [root@VM_0_10_centos wordpress] # mv * .. [root@VM_0_10_centos xxx] # rm -rf wordpress [root@VM_0_10_centos xxx] # ll total 9096 -rw-r--r-- 1 nobody 65534 418 Sep 25 2013 index.php -rw-r--r-- 1 nobody 65534 19935 Jan 7 2018 license.txt -rw-r--r-- 1 nobody 65534 7001 Feb 8 2018 readme.html -rw-r--r-- 1 root root 18081 Dec 5 22:19 toDelete_index.html -rw-r--r-- 1 root root 9082696 Feb 8 2018 wordpress-4.9.4-zh_CN.tar.gz -rw-r--r-- 1 nobody 65534 5434 Sep 23 2017 wp-activate.php drwxr-xr-x 9 nobody 65534 4096 Feb 8 2018 wp-admin -rw-r--r-- 1 nobody 65534 364 Dec 19 2015 wp-blog-header.php -rw-r--r-- 1 nobody 65534 1627 Aug 29 2016 wp-comments-post.php -rw-r--r-- 1 nobody 65534 2930 Feb 8 2018 wp-config-sample.php drwxr-xr-x 5 nobody 65534 4096 Feb 8 2018 wp-content -rw-r--r-- 1 nobody 65534 3669 Aug 20 2017 wp-cron.php drwxr-xr-x 18 nobody 65534 12288 Feb 8 2018 wp-includes -rw-r--r-- 1 nobody 65534 2422 Nov 21 2016 wp-links-opml.php -rw-r--r-- 1 nobody 65534 3306 Aug 22 2017 wp-load.php -rw-r--r-- 1 nobody 65534 36583 Oct 13 2017 wp-login.php -rw-r--r-- 1 nobody 65534 8048 Jan 11 2017 wp-mail.php -rw-r--r-- 1 nobody 65534 16246 Oct 4 2017 wp-settings.php -rw-r--r-- 1 nobody 65534 30071 Oct 19 2017 wp-signup.php -rw-r--r-- 1 nobody 65534 4620 Oct 24 2017 wp-trackback.php -rw-r--r-- 1 nobody 65534 3065 Sep 1 2016 xmlrpc.php |
然后去安装:
zh-cn:WordPress 新手 – 如何开始 « WordPress Codex
zh-cn:安装 WordPress « WordPress Codex
https://codex.wordpress.org/zh-cn:安装WordPress
1 2 3 | [root@VM_0_10_centos xxx] # cp wp-con wp-config-sample.php wp-content/ [root@VM_0_10_centos xxx] # cp wp-config-sample.php wp-config.php |
然后去编辑文件:
先去安装上传下载工具:
centos 安装 lrzsz
1 2 3 4 5 | [root@VM_0_10_centos xxx] # yum install -y lrzsz Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Package lrzsz-0.12.20-36.el7.x86_64 already installed and latest version Nothing to do |
然后去下载并编辑配置文件,再去上传


1 2 3 4 5 | [root@VM_0_10_centos xxx] # sz wp-config.php rz Starting zmodem transfer. Press Ctrl+C to cancel. Transferring wp-config.php... 100% 2 KB 2 KB/sec 00:00:01 0 Errors |

编辑之前,先去登录phpmyadmin去创建一个mysql:
为了能用之前工具,先去把之前工具都拷贝过来:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [root@VM_0_10_centos xxx] # pwd /data/wwwroot/xxx [root@VM_0_10_centos xxx] # mkdir oneinstack_tools [root@VM_0_10_centos xxx] # cd oneinstack_tools/ [root@VM_0_10_centos oneinstack_tools] # ll total 0 [root@VM_0_10_centos oneinstack_tools] # cp /data/wwwroot/default/ index.html ocp.php phpinfo.php phpMyAdmin/ prober.php [root@VM_0_10_centos oneinstack_tools] # cp -r /data/wwwroot/default/* . [root@VM_0_10_centos oneinstack_tools] # lh total 108K -rw-r--r-- 1 root root 55K Dec 5 22:44 prober.php drwxr-xr-x 15 root root 4.0K Dec 5 22:44 phpMyAdmin/ -rw-r--r-- 1 root root 18K Dec 5 22:44 index.html -rw-r--r-- 1 root root 20K Dec 5 22:44 ocp.php -rw-r--r-- 1 root root 19 Dec 5 22:44 phpinfo.php |
不过发现其实可以不用的,因为访问IP就可以了:
http://x.x.x.x

phpMyAdmin
http://x.x.x.x/phpMyAdmin/

x.x.x.x / 127.0.0.1 | phpMyAdmin 4.8.3

再去建用户:



1 | CREATE USER 'xxx' @ '%' IDENTIFIED WITH mysql_native_password AS '***' ;GRANT ALL PRIVILEGES ON *.* TO 'xxx' @ '%' REQUIRE NONE WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;GRANT ALL PRIVILEGES ON `xxx`.* TO 'xxx' @ '%' ; |
去修复wp-config.php:
期间需要用到:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | / / * * MySQL 设置 - 具体信息来自您正在使用的主机 * * / / / * * WordPress数据库的名称 * / define( 'DB_NAME' , 'xxx' ); / * * MySQL数据库用户名 * / define( 'DB_USER' , 'xxx' ); / * * MySQL数据库密码 * / define( 'DB_PASSWORD' , 'xxx' ); / * * MySQL主机 * / define( 'DB_HOST' , 'localhost' ); / * * 创建数据表时默认的文字编码 * / define( 'DB_CHARSET' , 'utf8' ); / * * 数据库整理类型。如不确定请勿更改 * / define( 'DB_COLLATE' , ''); / * * #@+ * 身份认证密钥与盐。 * * 修改为任意独一无二的字串! * 或者直接访问{@link https: / / api.wordpress.org / secret - key / 1.1 / salt / * WordPress.org密钥生成服务} * 任何修改都会导致所有cookies失效,所有用户将必须重新登录。 * * @since 2.6 . 0 * / define( 'AUTH_KEY' , '+_~`+mX{@^#J5bWeMj,DU):hm9=eLR54AJ[OIw>@D3~jV+}.xm!drq(3>NR=L1:`' ); define( 'SECURE_AUTH_KEY' , 'c-$zW-(gvko>bNpjX:6(UO(crddmjc6t.M#pcvU%|3?[pSG$fFxb l(;&&0H;fX:' ); define( 'LOGGED_IN_KEY' , 'tE+(M;J)3if`yz22Rd|4b&T9^N/fpbw<:?[=6hzlv3Qf1|Fhmvm(i%EQ|@+i=kvk' ); define( 'NONCE_KEY' , 'LOR=1No7x}w&mzwtX,m TO%FW]#dL[(>g6[Il~t.V`kS/Ur#+)^EL}k?bA$Z6/NQ' ); define( 'AUTH_SALT' , '[3]gp@iA|xsJwfa-*4qqa@7Q>/jc7nNUuUY<;^j4oX5+q4v=N$JwFX}lm@<}z?M|' ); define( 'SECURE_AUTH_SALT' , '8gh+kCF@*xLE2^pA|0 pl+8Yw`W@2pV/qR,qD%j8ID//;B+g]N[_5y.)K9+|Rarb' ); define( 'LOGGED_IN_SALT' , '*IiiE%;8:jY+r]5}{*1[+SwQh2~w7B>KI(f7r5mUO*z+qEh*k3K[KkHG(*/+-q`(' ); define( 'NONCE_SALT' , '9Pwe~]XbYU5It`uN$C!1Vyy673P3EV/2-!eVRJeu$w+9sq,Q[#2hE+ciTwv|_(K:' ); |

然后删除旧的,上传此新配置
1 2 3 4 5 6 | [root@VM_0_10_centos xxx] # rm -f wp-config.php [root@VM_0_10_centos xxx] # rz rz waiting to receive. Starting zmodem transfer. Press Ctrl+C to cancel. Transferring wp-config.php... 100% 3 KB 3 KB/sec 00:00:01 0 Errors |
然后再去安装:


https://xxx/wp-admin/install.php?step=2



至此即安装完成最新版WordPress了。