最新消息:20210917 已从crifan.com换到crifan.org

【已解决】把crifan.com改为crifan.org后更新WordPress配置文件

org crifan 952浏览 0评论
折腾:
【未解决】网站从crifan.com搬家到整站复制到crifan.org
期间,继续去更新配置。
先看看有哪些文件:
[root@crifan www.crifan.com]# cd ../www.crifan.org/
[root@crifan www.crifan.org]# lltotal 1.2M
-rwxr-xr-x  1 www www  613 Jun 14  2017 400.shtml
-rwxr-xr-x  1 www www  162 Jun 14  2017 401.shtml
-rwxr-xr-x  1 www www  201 Jun 14  2017 403.shtml
-rwxr-xr-x  1 www www   83 Jun 14  2017 404.shtml
-rwxr-xr-x  1 www www  363 Jun 14  2017 500.php
-rwxr-xr-x  1 www www   71 Jun 14  2017 500.shtml
-rwxr-xr-x  1 www www  121 Jun 14  2017 adsense.txt
-rw-r--r--  1 www www   58 Jun  4  2019 ads.txt
-rw-r--r--  1 www www   10 Jun 15  2017 baidu_verify_RArDXS7Cee.html
drwxr-xr-x  2 www www 4.0K Jun 14  2017 cgi-bin
drwxr-xr-x  4 www www 4.0K Jun 14  2017 chenmo
drwxr-xr-x  3 www www 4.0K Jun 14  2017 d3
-rwxr-xr-x  1 www www 1.1K Jun 14  2017 favicon.ico
drwxr-xr-x  9 www www 4.0K Apr 13  2018 files
-rwxr-xr-x  1 www www   53 Jun 14  2017 google978bf639ea5c3645.html
-rwxr-xr-x  1 www www  405 May 18  2020 index.php
-rwxr-xr-x  1 www www  20K Sep  9 20:23 license.txt
-rwxr-xr-x  1 www www  40K Jun 14  2017 php.ini
-rw-r--r--  1 www www  738 Jan 10  2019 pwa-amp-manifest.json
-rw-r--r--  1 www www 2.1K Jan 10  2019 pwa-amp-sw.html
-rw-r--r--  1 www www  14K Jan 10  2019 pwa-amp-sw.js
-rw-r--r--  1 www www  832 Aug 22  2020 pwa-manifest.json
-rw-r--r--  1 www www  12K Aug 22  2020 pwa-register-sw.js
-rw-r--r--  1 www www  27K Aug 22  2020 pwa-sw.js
-rwxr-xr-x  1 www www 7.2K Sep  9 20:23 readme.html
drwxr-xr-x  4 www www 4.0K Jun 14  2017 released
-rwxr-xr-x  1 www www 628K Jun 14  2017 sitemap.backup.xml
-rwxr-xr-x  1 www www 180K Jun 14  2017 sitemap.backup.xml.gz
drwxr-xr-x  4 www www 4.0K Jun 14  2017 uploads
-rwxr-xr-x  1 www www 7.0K Mar 10  2021 wp-activate.php
drwxr-xr-x 10 www www 4.0K Jul 22 13:45 wp-admin
-rwxr-xr-x  1 www www  351 May 18  2020 wp-blog-header.php
-rwxr-xr-x  1 www www 2.3K Jan  3  2021 wp-comments-post.php
-rw-------  1 www www 4.2K Jul 22 15:40 wp-config.php
-rwxr-xr-x  1 www www 3.0K Jul 22 13:45 wp-config-sample.php
drwxr-xr-x 10 www www 4.0K Jul 22 15:43 wp-content
-rwxr-xr-x  1 www www 3.9K Jan  3  2021 wp-cron.php
drwxr-xr-x 25 www www  16K Jul 22 13:45 wp-includes
-rwxr-xr-x  1 www www 2.5K May 18  2020 wp-links-opml.php
-rwxr-xr-x  1 www www 3.9K Jul 22 13:45 wp-load.php
-rwxr-xr-x  1 www www  45K Jul 22 13:45 wp-login.php
-rwxr-xr-x  1 www www 8.4K May 18  2020 wp-mail.php
-rwxr-xr-x  1 www www  413 Jun 14  2017 wp-pass.php
-rwxr-xr-x  1 www www  334 Jun 14  2017 wp-register.php
-rwxr-xr-x  1 www www  22K Jul 22 13:45 wp-settings.php
-rwxr-xr-x  1 www www  31K Jul 22 13:45 wp-signup.php
-rwxr-xr-x  1 www www 4.7K Jan  3  2021 wp-trackback.php
-rwxr-xr-x  1 www www 3.2K Aug 17  2020 xmlrpc.php
然后去更新wp-config.php
[root@crifan www.crifan.org]# vim wp-config.php
把所有的 crifan.com 都改为 crifan.org
以及相关数据库等配置:
define( 'WPCACHEHOME', '/data/wwwroot/www.crifan.com/wp-content/plugins/wp-super-cache/' );


define('DB_NAME', 'crifan_wp_db’);


// define('WP_HOME','https://www.crifan.com');
// define('WP_SITEURL','https://www.crifan.com');
// define('WP_HOME','https://crifan.com');
// define('WP_SITEURL','https://crifan.com');
// define('WP_HOME','https://www.crifan.com');
// define('WP_SITEURL','https://www.crifan.com');
->
define( 'WPCACHEHOME', '/data/wwwroot/www.crifan.org/wp-content/plugins/wp-super-cache/' );


define('DB_NAME', 'crifan_org_wp’);


// define('WP_HOME','https://www.crifan.org');
// define('WP_SITEURL','https://www.crifan.org');
// define('WP_HOME','https://crifan.org');
// define('WP_SITEURL','https://crifan.org');
// define('WP_HOME','https://www.crifan.org');
// define('WP_SITEURL','https://www.crifan.org');
其中:
define('DB_CHARSET', 'utf8');
此处记得,新建数据库是用了:utf8mb4 ?
去看看
旧数据库就有:
utf8
utf8mb4
混用的情况。
所以估计改不改都可以。
不过还是去改吧
define('DB_CHARSET', 'utf8mb4');
另外:
define('JWT_AUTH_SECRET_KEY', ‘xxx');
不知道:
2个WordPress站点都用同一个 jwt的key,会不会有问题。
暂时不改。有空再确认jwt,是否正常。
即可。
最后vim中搜 crifan.com 确认都找不到
说明改完了。
[root@crifan www.crifan.org]# cat wp-config.php
<?php


//Begin Really Simple SSL session cookie settings
@ini_set('session.cookie_httponly', true);
@ini_set('session.cookie_secure', true);
@ini_set('session.use_only_cookies', true);
//END Really Simple SSL
/**
 * The base configurations of the WordPress.
 *
 * This file has the following configurations: MySQL settings, Table Prefix,
 * Secret Keys, WordPress Language, and ABSPATH. You can find more information
 * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
 * wp-config.php} Codex page. You can get the MySQL settings from your web host.
 *
 * This file is used by the wp-config.php creation script during the
 * installation. You don't have to use the web site, you can just copy this file
 * to "wp-config.php" and fill in the values.
 *
 * @package WordPress
 */


// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */


define('WP_CACHE', true);
define( 'WPCACHEHOME', '/data/wwwroot/www.crifan.org/wp-content/plugins/wp-super-cache/' );
define('DB_NAME', 'crifan_org_wp');


/** MySQL database username */
define('DB_USER', 'root');


/** MySQL database password */
define('DB_PASSWORD', ‘xxx');


/** MySQL hostname */
define('DB_HOST', 'localhost');


/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');


/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');


/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         ‘xxx');
define('SECURE_AUTH_KEY',  ‘xxx');
define('LOGGED_IN_KEY',    ‘xxx');
define('NONCE_KEY',        ‘xxx');
define('AUTH_SALT',        ‘xxx');
define('SECURE_AUTH_SALT', ‘xxx');
define('LOGGED_IN_SALT',   ‘xxx');
define('NONCE_SALT',       ‘xxx');


/**#@-*/


/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';


/**
 * WordPress Localized Language, defaults to English.
 *
 * Change this to localize WordPress. A corresponding MO file for the chosen
 * language must be installed to wp-content/languages. For example, install
 * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
 * language support.
 */
define('WPLANG', 'zh_CN');


/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 */
define('WP_DEBUG', false);
// define('WP_DEBUG', true);


// define('FORCE_SSL_ADMIN', false);


// define('WP_HOME','https://www.crifan.org');
// define('WP_SITEURL','https://www.crifan.org');
// define('WP_HOME','https://crifan.org');
// define('WP_SITEURL','https://crifan.org');
// define('WP_HOME','https://www.crifan.org');
// define('WP_SITEURL','https://www.crifan.org');


/* That's all, stop editing! Happy blogging. */


/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . '/');


define('JWT_AUTH_SECRET_KEY', ‘xxx');
define('JWT_AUTH_CORS_ENABLE', true);


/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');


/* allow wordpress plugin auto upgrade */
define('FS_METHOD', 'direct');


define('WP_ALLOW_REPAIR', true);
即可。

转载请注明:在路上 » 【已解决】把crifan.com改为crifan.org后更新WordPress配置文件

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
85 queries in 1.088 seconds, using 19.98MB memory