Use Typecho to build a personal blog website and penetrate the intranet to achieve public network access

Use Typecho to build a personal blog website and penetrate the intranet to achieve public network access

Preface

Typecho is a combination of the two words type and echo, which came from the brainstorming of the development team. Typecho is developed based on PHP5 and supports a variety of databases. It is a lightweight open source blog program with a strong core, easy expansion, user-friendly experience, and smooth operation. Choose Typecho to build a unique personal web log publishing platform and enjoy the joy of creation.

Why use the panel tool to install? Because the panel tool integrates the environment required for installation and greatly simplifies our installation difficulty. Combined with the cpolar tool, we can remotely access typecho even when we are outside.

The following introduces how to build a typecho personal blog website that can be accessed remotely through Linux centOS8 + pagoda panel tool + Cpolar intranet forwarding tool.

1. Installation environment

According to official requirements, you need to install PHP5.0 or above, open the panel software store, search for PHP, select 8.0 here, and then wait for the installation to complete

image-20230314131357264

Next, install a web container, click on the panel website, install apache, and then wait for the installation to complete. If it is already installed, you can ignore it.

image-20230314131715468

2. Download Typecho

Click on the panel terminal and enter the apache root directory:

cd /www/wwwroot

Then create a folder called typecho

mkdir typecho

Go to folder

cd typecho

Execute download command:

wget https://github.com/typecho/typecho/releases/latest/download/typecho.zip

After the download is successful, we can see the compressed package

image-20230314133954770

Then unzip it to the current directory

unzip typecho.zip

3. Create a site

Click Website, create a web site, click Add Site, fill in the local address for the domain name: 127.0.0.1:8089, the port number can be specified by yourself, and for the root directory we choose the typecho directory we created above.

image-20230314151951743

Select Finish and click Submit

image-20230314152136309

4. Visit Typecho

After creating the site, we use Linux LAN ip+:8089, the port number we set above, access it in the browser, and you will see the Typecho welcome page

image-20230314152755818

5. Install cpolar

Open the Pagoda Terminal command window and use the cpolar installation script:

curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash

image-20230303183721806

token authentication

Log in to the cpolar official website www.cpolar.com, click on the left side验证 to view your authentication token, and then paste the token into the command line

cpolar authtoken xxxxxxx

20230111103532

Add services to the system

sudo systemctl enable cpolar

Start cpolar service

sudo systemctl start cpolar

Select security in the Pagoda panel. Then open port 9200

image-20230303184430176

Then access the LAN IP to port 9200 and the cpolar management interface will appear.

image-20230303184618711

Enter the account registered on the official website to log in to operate the tunnel.

image-20230303184844558

6. Remote access Typecho

We create a random 8089 tunnel in the cpolar management interface:

  • Tunnel name: Customizable, be careful not to repeat it
  • Protocol: http
  • Local address: 8089
  • Port type: random domain name
  • Region: China vip

Click Create

image-20230314155406808

Then open the online tunnel list, view the public network address of the created tunnel, and copy the address

image-20230314164755916

Open the browser and access it using the public address. Since the welcome page appears, it indicates success.

image-20230314165001125

7. Fixed remote access address

You need to upgrade to the basic package or above to support the configuration of second-level subdomain names.

Log incpolar official website backend, click 预留 on the left dashboard, find < a i=4>, reserve a second-level subdomain name for the http tunnel. 保留二级子域名

  • Region: Select server region
  • Name: Fill in the second-level subdomain name you want to reserve (can be customized)
  • Description: Notes, which can be customized

image-20230314170006145

This example reserves a second-level subdomain namedtypechoTest. After the subdomain name is successfully reserved, we copy the subdomain name and then configure it into the tunnel.

image-20230314170545018

Log in to the cpolar web ui management interface. Click 隧道管理——隧道列表 on the left dashboard, find the tunnel that needs to be configured with a second-level subdomain name (typecho tunnel in this example), and click < /span>编辑

image-20230314170626456

Modify the tunnel information and configure the second-level subdomain name into the tunnel:

  • Domain Type: Select instead二级子域名
  • Sub Domain: Fill in the second-level subdomain name we just reserved (in this case typechoTest)

After modification is completed, click更新

image-20230314170753759

After the tunnel is updated successfully, click on 状态——在线隧道列表 on the left dashboard. You can see that the public network address of the typechoTest tunnel has been updated to Second-level subdomain name, copy the public address.

image-20230314173108196

Open the browser and let's test accessing the successfully configured second-level subdomain name. The test is successful and you can access it normally. Now, our only private second-level subdomain name in the entire network has been created.

image-20230314174400808

8. Placement typecho

Click Start and click Next. If this problem occurs, let’s modify the permissions of the entire file.

image-20230314174736218

Just modify the typecho permissions

chmod -R 777 /www/wwwroot/typecho

Then open the Pagoda panel and create a mysql database

image-20230314180023904

Then change the database password to a password you can remember. The user name is root.

image-20230314180357402

After modification, we add a database

image-20230314180726940

After the addition is successful, add the database configuration information on the typecho page, fill in the information set above to create the database, and then click Confirm to start the installation.

image-20230314181221767

Then set and create account information

image-20230314181446269

The installation is successful. The username and password information appears on the page. You need to remember it, and then click below to access the control panel.

image-20230314181523451

Now we can publish our personal blog and create whatever we want.

image-20230314181654951

zGA-1700737870889)]

Then set and create account information

[External link pictures are being transferred...(img-XP3arET1-1700737870889)]

The installation is successful. The username and password information appears on the page. You need to remember it, and then click below to access the control panel.

[External link pictures are being transferred...(img-Vz96SSIe-1700737870889)]

Now we can publish our personal blog and create whatever we want.

[External link pictures are being transferred...(img-eZt8bkDB-1700737870890)]

Guess you like

Origin blog.csdn.net/2301_77053417/article/details/134584425