Ali cloud built using the WordPress Website - static and dynamic separation and CDN acceleration

WordPress is a very popular blog site platform, can also be used as a content management system (CMS) to use, is one of the world's most widely used blog system. There are many excellent WordPress plugin that makes this open-source product very easily scale to meet different needs.
I am ready to take advantage of a series of articles, to show a variety of products (elastic computing, database, security, etc.) If you use Ali cloud, build a complete WordPress site. content include:

Third, the static and dynamic separation and CDN acceleration

Static and dynamic separation is a common way of website optimization, static resources through the Web site and back-office applications deployed separately, to improve the user experience by improving the access speed of static counseling.
Users upload attachments have been stored in the NAS file storage which can be placed through the WordPress plugin OSS Ali cloud object storage, the storage cost. CDN acceleration section chose Ali cloud CDN product, without the use of site-wide DCDN acceleration ( https://www.aliyun.com/product/dcdn ), which is the main reason behind the increase of high anti-IP demonstration will be conflicts ; otherwise use DCDN dynamic acceleration that make dynamic web requests to jump through the CDN edge node Ali cloud, back to the source faster.
This part of the organization chart below, based on a version adds:

  • OSS Object Storage: store the user to upload attachments to WordPress
  • CDN: reading static file attachments accelerated by caching mechanism CDN edge node

1

OSS ready to store attachments

Ali OSS cloud object storage ( https://www.aliyun.com/product/oss ) without pre-paid version, so be sure to remember to buy the package to offset the amount of resources, it will be very worthwhile. First create a Bucket, pay attention to read and write permissions (ACL) should be set to private, behind with authority to control the use of, or brush if it will lead to significant increase in usage fees.

2

Once created, you need to get outside in the area VPC network node address and domain name addresses Bucket record, it will be used later.

3

Then filling to OSS domain name, the domain name and pay attention to the master domain name is not the same, in order to enable a static file attachment to OSS to deal with. CDN acceleration is not used here, is arranged behind the same individual.
Also note that if the domain name and DNS domain name instead of adding external Bucket previously recorded addresses in the DNS inside, then finally add a CNAME record automatically function the same account below is not available, manually.

4

Then back to the installation and set WPOSS plug. Bucket name needs to be configured, the nodes previously recorded area (within the network), the AK information (refer to https://help.aliyun.com/document_detail/31827.html ), local folder (the default value wp-content / uploads), Bucket and last name + file path tail. Bucket domain name on the front of the domain name in the DNS settings, of course, also be used outside the bucket domain name addresses directly, but nothing seemed not very professional website.
5

6

After the setup is complete, try to insert a file in the WordPress media, then you can see in the OSS. If you selected "not in the local backup copy" option when set, then connect the NAS ECS in the local folder (by default wp-content / uploads) would no longer be retained in the file.

7

8

前面将OSS的ACL设置为了私有,为了让WordPress的读者可以下载文件,可以利用Bucket Policy授权功能,将资源路径(默认wp-content/uploads/*)中的资源以HTTP的方式进行读取,这样才能让读者看到并且下载博文中的附件。参考https://help.aliyun.com/document_detail/85111.html

9

10

OSS是按使用量收费的服务,如果被他人盗链有可能会产生额外费用。所以,一般来说需要利用防盗链功能进行防护。添加域名(https后面才会用到)即可。参考https://help.aliyun.com/document_detail/31901.html

11

利用CDN加速

WordPress largest data from file attachments are generally added CDN can greatly improve the download speed of the user's files. Ali cloud CDN ( https://www.aliyun.com/product/cdn ) 2500 edge node have a much higher than Tencent, Huawei 1100 + a, Ali cloud visible attention and investment in the CDN content distribution network.
Also mention that Ali cloud CDN products which have a very important product, called DCDN Full Site Accelerator ( https://www.aliyun.com/product/dcdn ), and the general CDN not only as support for static file acceleration, Ali also take advantage of the rich cloud edge node dynamic acceleration. Dynamic acceleration recently supported the Websocket and IP Application Accelerator, personal understanding in the industry is already one of the best, you can find out: https://yq.aliyun.com/articles/686839 , https://yq.aliyun.com/articles/ 703,346 .
But this demo using pure static acceleration, on the first CDN on a general good. Note that the information provided to the source station selected OSS domain name, port 80 (corresponding to the previously OSS Bucket Policy authorized HTTP).
12

13

After completion of the addition system is provided to generate a CNAME DNS to resolve in the cloud. Host can be freely selected records, general use of such static or oss it relatively easy to understand.
14

Back to the OSS confirmed it, you should see DNS and CDN automatically pull information, which represents the set is complete.
15

16

WordPress upload a file back to try, this does uploaded to the OSS Bucket inside.
17

Guess you like

Origin yq.aliyun.com/articles/703420