WordPress station construction process (II) installation and configuration

WordPress’s WordPress installation and configuration is not complex, after the installation of many settings are bothering webmasters, such as: pseudo-static configuration, cache configuration, security configuration. WordPressBuilding Process One already describes the server environment and recommended configuration required for WordPress, so let’s start by installing WordPress.

Download and install WordPress

Download the latest version of Chinese: https://cn.wordpress.org/ on your WordPress website

The latest Chinese version of WordPress can be downloaded via this link:https://cn.wordpress.org/latest-zh_CN.zip

After unziping, upload all files to the root of the site, or the subdirectory that needs to be installed. Entering the URL of the directory opens the installation wizard (such as uploading to the root and entering the bound domain name directly), and the entire installation process is simple.

WordPress is known for its ease of installation. In most cases, installing WordPress is a very simple process that takes less than five minutes to complete.

Reference from wordpress.org

Turn on WordPress pseudo-static

Nginx pseudo-static rules:

location /
{
	 try_files $uri $uri/ /index.php?$args;
}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

If the LNMP one-click installation package can choose to turn on WordPress pseudo-static when creating a virtual host, the pagoda panel can also choose WordPress for automatic configuration in the website management panel – Settings – pseudo-static.

After the Nginx pseudo-static rule configuration, the Nginx needs to be restarted to take effect.

Apache pseudo-static rules:


RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

If the permissions of the WordPress installation directory are configured correctly, Apache generally does not have to be manually configured, only need to be in the WordPress background – settings – fixed link settings to modify the settings content click save to automatically generate .htacces files. If it is not automatically generated, you can manually add the above to the site root .htacces file.

Windows IIS7 pseudo-static rules:

Create a new “chineseurl .php” file where the following code is written and uploaded to the wordpress installation directory.

<?php
// IIS Mod-Rewrite
if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
}
// IIS Isapi_Rewrite
else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}
else
{
// Use ORIG_PATH_INFO if there is no PATH_INFO
if ( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) )
$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
if ( isset($_SERVER['PATH_INFO']) ) {
if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
else
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
}
// Append the query string if it exists and isn't null
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
require("index.php");
?>

A new file is named web.config, where the following rules are written:

Note: “the match the url =” ^ (tag | category)/(. *) $” / > “need to be modified according to the actual directory. If installed in the blog directory, should be changed to “< match =" ^ blog url/(tag | category)/(. *) $" / >” The label prefix and category directory name are modified according to the actual directory.

PHP .ini recommended configuration

max_execution_time = 300
max_input_time = 300
memory_limit = 196M
post_max_size = 64M
upload_max_filesize = 64M
max_file_uploads = 20
default_socket_timeout = 120

wp-config .php recommended configuration

//Change the limit to WordPress PHP memory to 196MB or above, where the value cannot be greater than the value of memory_limit in php.ini
define('WP_MEMORY_LIMIT','196M');
//Set auto save interval/second
define('AUTOSAVE_INTERVAL', 300);
//Disable article revision
define('WP_POST_REVISIONS', false);

Read more wp-config .php configuration:WordPress profile wp-config .php details

WordPress must-have plug-ins

  • WP-China-Yes:This plug-in will completely replace the link to WP access to official services as a high-speed and stable Chinese mainland node, thereby speeding up site updates, installing upgrade plug-in themes, and completely resolving 429 errors. Download address:https://github.com/sunxiyuan/wp-china-yes
  • Yoast SEO:A true WordPress all-in-one SEO solution! Includes page content analysis, XML site maps, and more.
  • WP Rocket:Very professional and set up simple cache plug-ins. Anyone can configure this plug-in in minutes without disrupting the proper functioning of the site.
  • Perfmatters:Very lightweight WordPress performance optimization plug-in. The main purpose of the plug-in is to reduce page size and the number of HTTP requests.
  • Code Snippets: (Advanced plug-in) an easy, concise way to run snippets of code on your site. No more editing the theme’s fusion .php files!
  • WP Super Cache: A free WordPress quick cache plug-in that cannot be used in conjunction with WP Rocket.

Read on: WordPress Station Building Process (III) Configuration Topic

Leave a Comment