1,更新系统到最新

yum update -y

2,安装 yarn

curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
<br>yum install yarn

3,安装 node,直接下载可执行文件,不需要源码安装

tar xzf node-v10.13.0-linux-x64.tar.gz
<br>mv node-v10.13.0-linux-x64 /usr/local/nodejs
<br>#(安装 yarn 时会安装 node 0.6.4 版)
<br>mv /usr/bin/node /usr/bin/node.bak
<br>mv /usr/bin/npm /usr/bin/npm.bak
<br>ln -s /usr/local/nodejs/bin/node /usr/bin/node
<br>ln -s /usr/local/nodejs/bin/npm /usr/bin/npm

4,安装 ghost-cli

yarn global add ghost-cli@latest

5,添加一个有 sodu 权限的用户

adduser oops
<br>passwd oops
<br>usermod -aG wheel oops

6,切换用户

su - oops

7,新建目录及设置权限

sudo mkdir -p /home/wwwroot/ghost
<br>sudo chown oops.oops -R /home/wwwroot/ghost
<br>sudo chmod 775 /home/wwwroot/ghost
<br>cd /home/wwwroot/ghost

8,安装 ghost

ghost install

9,配置 nginx

location / {
<br>    proxy_set_header X-Real-IP $remote_addr;
<br>    proxy_set_header Host $http_host;
<br>    proxy_pass http://127.0.0.1:2368;
<br>    proxy_set_header REMOTE-HOST $remote_addr;
<br>    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
<br>    proxy_set_header X-Forwarded-Proto $scheme;
<br>}

10,启动 ghost

#***换成你的域名,aaa.com 就是 aaa-com
<br>systemctl start ghost_***
<br>systemctl status ghost_***
<br>systemctl enable ghost_***

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据