This article was last revised 1138 days ago, and some of the information may be out of date.If you need to update urgently, please leave a message in the comment area below.
"Cloud storage", or "online storage service", is a service launched by cloud service providers, which allows users to store data on multiple virtual servers hosted by a third party instead of a separate serverone。For our small bloggers, cloud storage has unique advantages over their small servers: stable, affordable, and extremely low data loss rate.(Of course, such a great thing is only available to registered users in China.) Therefore, we can use cloud storage, together with the management tools provided by cloud service providers, to build our own image library.
I am using cloud storage to host images.First, in order to reduce the load on the server and reduce the backup volume of blog data (original pictures need to be kept locally for backup);The second is to accelerate the images stored in cloud storage with the CDN provided by cloud service providers.I have used the cloud storage services of Youpai Cloud and Tencent Cloud. Take Youpai Cloud as an example, because Youpai Cloud costs no moneytwo。
Registered Account
First, you need to register a Youpai Cloud account, and you can also apply for the Youpai Cloud Alliance to obtain free vouchers.Refer to "Access and shoot cloud CDN」。
After you have a new account, you can get a monthly voucher worth 61 yuan, which can be used as a temporary deduction for consumption.
Create cloud storage service
Then find and enter on the home pagecloud storage, create a new service.
Except for the service name that needs to be filled in by yourself, other options can be left unchanged, and you can select the default.But in the "Authorized Operator" step, you need to create a newOperator accountIn the future, it can be used to manage images on local tools.
Check "readable", "writable" and "deletable" to give this operator all the permissions.Keep your password.After creation, the system will provide a domain name for testing, which can be used to test whether the connection is normal.
Fill in the acceleration domain name
Click "Enter Configuration" and fill in your own domain nameFiled domain name, and then go to the domain name resolver to configure the accelerated domain name CNAMEthree。
After the configuration of the acceleration domain name CNAME is completed, the private image library is almost ready for use.However, some settings are required for higher security in the future.
Some other settings
First, open the Browser Cache in Cache Control, and set the cache directory to/*, the cache time is defaulted, and then saved.
Then open Page Compression in Performance Optimization and WebP Adaptation in Cost Control.
Finally, "HTTPS" is the most important link.Enable HTTPS in the HTTPS Configuration at the top. You need to apply for a certificate first.
Click "Certificate Management", enter "SSL Certificate Service Background", select "Purchase Certificate" in the upper right corner, select "Let's Encrypt" certificate, create an order, and confirm payment.After completion, complete the domain name, fill in the domain name bound to Zappon Cloud, wait for approval, return to "HTTPS Configuration", enable the certificate, and enable "HTTPS Connection" and "Enforce HTTPS Access".Then open TLS 1.3 and set the Minimum TLS Version to TLSv1.2.
Local tools manage pictures
1. Another photo of Cloud Explorer
Although you can manage pictures on the web page, it is always good to have a client.Youpaiyun has a resource manager called "manager for upyun".Can be reachedGitHubDownload, or downloadLan ChanyunBackup file for.It can be downloaded without installation and used directly.
Fill in the "operator" account and password created above. The "space name" is the "service name" written by yourself in the step of creating cloud storage, and the "public URL" is the domain name bound to cloud storage.Then save the configuration and click Connect to use it.Is it super simple?
For image saving, it is recommended to use before uploadingCompression toolCompress it once, and then classify it according to your own preferences.For example, create by timetwo thousand and twentyFolder, subdivided below;Or according to the articleslugClassification.In the end, everything is up to you.
2. PicGo
If you think it's hard to use it, we can download itPicGoReplace it.coordinationTyporaAs long as PicGo runs in the background, you can upload pictures directly while writing without manual operation.
Installation process referenceOfficial Documents, here's a useLNMPProblems encountered: HTTP ERROR 500 Because the blue empty map bed usesThinkphpFrame, site directory inpublicAnd cross directory calls are requiredpublicFor files under the parent directory, LNMP does not allow cross directory access by default, so you need to remove the anti cross directory access setting. Enter the program directory and set.user.iniMove topublicMedium.without.user.iniThis file is manually stored in thepublicCreate one in.
cd /home/wwwroot/lskymv .user.ini publiccd publicchattr +i .user.ini
Use the lnmp installation package againtoolsUnder directory./remove_open_basedir_restriction.shRemove.
cd lnmp1.7/tools./remove_open_basedir_restriction.sh
fill/home/wwwroot/lsky/public You can refer to thisissue
Copyright notice:Unless otherwise stated, all articles are my own creation. Please contact the author for reprinting and quotation, and indicate the source (author, original link, etc.).
• Please fill in the real email when commenting so that you can receive the reply reminder. • Initial comments need to be reviewed, and comments irrelevant to the article should be posted on the message page.