
Today, Naiba was importingAstra ThemeWhen importing demo data, due to network issues, the import failed many times. Normally, after installing a domestic server, using plugins like kill 429 or wp china yes can speed up access to wordpress.org websites, allowing installation and updates of plugins.
However, for the data of these specific plugins and themes, the requests are not made to the WordPress official website, but to the plugin and theme's own websites. Domestic servers are prone to poor network conditions, leading to installation and import failures.
There are two solutions:
- Debug the website data on a foreign server, then back up and restore the data to the domestic server;
- Set up a proxy server for WordPress on the domestic server to accelerate requests to foreign websites.
Naiba uses the second method here, employing v2raψ as a proxy for access.
The specific steps are as follows:
1. Purchase a foreign server with decent access speed from the domestic server.Foreign Server
You can ping foreign servers from your own server to check the ping value. Generally, if the line exceeds 250ms, it may be laggy to use.
2. Install v2ray on the server
bash <(curl -L -s https://install.direct/go.sh)
After installation, open the configuration file at /etc/v2raψ/config.json and note the following:
- port value
- uuid value
3. Install v2ray on the domestic server
The method is the same as the code above, but the download may be slow. Refer to this article.Accelerating Github。
4. Modify the configuration file /etc/v2ray/config.json
Delete the default content of the configuration file, paste the content below, and then modify the parts explained in Chinese.
{
"log": {
"loglevel": "warning"
},
"inbound": {
"listen": "127.0.0.1",
"port": 8080,
"protocol": "http",
"settings": {
"allowTransparent": false,
"userLevel": 1
}
},
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "168.168.168.168这里改成代理网站IP",
"port": 8888这里改成代理网站端口,
"users": [
{
"id": "c503b067-e78f-b037-1ac7-7b369103ec9f这里改成代理网站的uuid",
"level": 1,
"alterId": 64
}
]
}
]
}
},
"outboundDetour": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"port": "54-79",
"outboundTag": "direct"
},
{
"type": "field",
"port": "81-442",
"outboundTag": "direct"
},
{
"type": "field",
"port": "444-65535",
"outboundTag": "direct"
},
{
"type": "field",
"domain": [
"gc.kis.scr.kaspersky-labs.com"
],
"outboundTag": "direct"
},
{
"type": "chinasites",
"outboundTag": "direct"
},
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "direct"
},
{
"type": "chinaip",
"outboundTag": "direct"
}
]
}
}
}After configuration, restart the v2ray service with systemctl restart. If you don't know how, just restart the server directly.
5. Edit the WordPress configuration file and add proxy configuration information.
/** 代理 */
define('WP_PROXY_HOST', '127.0.0.1');
define('WP_PROXY_PORT', '8080');
define('WP_PROXY_BYPASS_HOSTS', 'localhost, *.wordpress.org');Add the foreign URLs that WordPress needs to access to the third line above, save, and upload to overwrite.
Then go to the WordPress backend to test the effect. Previously, plugin resources that could not be loaded normally can now be accessed normally.
Reference: https://s5s5.me/3721