Ghost是基于 Node.js 构建的开源博客平台。Ghost具有易用的书写界面和体验,博客内容默认采用Markdown语法书写,本文和大家一起学习Vultr VPS配置Ghost博客,本次Vultr搭建博客是基于Ubuntu系统的。
一、更新和安装必要资源包
apt update && sudo apt upgrade -y
apt install -y build-essential
二、安装MySQL数据库
1.安装
apt install -y mysql-server
之后按要求输入root密码就可以了。
2.检查版本
mysql –version
3.安全配置
mysql_secure_installation
操作设置数据库的安全。
三、安装Nginx 引擎
apt install -y nginx
直接安装带镜像的版本就可以了,我们之前也说过Nginx安全环境。
四、安装Node.js和NPM
1.安装
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash –
apt install -y nodejs
2.检查版本
node -v && npm -v
五、安装Ghost-CLI
1.安装
npm install -g ghost-cli@latest
2.检查版本
ghost version
3.检查是否支持
ghost doctor
然后可以看到以下内容:
✔ Checking system Node.js version
✔ Checking current folder permissions
✔ Checking operating system
✔ Checking MySQL is installed
六、安装GHOST
1.创建目录
mkdir -p /var/www/ghost
2.进入目录
cd /var/www/ghost
3.安装
ghost install
4.根据提示输入
? Enter your blog URL: https://www.vultrla.com
? Enter your MySQL hostname: localhost
? Enter your MySQL username: root
? Enter your MySQL password: [Enter password you created when you installed MySQL] ? Enter your Ghost database name: [Whatever you want] ? Do you wish to set up Nginx? yes
? Do you wish to set up SSL? yes
? Enter your email (used for Let’s Encrypt notifications) [Your email for Let’s Encrypt] ? Do you wish to set up “ghost” mysql user? yes
? Do you wish to set up Systemd? yes
? Do you want to start Ghost? yes
5.检查运行
ghost ls
这样我们就已经操作完毕了,打开网站我们就可以看到Ghost博客,然后就可以进行管理了,对于新手站长来说可能有点难,只要我们按照操作步骤来进行就可以了。
Vultr 新用户直送 50-100 美元活动再次开启,社交 转发再领 3 美元
未经允许不得转载:Vultr中文网 » Vultr VPS配置Ghost博客(基于Ubuntu系统)