在阿里买了域账号已经一年多了,一直没有用,最近想着用用,再加上之前买了个洛杉矶的主机,觉得自己搭建一个属于自己的博客很有必要,于是有了接下来的一系列操作:

下面是我购买的主机以及对应的控制面板:

CentOS + Hexo + Git Hub + 域名集成 (一)

CentOS + Hexo + Git Hub + 域名集成 (一)

用Xshell连接到机器:

 

Hexo安装步骤如下:

命令行执行如下:

[[email protected] ~]# yum -y install git gcc gcc-c++ curl

[[email protected] ~]#wget https://nodejs.org/dist/latest/node-v11.10.0-linux-x64.tar.xz (2019年2月最新版)

[[email protected] ~]#chmod 777 node-v11.10.0-linux-x64.tar.xz

[[email protected] ~]#xz -d node-v11.10.0-linux-x64.tar.xz

[[email protected] ~]#tar -xvf node-v11.10.0-linux-x64.tar

[[email protected] ~]#mv node-v11.10.0-linux-x64 /usr/local

[[email protected] ~]#mv node-v11.10.0-linux-x64 node

[[email protected] ~]#vim /etc/profile

# add the PATH for node (加到最后一行)
export PATH=$PATH:/usr/local/node/bin

[[email protected] ~]#source /etc/profile

[[email protected] ~]useradd Fiona -p ******

[[email protected] ~]# cd /home/Fiona
[[email protected] Fiona]# mkdir hexo
 

[[email protected] Fiona]# cd hexo/
[[email protected] hexo]# hexo init

[[email protected] hexo]#  npm install hexo-generator-index --save
[[email protected] hexo]#  npm install hexo-generator-archive --save
[[email protected] hexo]#  npm install hexo-generator-category --save
[[email protected] hexo]#  npm install hexo-generator-tag --save
[[email protected] hexo]#  npm install hexo-server --save
[[email protected] hexo]#  npm install hexo-deployer-git --save
[[email protected] hexo]#  npm install hexo-deployer-heroku --save
[[email protected] hexo]#  npm install hexo-deployer-rsync --save
[[email protected] hexo]#  npm install hexo-deployer-openshift --save
[[email protected] hexo]#  npm install hexo-renderer-marked --save
[[email protected] hexo]#  npm install hexo-renderer-stylus --save
[[email protected] hexo]#  npm install hexo-generator-feed --save
[[email protected] hexo]#  npm install hexo-generator-sitemap --save

[[email protected] hexo]# vim  _config.yml

里面的大体不用修改,但可以根据需要来,但有一处肯定要添加:

CentOS + Hexo + Git Hub + 域名集成 (一)

 

 

未完待续:CentOS + Hexo + Git Hub + 域名集成 (二)

相关文章:

  • 2021-11-08
  • 2021-07-15
  • 2021-08-30
  • 2022-12-23
  • 2022-01-15
  • 2021-06-22
  • 2022-01-08
猜你喜欢
  • 2021-10-22
  • 2022-01-23
  • 2022-12-23
  • 2021-12-31
  • 2021-10-13
  • 2022-12-23
  • 2021-07-08
相关资源
相似解决方案