搭建 Ghost 个人博客

安装必要的环境 安装 Nginx 安装 MySQL 安装 Nodejs 创建非 root 用户,以下默认该用户名为 ghostuser 安装 Ghost Ghost-cli 是专为 Ghost 开发的一款安装工具,它使得安装 Ghost 变得非常容易。 # 全局安装 Ghost-cli npm install ghost-cli@latest -g 选择一个目录作为 Ghost 的安装目录,个人建议将其放在 /var/www 中。 # 创建目录 mkdir /var/www/ghost -p && cd /var/www/ghost # 修改权限 chown ghostuser:ghostuser /var/www/ghost # 切换用户 su ghostuser # 安装 Ghost ghost install local # 登出 exit 特别注意:/var/www/ghost 及其下所有文件的所属为 ghostuser:ghostuser,请勿随意修改! Ghost 的所有操作必须由 非 root 用户 进行,若使用 root 用户 执行上述操作将会报错: gyp ERR! stack Error: EACCES: permission denied, mkdir 'xxx' 好心点的话,会给你一点提示: ...

三月 6, 2020  |  569 字  |  总阅读