您好,欢迎来到爱娱乐。
搜索
您的当前位置:首页centos 上快速搭建ghost博客方法分享

centos 上快速搭建ghost博客方法分享

来源:爱娱乐


新建用户, ghost不能用root运行,官方已做说明(https://docs.ghost.org/docs/install)

useradd ops
usermod -aG wheel ops
passwd ops
su - ops

安装Nginx和Node.js

sudo yum -y update
sudo yum -y install nginx nodejs

安装ghost

sudo npm i -g ghost-cli
sudo chown ops.ops /var/www/ghost/
sudo chmod 755 /var/www/ghost/
cd /var/www/ghost/
ghost install

安装过程中的交互问题:

https://docs.ghost.org/docs/cli-install#section-prompts

3. 启动博客

执行完上面的安装过程,会告诉你如何启动自己的博客,我的启动方式如下:

sudo systemctl start ghost_jidongdong-cn

配置Nginx

# cat /etc/nginx/conf.d/jidongdong.cn.conf
server {
        listen 80;
        server_name blog.jidongdong.cn;
        location / {
                proxy_pass  http://127.0.0.1:2368;
                proxy_set_header Host blog.jidongdong.cn;
                proxy_set_header    X-Forwarded-For $remote_addr;
        }
}
# service nginx restart

4. 登录

浏览器输入你的域名或者主机IP即可登录。后台管理界面默认为:http://[域名]/ghost

Copyright © 2019- avor.cn 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务