Pineapple Pavilion ZBLOGCN .COM

Official Z-Blog Blog

It only takes three steps to quickly deploy the Z-BlogPHP blog in the Serverless architecture 👏

 banner-bg.png

Z-BlogPHP is a blog program provided by the Z-Blog community, which has been committed to providing excellent blog writing experience for domestic users. It has been 16 years since the first version was released in 2005. It is one of the few open source CMS systems that continuously provide updates in China. Z-BlogPHP supports PHP 5.2 - 7.4 and 8.0, and can run on all operating systems and WEB servers on the market. The database supports MySQL database (compatible with MariaDB), as well as smaller and more convenient SQLite database. Version 1.7 also supports PostgreSQL database.

With the gradual improvement of the Serverless architecture and its features of saving money, speed and high concurrency, more and more enterprises choose to set up their own services on Serverless. In order for ZBP users to quickly serverless their own blog website, Z-Blog team is united Tencent Cloud A new Z-BlogPHP deployment method based on the Serverless architecture is introduced. Through the Z-BlogPHP component of the Serverless Framework, the Z-BlogPHP project can be quickly deployed on the Serverless architecture in just three steps.

To create a Serverless Z-BlogPHP application, there are only three steps:

https://console.cloud.tencent.com/sls/create?t=zblogphp

Introduction to architecture

The scheme mainly uses the following resource modules to achieve full serverless from the access layer to the computing layer to the storage layer:

modular explain
SCF Cloud Function Be responsible for the implementation of the access layer of serverless Z-BlogPHP to run Z-BlogPHP
API gateway External portal of Z-BlogPHP
CFS The serverless storage warehouse of Z-BlogPHP
TDSQL-C Serverless By creating a MySQL type database of TDSQL-C Serverless (the original CynosDB), the database can be charged by volume and automatically expanded and shrunk
VPC The intranet connects the SCF cloud function, CFS and TDSQL-C serverless to ensure network isolation

Functional advantages

Using Serverless to deploy Z-BlogPHP has the following advantages:

  1. Support Z-BlogPHP native framework

    The migration of traditional Z-BlogPHP projects to Serverless often requires the transformation of the original projects. With the Serverless Z-BlogPHP component, you can directly complete the deployment without any modification to the original project, and support subsequent version updates.

  2. Reduce use cost

    From the access layer to the computing layer to the storage layer, all serverless resources are used to truly achieve volume based billing, elastic scaling, and greatly save costs

    Example: Take a personal blog website as an example, set daily visits of 100, 1 GB file storage, 1 GB database storage, and the monthly fee is calculated as follows:
    -API gateway
    Number of calls: 100/10000 * 0.06 * 30=0.018 yuan/month
    Discharge: 100 * 30/1024/1024 * 0.8 * 30=0.068 yuan/month

    -SCF Cloud Function
    Number of SCF calls: 100 * 30=3000 times/month, free of charge
    SCF resource usage fee: 30/1000 * 100 * 30=900GBs/month free limit, no fee

    -CFS storage fee (monthly fee): 1 * 0.35=0.35 yuan/month

    -Serverless MySQL database
    Storage cost: 1 * 0.00485 yuan/GB/hour * 24 * 30=3.49 yuan/month
    Calculation cost: 100 * 0.000095 * 30=0.285 yuan/month

    Total: 0.018+0.068+0.35+3.49+0.285=4.211 yuan

    By comparison, we can find that compared with the traditional self built scheme, the cost of Serverless Z-BlogPHP is less than 5 yuan a month, which greatly reduces the use cost.

  3. Deployment is extremely simple

    It can be deployed directly through the Tencent cloud console. Or through the serverless Z-BlogPHP component, you can quickly complete the deployment of Z-BlogPHP applications with just a few lines of yml file configuration, greatly reducing the deployment threshold.

Deployment Steps

You can use the command line or Console Complete the serverless Z-BlogPHP deployment as follows:

Deployment premise

  • Activate SCF cloud function service

  • Activate CFS file storage service

  • (Optional) Prepare the filed custom domain name, or you can complete the filing through the Serverless filing resource package

Console deployment (recommended by novice users)

  • Step 1: Log in to the Serverless application console and click "New Application"

     640.png

  • Step 2: Fill in the application name according to the instructions, select "Application Template" ->"Z-BlogPHP Application", and click "Create"

     QQ screenshot 20210504125142.png

  • Step 3: After creation, click "Access Application" to access your Z-BlogPHP project. You can also complete the configuration of custom domain names on the application details page

     QQ screenshot 20210504125726.png

Command line deployment

  • Step 1: Initialize the Serverless Z-BlogPHP configuration file locally

    sls init zblogphp --name example

  • Step 2: Enter the directory and execute SLS deploy to complete the deployment

     QQ screenshot 20210504125820.png


Serverless Z-BlogPHP, Just three steps

https://console.cloud.tencent.com/sls/create?t=zblogphp

Powered By Z-BlogPHP 1.7.3

ZBLOGCN. COM All rights reserved E ICP B No. 19031813 - 6 Shoot the clouds again Provide CDN and cloud storage services

It is strictly prohibited to use Z-BLOG to engage in any illegal activities, and illegal websites are prohibited to use Z-BLOG and related procedures| Illegal and Bad Information Reporting Center