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 onNode.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 mysqlwget -i -c http://dev.mysql.com/get/mysql57 -community-release-el7-10.noarch.rpmCreate a new user, ghost cannot run as root , official instructions have been made (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;
https://docs.ghost.org/docs/install)
useradd opsInstall Nginx and Node.jsusermod -aG wheel ops
passwd ops
su - ops
sudo yum -y updateInstall ghostsudo yum -y install nginx nodejs
sudo npm i -g ghost-cliInteraction issues during installation:https://docs.ghost.org/docs/cli-install#section-promptssudo
chown ops.ops /var/www/ghost/sudo
chmod 755 /var/www/ghost/cd /var/www/ghost/
ghost install
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
# cat /etc/nginx/conf.d/jidongdong.cn.confserver {
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!