Home > Web Front-end > JS Tutorial > body text

Sharing the steps to build a ghost blog on centos

php中世界最好的语言
Release: 2018-05-24 09:57:05
Original
2369 people have browsed it

This time I will share with you the steps to build a ghost blog in centos. What are the precautions for building a ghost blog in centos? The following is a practical case, let’s take a look.

1. Introduction

Ghost is an open source blogging platform built on

Node.js, with an easy-to-use writing interface and experience. Blog content is written in Markdown syntax by default, with the goal of replacing bloated WordPress. This article mainly introduces how to quickly build the ghost blog platform on centos7.3, using yum to installmysql and nginx software.

2. Installation

Install mysql

wget -i -c http://dev.mysql.com/get/mysql57 -community-release-el7-10.noarch.rpm

yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql mysql-server
systemctl enable mysqld. service
systemctl start mysqld.service
mysql -uroot -p # The initial password is empty
mysql> USE mysql;
mysql> UPDATE user SET password=password('******* *') WHERE user='root';
mysql> flush privileges;
mysql> FLUSH PRIVILEGES;
mysql> exit;

Create a new user, ghost cannot run as root , official instructions have been made (

https://docs.ghost.org/docs/install)

useradd ops

usermod -aG wheel ops
passwd ops
su - ops

Install Nginx and Node.js

sudo yum -y update

sudo yum -y install nginx nodejs

Install 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

Interaction issues during installation:

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

3. Start the blog

After executing the above installation process, you will Tell you how to start your own blog. My startup method is as follows:

sudo systemctl start ghost_jidongdong-cn

Configure 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. Log in

Enter your domain name or host IP in the browser to log in. The default background management interface is: http://[domain name]/ghost

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

Analysis of https usage cases in Node.js

Analysis of Node.js cluster module usage detailed explanation

How to use JS H5 to implement WeChat shake

The above is the detailed content of Sharing the steps to build a ghost blog on centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!