中文版

耗时:1周

时间:1.1.2024-1.7.2024

地点:英国南安普顿Mayflower

过往经验:基于GitHub托管的静态博客网站

参考:Halo官方文档

云服务器:google cloud

操作系统:CentOS 7.X

公网IP:35.197.193.245

SSH管理工具:Termius

SFTP工具:Termius

动态个人网站:Halo

Halo博客环境:JDK 17

代理服务器:Nginx

域名购买:Godaddy

域名:www.tqwbester.com

English Edition

Time taken: 1 week

Time: 1.1.2024-1.7.2024

Location: Mayflower, Southampton, UK

Past experience: Static blog website hosted on GitHub

Reference: Halo official documentation

Cloud server: google cloud

Operating system: CentOS 7.X

Public IP: 35.197.193.245

SSH management tool: Termius

SFTP tool: Termius

Dynamic personal website: Halo

Halo blog environment: JDK 17

Proxy server: Nginx

Domain name purchase: Godaddy

Domain name: www.tqwbester.com

流程总结

  1. 选择Docker Compose部署Halo(2.11)

  2. 安装环境:

    • docker容器

    • docker compose服务

    • JRE - JDK 17

    • wget包

    • vim包

    • 运行在docker中的mysql数据库

    • nginx反向代理环境

  3. 创建文件根目录,并检查各个环境的部署情况。

  4. 配置docker-compose.yaml文件

  5. 配置nginx.conf文件

配置好以后,可能会遇到一个问题:

访问公网ip加端口或者公网域名加端口是可以访问到halo的初始页面的,但去掉端口访问时,会跳转到Welcome to CentOS页面。

在之前的旧版本halo 1.4博客根据codesheep的教程搭建,访问会跳转到nginx页面,这说明反向代理设置和运行是正确的。

如何解决跳转到Welcome to CentOS页面问题:

有关CentOS 7 的 SELinux,使用反向代理需要打开网络访问权限。可以使用以下代码来打开网络权限,之后反向代理就正常运转了。

$ sudo setsebool httpd_can__network_connect 1

English Edition

Process summary:

  1. Select Docker Compose to deploy Halo (2.11)

  2. Installation Environment:

    1. docker container

    2. docker compose service

    3. JRE-JDK 17

    4. wget package

    5. vim package

    6. mysql database running in docker

    7. nginx reverse proxy environment

  3. Create a file root directory and check the deployment of each environment.

  4. Configure docker-compose.yaml file

  5. Configure nginx.conf file

After configuration, you may encounter a problem:

You can access the initial page of halo by accessing the public IP address and port or the public domain name and port. However, when you remove the port access, you will jump to the Welcome to CentOS page.

In the previous old version of the halo 1.4 blog, which was built according to codesheep's tutorial, access would jump to the nginx page, which shows that the reverse proxy is set up and running correctly.

How to solve the problem of jumping to the Welcome to CentOS page:

For SELinux on CentOS 7, using a reverse proxy requires turning on network access. You can use the following code to open network permissions, and then the reverse proxy will function normally.

$ sudo setsebool httpd_can__network_connect 1

tqwbester网站统治者