centos安装配置ghost教程
这篇文章给大家分享的是centos系统中安装配置ghost博客的详细教程。小编觉得挺实用的,因此分享给大家做个参考。一起跟随小编过来看看吧。
1. 介绍Ghost 是一套基于 Node.js 构建的开源博客平台,具有易用的书写界面和体验,博客内容默认采用 Markdown 语法书写,目标是取代臃肿的 Wordpress。本篇文章主要是介绍在如何在centos7.3上快速搭建ghost博客平台,采用yum安装mysql、nginx软件。
2. 安装安装mysqlwget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpmyum -y install mysql57-community-release-el7-10.noarch.rpmyum -y install mysql mysql-serversystemctl enable mysqld.servicesystemctl start mysqld.servicemysql -uroot -p # 初始密码为空mysql> USE mysql;mysql> UPDATE user SET password=password('********') WHERE user='root';mysql> flush privileges;mysql> FLUSH PRIVILEGES;mysql> exit;
新建用户, ghost不能用root运行,官方已做说明(https://docs.ghost.org/docs/install)
useradd opsusermod -aG wheel opspasswd opssu - ops
安装Nginx和Node.js
sudo yum -y updatesudo yum -y install nginx nodejs
安装ghost
sudo npm i -g ghost-clisudo 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
执行完上面的安装过程,会告诉你如何启动自己的博客,我的启动方式如下:
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
关于centos安装配置ghost的教程就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。