CentOS 7系统安装Ghost

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云防火墙,500元 1000GB
简介: 版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/51492038 CentOS 7系统安装Ghost作者:chszs,未经博主允许不得转载。
版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/51492038

CentOS 7系统安装Ghost

作者:chszs,未经博主允许不得转载。经许可的转载需注明作者和博客主页:http://blog.csdn.net/chszs

一、Ghost介绍

Ghost是一个开源、免费的博客平台,它基于Node.js构建,设计目标是简化在线发布博客的过程。
本文主要讲述怎样在CentOS 7上安装Ghost。

二、安装过程

1、首先确保所有的系统包为最新

# yum -y update

2、安装LAMP服务器

安装基本的LAMP环境是必须的,LAMP是指Linux、Apache、MariaDB、PHP。

1)安装Apache服务器

# yum install httpd openssl mod_ssl

重启Apache服务器

# systemctl restart httpd
# systemctl status httpd
# systemctl enable httpd

2)安装MariaDB数据库

# yum install mariadb mariadb-server mysql

默认情况下,MariaDB并不够安全,故应该修改其默认配置来加固其安全。使用mysql_secure_installation脚本,并注意以下的步骤细节,比如设置root账户的密码、移除匿名用户、不允许root账户远程登录、移除test数据库和时序安全访问MariaDB等。

# mysql_secure_installation

像这样进行配置:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

下一步需要登录到MariaDB控制台并为WikkaWiki创建一个数据库。运行以下命令:

# mysql -u root -p    

重启MariaDB

# systemctl restart mariadb
# systemctl status mariadb
# systemctl enable mariadb

3)安装PHP

# yum install php php-mysql

如果PHP应用还需要一些扩展模块,可以选择安装,如下:

php-bcmath          : A module for PHP applications for using the bcmath library
php-cli             : Command-line interface for PHP
php-common          : Common files for PHP
php-dba             : A database abstraction layer module for PHP applications
php-devel           : Files needed for building PHP extensions
php-embedded        : PHP library for embedding in applications
php-enchant         : Enchant spelling extension for PHP applications
php-fpm             : PHP FastCGI Process Manager
php-gd              : A module for PHP applications for using the gd graphics library
php-intl            : Internationalization extension for PHP applications
php-ldap            : A module for PHP applications that use LDAP
php-mbstring        : A module for PHP applications which need multi-byte string handling
php-mysql           : A module for PHP applications that use MySQL databases
php-mysqlnd         : A module for PHP applications that use MySQL databases
php-odbc            : A module for PHP applications that use ODBC databases
php-pdo             : A database access abstraction module for PHP applications
php-pear.noarch     : PHP Extension and Application Repository framework
php-pecl-memcache   : Extension to work with the Memcached caching daemon
php-pgsql           : A PostgreSQL database module for PHP
php-process         : Modules for PHP script using system process interfaces
php-pspell          : A module for PHP applications for using pspell interfaces
php-recode          : A module for PHP applications for using the recode library
php-snmp            : A module for PHP applications that query SNMP-managed devices
php-soap            : A module for PHP applications that use the SOAP protocol
php-xml             : A module for PHP applications which use XML
php-xmlrpc          : A module for PHP applications which use the XML-RPC protocol

4)配置防火墙

CentOS 7的防火墙默认会阻塞一切,故必须在防火墙允许HTTP/HTTPS通过防火墙。执行命令:

# sudo firewall-cmd --permanent --zone=public --add-service=http
# sudo firewall-cmd --permanent --zone=public --add-service=https
# sudo firewall-cmd --reload

3、安装Node.js和npm

运行以下命令安装Node.js和npm:

# yum install nodejs npm --enablerepo=epel

验证安装是否正确,执行:

# node -v && npm -v
v0.10.26
1.3.6

4、安装Ghost

下载并解压Ghost:

# mkdir -p /var/www/html
# cd /var/www/html
# curl -L -O https://ghost.org/zip/ghost-latest.zip  
# unzip -d ghost ghost-latest.zip  
# cd ghost
# sudo npm install --production

Ghost安装完成后,进行配置并用主机的域名更新配置文件中的URL。

# cp config.example.js config.js

打开配置文件:

# nano config.js

找到“Production”节,用域名更新URL,修改后看起来如下:

// ### Production
    // When running Ghost in the wild, use the production environment.
    // Configure your URL and mail settings here
    production: {
        url: 'http://your_domain',

至此完成了整个安装过程,可以启动Ghost了。

# npm start –production

三、访问Ghost

Ghost默认在HTTP 80端口下是可用的。所以打开浏览器,访问http://server-ip:2368,完成剩余的安装步骤。如果主机上使用了防火墙,需要允许2368端口通过。

目录
相关文章
|
域名解析 存储 弹性计算
云服务器 ECS 建站教程:部署Ghost博客(CentOS 7)
Ghost是一个免费的开源博客平台,使用JavaScript编写,基于Node.js,旨在简化个人博客和在线出版物的在线发布过程。
2111 0
云服务器 ECS 建站教程:部署Ghost博客(CentOS 7)
|
弹性计算 Java 应用服务中间件
|
应用服务中间件 索引
从零开始,CentOS6安装ghost博客
买了个Bandwagon的VPS来科学上网的,寻思着空间还大顺便做个博客呗. 然后就安装了AMH面板,再搞了个wordpress博客玩玩. 接触到Ghost博客的时候,心血来潮想装一个. 然后就试着搞了.
1293 0
|
5天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
54 25
|
15天前
|
监控 Linux PHP
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
【02】客户端服务端C语言-go语言-web端PHP语言整合内容发布-优雅草网络设备监控系统-2月12日优雅草简化Centos stream8安装zabbix7教程-本搭建教程非docker搭建教程-优雅草solution
65 20
|
1月前
|
存储 分布式计算 Hadoop
Centos7.9安装kerberos
Centos7.9安装kerberos
86 25
|
1月前
|
存储 Shell 网络安全
Centos7.9安装openldap
Centos7.9安装openldap
58 16
|
1月前
|
数据可视化 Linux 应用服务中间件
Centos7.9安装phpldapadmin
Centos7.9安装phpldapadmin
62 15
|
1月前
|
网络协议 Java 应用服务中间件
centos7环境下tomcat8的安装与配置
本文介绍了在Linux环境下安装和配置Tomcat 8的详细步骤。首先,通过无网络条件下的文件交互软件(如Xftp 6或MobaXterm)下载并解压Tomcat安装包至指定路径,启动Tomcat服务并测试访问。接着,修改Tomcat端口号以避免冲突,并部署Java Web应用项目至Tomcat服务器。最后,调整Linux防火墙规则,确保外部可以正常访问部署的应用。关键步骤包括关闭或配置防火墙、添加必要的端口规则,确保Tomcat服务稳定运行。
|
3月前
|
SQL 存储 Linux
从配置源到数据库初始化一步步教你在CentOS 7.9上安装SQL Server 2019
【11月更文挑战第16天】本文介绍了在 CentOS 7.9 上安装 SQL Server 2019 的详细步骤,包括配置系统源、安装 SQL Server 2019 软件包以及数据库初始化,确保 SQL Server 正常运行。
168 4

热门文章

最新文章