本文为您介绍手工搭建Ghost博客(Ubuntu 20.04)的最佳实践。 Ghost是基于Node.js开发的一款免费的非常出色的开源博客平台,具有即时预览、极致简约、支持多用户等特性,本文将指导用户在Ubuntu20.04操作系统上的云主机实例上部署Ghost博客。 前置条件 使用本文的操作步骤,弹性云主机实例必须满足以下前置: 实例需要分配公网IP或绑定弹性公网IP。 操作系统:Ubuntu 16.04、Ubuntu 18.04、Ubuntu 20.04、Ubuntu 22.04。 实例所在的安全组入方向安全规则放行22、80、4423、2368端口。 创建新用户 由于Ghost官方不推荐使用root用户直接进行操作。因此需要重新创建新的用户,并且为其配置权限。 1. 执行以下命令,创建新用户。 以创建test用户为例子。 plaintext adduser test 具体配置如下: plaintext root@ecm2d20Ghost:~ adduser test Adding user test' ... Adding new group test' (1000) ... Adding new user test' (1000) with group test' ... Creating home directory /home/test' ... Copying files from /etc/skel' ... New password: Retype new password: passwd: password updated successfully Changing the user information for test Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y 2. 执行以下命令,将新创建的用户添加到组。 plaintext usermod a G sudo test 3. 执行以下命令,切换到test用户。 plaintext su test