Last update at :2024-07-07,Edit by888u
If there are many pictures in our website, and some of them may be relatively large, and the server bandwidth is relatively small, the pictures can actually be stored separately in third-party cloud storage. Snail has previously introduced WPCOS, a WordPress plug-in based on Tencent Cloud COS (introduced here). Today, in this article, we will introduce the WPOSS plug-in based on Alibaba Cloud OSS object storage, which can also enable WordPress to upload attachments and manage them separately from website content. .
First, prepare and apply for Alibaba Cloud OSS object storage
1. The importance of backup
If we are not particularly familiar with it, it is recommended to use snapshots to back up the server, so that it can be restored even if there is a misoperation.
2. Apply for and activate Alibaba Cloud OSS object storage
We can open an object storage bucket in Alibaba Cloud OSS, but due to cost considerations, it is actually more cost-effective for us to purchase the corresponding storage package. There are no special discounts for Alibaba Cloud OSS storage packages. In the past, Snail did not pay attention to whether they had any discounts. Generally, the discounts were mainly concentrated on cloud servers and databases.
Here we set the storage name and read and write permissions according to our own needs, otherwise it cannot be written. The ones marked in red circles are those that will be filled in later and will be used in the plug-in.
Here Snail demonstrates this plug-in without applying for a custom domain name. We can set up our own domain name binding for storage and enable CDN acceleration. We can choose to use these according to our actual needs. I will share the binding domain name and CDN settings when I have the opportunity in the future.
3. Prepare the required parameters
Here we also need to determine this parameter, which will be used later. The BUCKET domain name is randomly configured by Alibaba Cloud OSS. If we have a custom domain name, we will use our own domain name.
4. Alibaba Cloud API application
We need to obtain the current API information, AccessKey ID and AccessKey Secret parameters. After preparing these, we can install the plug-in.
Second, install the WPOSS plug-in and debug normally
1. Plug-in download
Plug-in address: https://github.com/laobuluo/wposs
Or we can directly search for the WPOSS plug-in on the WordPress plug-in platform to download, activate and install it.
2. Plug-in settings
Fill in the parameters based on the parameters we obtained above. In particular, you need to pay attention to the two marked paths, which need to be consistent. It is recommended to follow the recommended method. Because it is consistent and can be unified later when migrated back, including the replacement path being consistent. According to our actual needs, whether we only store it in OSS, or whether we also need it locally.
Finally, we try to upload the image to check if there are any problems. If there are no problems, we can continue to the next step. If you cannot upload images, or the website has adverse reactions, then check the problem, or do not use it temporarily (for details, please refer to: Complete WordPress Enable WPOSS Storage Plug-in to Bind Alibaba Cloud OSS Cloud Storage).
Third, follow-up website organization work
If there are no adverse effects from running the plugin, continue with this step. Because some of our netizens currently use third-party storage to manage images, but there are still old images in the website locally. Therefore, for unified management, we need to upload the local images to the corresponding OSS directory, and then replace the original addresses of the images in batches with the database. Table of contents. Use MYSQL batch operation commands with caution.
If we are a new website, there is no need to worry about this problem, and there is no need to replace everything from scratch. In short, websites that already have data must be backed up, as some netizens are prone to replacement errors.
To summarize, if we have a lot of pictures, or the server configuration is relatively low, we can use these third-party storage to alleviate the storage pressure. If the website is not large, or after all, it is necessary to pay to open third-party storage separately, which saves costs. Consider we can also choose whether we need to use it.
Recommended site search: Korean independent server, registration-free jsp space, domain name purchase, US website server, vps server rental, domain name transaction, registration-free virtual host, free website space application, registration-free cdnasp website space,
发表评论