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 use Serverless Wordpress to quickly build a station

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

In this issue, the editor will bring you about how to use Serverless Wordpress to quickly build a station. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

WordPress is a blog platform developed in PHP language. Users can set up their own websites on servers that support PHP and MySQL databases, or use WordPress as a content management system (CMS). According to W3techs statistics, as of December 2020, about 39.9% of the world's websites use WordPress. Whether it is a personal blog, an official website, or a general content management system, it can be quickly built through Wordpress, and it is also one of the most popular dynamic website frameworks.

Tencent Cloud Serverless provides a new deployment method of Wordpress based on Serverless architecture. Through Serverless Framework Wordpress components, you can quickly deploy Wordpress projects in Serverless architecture in three steps.

Introduction to Architectur

The solution mainly uses the following resource modules to achieve complete Serverless from the access layer to the computing layer to the storage layer:

The module states that the SCF cloud function is responsible for the implementation of the access layer of Serverless Wordpress, thus running the external entrance of the WordPressAPI gateway WordPress. The Serverless storage warehouse TDSQL-C Serverless of RESTful APICFSWordPress realizes the postpaid database by creating a MySQL type database of TDSQL-C Serverless (formerly CynosDB), and automatically expands and shrinks the private network of VPC to open the network between SCF cloud function, CFS and TDSQL-C Serverless to ensure the advantage of network isolation. Support for Wordpress native framework

When traditional Wordpress projects migrate to Serverless, they often need to make a lot of changes to the native framework of the project to adapt to the Serverless architecture. With Serverless Wordpress components, you do not need to make any changes to the native project to directly complete the deployment, so that there is no intrusion into the framework, and subsequent version upgrades are supported.

two。 Reduce the cost of use

From the access layer to the computing layer to the storage layer, all use Serverless resources to achieve real postpaid, flexible scaling and great cost savings.

Example: take a personal blog website as an example. The daily visits are set to be stored in 1 GB file and 1 GB database, and the monthly fee is calculated as follows:-number of API gateway calls: 100000 "0.06" 30" 0.018 CNY / month traffic: 100,024 "0.8" 30" 0.068 RMB / month-number of calls to SCF cloud function SCF: 100,030,000 / month within the free quota There is no fee for the use of SCF resources: within the monthly free amount of 30/1000*100*30=900GBs/ No cost-CFS storage fee (monthly fee): 1 million 0.35 yuan / month-Serverless MySQL database storage fee: 1 yuan 0.00485 yuan / GB/ hour * 24 yuan 30 yuan 3.49 yuan / month calculation fee: 100 yuan 0.000095 yuan 30 yuan 0.285 yuan / month total: 0.018 yuan 0.068 yuan 0.35 yuan 3.49 yuan 0.285 yuan 4.211

By comparison, it can be found that, compared with the traditional self-built scheme, the cost of Serverless Wordpress is less than 5 yuan a month, and the cost of use is greatly reduced.

New users can get 30 yuan TDSQL-C and 5 yuan CFS file storage vouchers when they deploy the Wordpress application for the first time.

3. The deployment steps are simple.

Through the Serverless Wordpress component, you can quickly complete the deployment of Wordpress applications with only a few lines of yml file configuration, greatly reducing the threshold for deployment.

Welcome to experience for free!

Deployment steps

You can complete the Serverless Wordpress deployment from the command line or the console, as follows:

Deployment premise

Activate SCF cloud function service

Activate CFS file storage service

(optional) prepare the custom domain name that has been filed. You can also complete the filing through the Serverless filing resource package.

Console deployment

Step 1: log in to the Serverless application console and click "New App"

Step 2: according to the guidelines, fill in the application name, select "Application template"-- "Wordpress App", and click "create"

Note: currently, only Beijing, Guangzhou and Shanghai are supported.

Step 3: after the creation is completed, click "access App" to access your Wordpress project. You can also complete the configuration of the custom domain name on the application details page.

Command line deployment

Step 1: initialize the Serverless Wordpress configuration file locally

Sls init wordpress-name example

Step 2: enter the directory and execute sls deploy to complete the deployment.

$sls deployserverless ⚡ frameworkAction: "deploy"-Stage: "dev"-App: "appDemo"-Instance: "wordpressDemo" region: ap-shanghaizone: ap-shanghai-2vpc:. Cfs:. Db:. Apigw: created: true url: https://service-xxxxx.sh.apigw.tencentcs.com/release/. Layer:. WpInitFaas:. WpServerFaas:.

After the deployment is successful, click the output url in the apigw section, and complete the account password configuration according to the instructions, then you can start using your Wordpress application.

If you want to configure a custom domain name, you can also modify the serverless.yml configuration file, complete the configuration of the application information, or modify it in the console after deployment.

The above is the editor for you to share how to use Serverless Wordpress to quickly build a site, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to 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