Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to store WordPress remote attachments on cloud object storage COS

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

What this article shares to you is about how to store WordPress remote attachments on cloud object storage COS, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Don't say much, let's take a look at it.

Brief introduction

WordPress can save multimedia content on Tencent Cloud COS through third-party plug-ins. Saving multimedia content on COS has the following advantages:

Multimedia content will have higher reliability

Your server does not need to prepare additional storage space for multimedia content

Visitors will be directly connected to the COS server when viewing and downloading multimedia content, which does not occupy the downlink bandwidth / traffic of your server, and the access speed is faster.

It can cooperate with Tencent Cloud CDN to further improve the speed of viewing and downloading multimedia content.

Preparatory work

Build WordPress.

You can download the latest version of WordPress and view the installation instructions on the WordPress official download page.

You can also search for CVM images with pre-installed WordPress programs in Tencent Cloud Marketplace.

Create a bucket with public read and private write. The region of the bucket is recommended to be the same as the CVM running WordPress. For more information on how to create a bucket, please see the bucket creation document.

Find the bucket you just created in the bucket list, and record the bucket name and the region abbreviation to which it belongs. For more information on region abbreviation, please see the region and access domain name documents.

Go to the access management console and record the SecretId and SecretKey in the key.

Install and configure the WordPress plug-in

Log in and access the WordPress dashboard.

On the install plug-in page, search for and install the Media Cloud plug-in.

Enable the Media Cloud plug-in, which automatically opens the configuration wizard, and then click NEXT.

? If the configuration wizard cannot be opened automatically, select Media Cloud from the left menu of WordPress and click Setup Wizard under Cloud Storage.

Select S3 Compatible in the storage provider interface, and then click NEXT.

Configure the following in the subsequent form, and click NEXT when the configuration is complete:

Configuration item configuration value SecretKeyBUCKET bucket name in SecretIdSECRET access key in ACCESS KEY access key REGION Select AutomaticCUSTOM ENDPOINT format as cos..myqcloud.com, where is the regional abbreviation of the region to which the bucket belongs. For example, if the region of Guangzhou is abbreviated as ap-guangzhou, enter cos.ap-guangzhou.myqcloud.com for this configuration item.

At this point, Media Cloud will test whether the configuration is correct, click START TESTS to start the test, and click NEXT after all the tests are successful.

The Media Cloud prompt is ready, click ADVANCED SETTINGS to close the configuration wizard.

Test multimedia content

Write articles, add multimedia content and publish.

Copy the image address in the article, or use the browser debugging tool to view the image path. You can see that the image address is the address on Tencent Cloud COS object storage.

Check the download address of the article attachment, and you can see that the download address also points to the address on Tencent Cloud COS object storage.

Use Tencent Cloud CDN

Configure CDN acceleration for buckets that hold WordPress attachments. Refer to the CDN acceleration configuration documentation.

Go to the management interface of Media Cloud and click Settings under Cloud Storage.

Set CDN Base URL in CDN SETTINGS to your CDN domain name, such as COS's default acceleration domain name https://wordpress-1250000000.file.myqcloud.com/ or your custom acceleration domain name https://static.foo.bar/.

Check the multimedia content in the previously published article and you can see that the relevant address already points to the CDN domain name that you configured.

The above is how to store WordPress remote attachments to the cloud object storage COS. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report