亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Home CMS Tutorial WordPress [Tutorial] Wordpress slow domestic network speed acceleration and fast CF switching to prevent DDOS attacks

[Tutorial] Wordpress slow domestic network speed acceleration and fast CF switching to prevent DDOS attacks

Feb 20, 2021 pm 05:20 PM
wordpress

The following tutorial column of WordPress will introduce to you the tutorial on accelerating the slow domestic network speed of WordPress and preventing DDOS attacks and fast CF switching tutorial. I hope it will be helpful to friends in need!

[Tutorial] Wordpress slow domestic network speed acceleration and fast CF switching to prevent DDOS attacks

Recently, a customer said that his website is abroad, but the domestic website is very slow to open, because domestic and foreign users visit more frequently, and they hope to have their website www.pjcourse .com domestic access speed will be improved. Their program uses wordpress. In general, WordPress plug-in templates load a lot of data, even if a caching plug-in such as wprocket is installed, js, css compression, or database optimization is performed. In fact, the speed of the website will not be greatly improved.

After some simple analysis, I plan to move their website to the cn2 gia line space provider. This may be the fastest way to improve the website speed. The following is some of my practical sharing, and how to quickly switch data when the website is attacked.

Note: Although this machine is placed abroad, the probability of Baidu spider crawling errors such as 403 is almost non-existent.

1. Analysis of the current website situation

Before the website was relocated, the space was placed in Digitalocean, and the CDN was cloudflare. Although digitalocean is a very good space provider abroad, for domestic users, cloudflare is used for access, so the speed is still very slow.

In addition, although it is possible to use separate line dns for analysis, the operation will be more troublesome. So this article does not discuss it.

Through the incognito browser chrome, it can be seen that it takes 6.35 seconds to fully open. The early rendering took 4.46 seconds.

In addition, it can also be seen through the webmaster home speed test. Telecom lines are slightly faster. However, the speed of China Unicom and China Mobile is obviously more than 4 seconds.

# 2. Website relocation

Regarding the choice of space provider, in fact, as long as Choose the right stable space and good lines. Basically everything is possible. What I choose now is cn2 gia ecommerce which is used by bricklayers. The biggest advantage of cn2 gia is that access to all three domestic networks is very fast. And this space quotient is also the most stable speed. My current quarter is $49.99, which is actually equivalent to $16 a month.

SSD: 20 GB RAID-10

RAM: 1 GB

CPU: 2x Intel Xeon

Transfer: 1000 GB/mo

You can choose different hosts according to each person's situation. However, it is recommended that you do not need to buy a particularly good host when the traffic is not very large at the beginning. You can expand the capacity later.

##1. Operating system selection

I am using ubuntu 20.04. php 7.4 nginx mysql. Why choose this? Because php 7.4 is 30% faster than php 7.2.

##2. Command line

Why not use Pagoda? Because there was a big loophole in the pagoda some time ago. And for this part of the website, I feel that it is better to use other third-party tools as little as possible. In addition, the VPS you build can also be as clean and tidy as possible. Fewer external programs.

The following command line is based on ubuntu 20.04. Just follow the command. Basically nothing wrong.

ssh root@... -p port number

The asterisk above is IP address. -p is the specified port. Because the default ssh port of Bricklayer is not 22, it needs to be specified here.

Step 1: Install nginx

sudo apt update

sudo apt install nginx

Step 2: Turn on the firewall

sudo ufw app list

sudo ufw allow 'OpenSSH'

sudo ufw allow 'Nginx HTTPS'

sudo ufw allow 'Nginx HTTP'

sudo ufw enable — After typing this command, you will be prompted that the ssh connection may be interrupted. Just enter y and press Enter.

Step 3: Install mysql

sudo apt install mysql-server

sudo mysql_secure_installation (This step is optional, this is a security script).

Enter y and press Enter, select 2, the strongest password, and enter a new password. This password is the root password of mysql.

Then select y for all. One is to remove anonymous users, the other is to prohibit database root remote login, and the last is to remove the test database.

Finally choose y. The script takes effect immediately. ############

Step 4: Install php module

sudo apt install php-imagick php7.4-fpm php7.4-mbstring php7.4-bcmath php7.4-xml php7.4-mysql php7.4 -common php7.4-gd php7.4-json php7.4-cli php7.4-curl php7.4-zip

This is a command, just copy the entire code. This basically contains all the modules that WordPress can use.

sudo systemctl reload php7.4-fpm nginx (restart and load configuration)

Step 5: Move the website data over

Because my website is WordPress, your website may be written by another program, so the content is different. I won’t write it down here. In addition, remember to make nginx.conf


server {
listen 80;
server_name your_domain www.your_domain;

root /var/www under the /etc/nginx/sites-enable/ directory /your_domain;

index?index.html?index.htm?index.php;location?/?{
????try_files?$uri?$uri/?=404;}location?~?\.php$?{
????include?snippets/fastcgi-php.conf;
????fastcgi_pass?unix:/var/run/php/php7.4-fpm.sock;
?}location?~?/\.ht?{
????deny?all;}
Replace your_domain in the configuration file with your domain name ****.com

Step 6: Configure and install ssl

SSL I use let's encrypt.

sudo apt install certbot python3-certbot-nginx

sudo certbot –nginx -d example.com -d www.example.com

Replace example.com with your own The domain name of the website. If there are multiple subdomains. Just add it yourself.

Please note here that you must first point the dns to the current VPS, otherwise the configuration will not be successful, if you are using Cloudflare. To turn off CDN.

See the last sentence. Congratulations! Your certificate and chain have been saved at:

, which means the installation is successful.

This certificate is valid for 90 days, but certbot will run two systemd timers every day to check the validity of the certificate and automatically renew the certificate. You need to check if the timer is valid.

sudo systemctl status certbot.timer

The output result is as follows, which means it is normal.

● certbot.timer - Run certbot twice daily
Loaded: loaded (/lib/systemd/system/certbot.timer; enabled; vendor preset: enabled)
Active: active (waiting) since Mon 2020-05-04 20:04:36 UTC; 2 weeks 1 days ago

Trigger: Thu 2020-05-21 05:22:32 UTC; 9h left

Triggers: ● certbot.service

##3. Test the network speed of the new website

Directly use domestic telecommunications to access the website, and the website opening time has been significantly improved. Compared with the previous speed, it has been increased by about 2-3 times. And this is the speed at night. The access speed at night is not affected at all.

Except for the address marked in red, the dns resolution has not yet taken effect, and the other IP speeds that have taken effect are obviously opened within 2 seconds.

##4. Prevent DDOS attacks and quickly switch between attack and defense with cloudflare

##Here I am It is recommended to use cloudflare to configure your website. By default, CDN is not enabled. That is, the domain name points directly to the IP. However, if you encounter DDoS and other attacks, it is recommended to immediately turn on the cloudflare proxy and point the IP to your backup clone space. Because the IP is hidden and a large amount of attacker's attack data will be filtered by Cloudflare, your website can be restored in just a few minutes as long as the response is timely.

In addition, you can locate your attack source IP through the access.log access log. And directly filter suspicious IPs in cloudflare's firewall. For example, use blocking access or verification codes to locate attackers. And the cf option can also block entire countries.

Also, enable under attack mode. Effectively blocks small and medium-sized attacks.


Article source: www.pjcourse.com###

The above is the detailed content of [Tutorial] Wordpress slow domestic network speed acceleration and fast CF switching to prevent DDOS attacks. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to adjust the wordpress article list How to adjust the wordpress article list Apr 20, 2025 am 10:48 AM

There are four ways to adjust the WordPress article list: use theme options, use plugins (such as Post Types Order, WP Post List, Boxy Stuff), use code (add settings in the functions.php file), or modify the WordPress database directly.

10 latest tools for web developers 10 latest tools for web developers May 07, 2025 pm 04:48 PM

Web development design is a promising career field. However, this industry also faces many challenges. As more businesses and brands turn to the online marketplace, web developers have the opportunity to demonstrate their skills and succeed in their careers. However, as demand for web development continues to grow, the number of developers is also increasing, resulting in increasingly fierce competition. But it’s exciting that if you have the talent and will, you can always find new ways to create unique designs and ideas. As a web developer, you may need to keep looking for new tools and resources. These new tools and resources not only make your job more convenient, but also improve the quality of your work, thus helping you win more business and customers. The trends of web development are constantly changing.

How to import the source code of wordpress How to import the source code of wordpress Apr 20, 2025 am 11:24 AM

Importing WordPress source code requires the following steps: Create a sub-theme for theme modification. Import the source code and overwrite the files in the sub-topic. Activate the sub-theme to make it effective. Test the changes to make sure everything works.

How to build a website for wordpress host How to build a website for wordpress host Apr 20, 2025 am 11:12 AM

To build a website using WordPress hosting, you need to: select a reliable hosting provider. Buy a domain name. Set up a WordPress hosting account. Select a topic. Add pages and articles. Install the plug-in. Customize your website. Publish your website.

How to add your WordPress site in Yandex Webmaster Tools How to add your WordPress site in Yandex Webmaster Tools May 12, 2025 pm 09:06 PM

Do you want to connect your website to Yandex Webmaster Tools? Webmaster tools such as Google Search Console, Bing and Yandex can help you optimize your website, monitor traffic, manage robots.txt, check for website errors, and more. In this article, we will share how to add your WordPress website to the Yandex Webmaster Tool to monitor your search engine traffic. What is Yandex? Yandex is a popular search engine based in Russia, similar to Google and Bing. You can excel in Yandex

How to set, get and delete WordPress cookies (like a professional) How to set, get and delete WordPress cookies (like a professional) May 12, 2025 pm 08:57 PM

Do you want to know how to use cookies on your WordPress website? Cookies are useful tools for storing temporary information in users’ browsers. You can use this information to enhance the user experience through personalization and behavioral targeting. In this ultimate guide, we will show you how to set, get, and delete WordPresscookies like a professional. Note: This is an advanced tutorial. It requires you to be proficient in HTML, CSS, WordPress websites and PHP. What are cookies? Cookies are created and stored when users visit websites.

How to fix HTTP image upload errors in WordPress (simple) How to fix HTTP image upload errors in WordPress (simple) May 12, 2025 pm 09:03 PM

Do you need to fix HTTP image upload errors in WordPress? This error can be particularly frustrating when you create content in WordPress. This usually happens when you upload images or other files to your CMS using the built-in WordPress media library. In this article, we will show you how to easily fix HTTP image upload errors in WordPress. What is the reason for HTTP errors during WordPress media uploading? When you try to upload files to Wo using WordPress media uploader

How to register a wordpress account How to register a wordpress account Apr 20, 2025 am 11:45 AM

To create an account on WordPress, simply visit its website, select the registration option, fill in the registration form, and verify your email address. Other ways to register include using a Google account or Apple ID. The benefits of signing up include creating a website, gaining features, joining the community, and gaining support.

See all articles