部署环境

  1. 本地环境:
    • Windows10(64bit)
    • 环境:git,Node.js,hexo…
    • 已部署成功的HEXO博客
  2. 服务器环境:
    • 阿里云CentOS纯净系统

服务器环境配置

安装Git(通过安装 ius 源的方式)

此处为通过第三方ius源的方式

安装依赖包

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker

因为使用的为纯净系统,所以不需要卸载Git

下载对应的 yum 源

[root@localhost ~]# wget https://centos7.iuscommunity.org/ius-release.rpm
……直到出现
2020-03-14 22:59:56 (184 MB/s) - ‘ius-release.rpm’ saved [8412/8412]

安装 yum 源

[root@localhost ~]# rpm -i ius-release.rpm
warning: ius-release.rpm: Header V4 RSA/SHA256 Signature, key ID 4b274df2: NOKEY
package ius-release-2-1.el7.ius.noarch is already installed

这里需要注意的是,使用ius源安装的软件,一般都会在软件名称后面加上版本号和u,可以查询得到:

[root@localhost ~]# yum info git*u --disablerepo=base,extras,updates --enablerepo=ius
Loaded plugins: fastestmirror
ius | 1.3 kB 00:00
ius/x86_64/primary | 190 kB 00:10
Loading mirror speeds from cached hostfile
ius 1023/1023
Available Packages
Name : git2u
Arch : x86_64
Version : 2.16.6
Release : 1.ius.el7
Size : 1.1 M
Repo : ius/x86_64
Summary : Fast Version Control System
URL : https://git-scm.com
License : GPLv2
Description : Git is a fast, scalable, distributed revision control system with
: an unusually rich command set that provides both high-level
: operations and full access to internals.
:
: The git rpm installs common set of tools which are usually using
: with small amount of dependencies. To install all git packages,
: including tools for integrating with other SCMs, install the
: git-all meta-package.

通过查询得知,在 ius 源中有 2.16.6 版本的 git

安装 ius 源中的 git

yum install git2u

安装后检查版本

[root@localhost ~]# git --version
git version 2.16.6

安装完成!

后续步骤可全部参考:https://www.geekinns.cn/2020/03/09/%E9%83%A8%E7%BD%B2Hexo/

参考文献:
[1]Hexo博客部署到云服务器全流程:https://www.geekinns.cn/2020/03/09/%E9%83%A8%E7%BD%B2Hexo/
[2]CentOS 7 升级 git 版本(通过安装 ius 源的方式):https://blog.csdn.net/lovefengruoqing/article/details/83819591