@TOC

*本文阐明 请大家务必查看


目录构造:重点是简洁版、谬误记录详情查看自我总结


本文有两个版本,具体版、简洁版

前者适宜老手,后者适宜新手(不便大家查找,从而过滤掉某些步骤,节约工夫老本) 所以大家按需查看哟。

具体版简洁版

简洁版:蕴含所有步骤,以及命令的执行过程(适宜老手)

简洁版:只蕴含命令(适宜有肯定熟练度的人)

前言


大家有艳羡过他人的博客网站吗?本人最后接触电脑的时候,看见一个敌人的博客就很是艳羡。

明天就教大家如何搭建本人的博客网站,非常简单,小白轻松上手

首先介绍一下配角:Hexo


什么是 Hexo?

Hexo 是一个疾速、简洁且高效的博客框架。Hexo 应用 Markdown(或其余渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成动态网页。

Markdown是一种轻量级标记语言,排版语法简洁 ,不到半小时就能齐全把握。这里就不做过多介绍了。

环境筹备


零碎VcpuMemory网卡类型
centos724NAT模式

配置yum源,不会的看这里:(35条音讯) linux+centos7 配置本地yum源_YG-刻骨铭心的博客-CSDN博客_为什么要配置本地yum源

具体版

入门:搭建步骤


装置git:

[root@localhost ~]# rm -rf /etc/yum.repos.d/*  #删除本地repo文件[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo  ## 下载阿里云centos7镜像源  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed100  2523  100  2523    0     0   5701      0 --:--:-- --:--:-- --:--:--  5721[root@localhost ~]# yum clean all ; yum makecache #清理缓存、建设缓存[root@localhost ~]# yum install -y git   # yum源 下载安装gitLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com  * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comResolving Dependencies--> Running transaction check---> Package git.x86_64 0:1.8.3.1-23.el7_8 will b

装置node:

node官网下载地址Index of /dist/ (nodejs.org) # (Node.js 版本需不低于 10.13,倡议应用 Node.js 12.0 及以上版本)

[root@localhost ~]# yum install wget -y  # 下载安装wgetLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comResolving Dependencies--> Running transaction check---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================ Package                    Arch      [root@localhost ~]# wget https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz  # 下载 node.js 软件压缩包--2022-04-14 20:32:21--  https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xzResolving nodejs.org (nodejs.org)... 104.20.22.46, 104.20.23.46, 2606:4700:10::6814:162e, ...Connecting to nodejs.org (nodejs.org)|104.20.22.46|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 21941244 (21M) [application/x-xz]Saving to: ‘node-v16.14.2-linux-x64.tar.xz’100%[======================================================================================>] 21,941,244   950KB/s   in 21s2022-04-14 20:32:44 (999 KB/s) - ‘node-v16.14.2-linux-x64.tar.xz’ saved [21941244/21941244][root@localhost ~]# tar -vxf node-v16.14.2-linux-x64.tar.xz   # 解压node.js软件压缩软件包node-v16.14.2-linux-x64/node-v16.14.2-linux-x64/bin/[root@localhost ~]# mv node-v16.14.2-linux-x64 /usr/local/bin  # 挪动node到/usr/local/bin目录下[root@localhost ~]# cd /usr/local/bin/  # 进入/usr/local/bin[root@localhost bin]# ll  # 查看当前目录下的文件、目录total 0drwxr-xr-x. 6 1001 1001 108 Mar 18 05:52 node-v16.14.2-linux-x64[root@localhost bin]# mv node-v16.14.2-linux-x64/ node  #批改node-v16.14.2-linux-x64 名称为 node[root@localhost bin]# vi /etc/profile  # vi批改配置文件 增加node.j2软件环境变量export NODE_HOEM=/usr/local/bin/node  # 设置node软件家目录的环境变量export PATH=$PATH:$NODE_HOEM/bin  # 设置node软件到bin目录下环境变量  实现bin目录下命令的全局应用[root@localhost bin]# source /etc/profile   # 使配置文件失效[root@localhost bin]# node -v  # 查看node版本  阐明装置配置胜利v16.14.2[root@localhost bin]# npm -v  # 查看npm版本  阐明装置配置胜利8.5.0

装置Hexo:

[root@localhost bin]# cd  # 切换到/root目录[root@localhost ~]# npm install -g cnpm --registry=https://registry.npm.taobao.org  # 装置cnpm模块 、设置国内taobao仓库地址npm WARN deprecated har-validator@5.1.5: this library is no longer supportednpm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142added 372 packages in 37s3 packages are looking for funding  run `npm fund` for detailsnpm noticenpm notice New minor version of npm available! 8.5.0 -> 8.6.0npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.6.0npm notice Run npm install -g npm@8.6.0 to update!npm notice[root@localhost ~]# cnpm -v  # 查看cnpm模块版本cnpm@7.1.1 (/usr/local/bin/node/lib/node_modules/cnpm/lib/parse_argv.js)npm@6.14.16 (/usr/local/bin/node/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)node@16.14.2 (/usr/local/bin/node/bin/node)npminstall@5.8.0 (/usr/local/bin/node/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)prefix=/usr/local/bin/nodelinux x64 3.10.0-862.el7.x86_64registry=https://registry.npmmirror.com[root@localhost ~]#  cnpm install -g hexo-cli # 装置hexo博客Downloading hexo-cli to /usr/local/bin/node/lib/node_modules/hexo-cli_tmpCopying /usr/local/bin/node/lib/node_modules/hexo-cli_tmp/_hexo-cli@4.3.0@hexo-cli to /usr/local/bin/node/lib/node_modules/hexo-cliInstalling hexo-cli's dependencies to /usr/local/bin/node/lib/node_modules/hexo-cli/node_modules[1/10] abbrev@^1.1.1 installed at node_modules/_abbrev@1.1.1@abbrev[2/10] bluebird@^3.5.5 installed at node_modules/_bluebird@3.7.2@bluebird[3/10] tildify@^2.0.0 installed at node_modules/_tildify@2.0.0@tildify[4/10] command-exists@^1.2.8 installed at node_modules/_command-exists@1.2.9@command-exists[5/10] chalk@^4.0.0 installed at node_modules/_chalk@4.1.2@chalk[6/10] hexo-log@^2.0.0 installed at node_modules/_hexo-log@2.0.0@hexo-log[7/10] minimist@^1.2.5 installed at node_modules/_minimist@1.2.6@minimist[8/10] resolve@^1.11.0 installed at node_modules/_resolve@1.22.0@resolve[9/10] hexo-fs@^3.0.1 installed at node_modules/_hexo-fs@3.1.0@hexo-fs[10/10] hexo-util@^2.0.0 installed at node_modules/_hexo-util@2.6.0@hexo-utilAll packages installed (58 packages installed from npm registry, used 3s(network 3s), speed 622.85KB/s, json 58(276.43KB), tarball 1.73MB, manifests cache hit 0, etag hit 0 / miss 0)[hexo-cli@4.3.0] link /usr/local/bin/node/bin/hexo@ -> /usr/local/bin/node/lib/node_modules/hexo-cli/bin/hexo[root@localhost ~]# mkdir test  # 创立test目录[root@localhost ~]# cd test/  # 进入 test目录[root@localhost test]# hexo init  # hexo初始化以后为工作目录INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.gitINFO  Install dependenciesINFO  Start blogging with Hexo![root@localhost ~]# npm install  # npm install命令依据package.json 文件的 dependencies 字段配置装置所有的依赖包[root@localhost ~]# systemctl stop firewalld ;systemctl disable firewalld  # 进行、敞开防火墙[root@localhost ~]# setenforce 0  # 长期敞开selinux[root@localhost test]# hexo server  # 启动hexo博客  前台启动INFO  Validating configINFO  Start processingINFO  Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.[root@localhost test]# nohup hexo server & # 启动hexo博客 后盾启动 按两次enter健[root@loalhost ~]# jobs  # 列出零碎作业号和名称[1]+  Running                 nohup hexo server &  (wd: ~/hexo/blog)[root@loalhost ~]# kill %1 # 完结作业号为1的过程

浏览器拜访主机 ip:4000 如下图所示:

进阶:hexo基本操作


公布第一篇博客 :

[root@localhost test]# hexo new "My New Post---test hello"   # 新建一篇文章INFO  Validating configINFO  Created: ~/test/source/_posts/My-New-Post-test-hello.md[root@localhost test]# echo "hello world --- this is a test" >>  ~/test/source/_posts/My-New-Post-test-hello.md   # 在My-New-Post-test-hello.md文件最初追加hello world --- this is a test[root@localhost test]# hexo clean  # 革除缓存文件INFO  Validating configINFO  Deleted database.[root@localhost test]# hexo generate  # 生成动态文件INFO  Validating configINFO  Start processingINFO  Files loaded in 234 ms(node:2270) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency(Use `node --trace-warnings ...` to show where the warning was created)(node:2270) Warning: Accessing non-existent property 'column' of module exports inside circular dependency(node:2270) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency(node:2270) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency(node:2270) Warning: Accessing non-existent property 'column' of module exports inside circular dependency(node:2270) Warning: Accessing non-existent property 'filename' of module exports inside circular dependencyINFO  Generated: archives/index.htmlINFO  Generated: archives/2022/index.htmlINFO  Generated: archives/2022/04/index.htmlINFO  Generated: index.htmlINFO  Generated: fancybox/jquery.fancybox.min.cssINFO  Generated: js/script.jsINFO  Generated: css/fonts/fontawesome-webfont.woff2INFO  Generated: css/style.cssINFO  Generated: fancybox/jquery.fancybox.min.jsINFO  Generated: js/jquery-3.4.1.min.jsINFO  Generated: css/fonts/FontAwesome.otfINFO  Generated: css/fonts/fontawesome-webfont.eotINFO  Generated: css/fonts/fontawesome-webfont.ttfINFO  Generated: css/fonts/fontawesome-webfont.woffINFO  Generated: css/images/banner.jpgINFO  Generated: 2022/04/14/My-New-Post-test-hello/index.htmlINFO  Generated: css/fonts/fontawesome-webfont.svgINFO  Generated: 2022/04/14/hello-world/index.htmlINFO  18 files generated in 704 ms

进入浏览器页面 按F5 刷新页面:

批改Hexo默认主题:

[root@localhost test]# cd /root/test  # 进入 /root/test目录[root@localhost test]# git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia  # git克隆(下载)hexo-theme-yilia.git我的项目放入themes/yilia目录下Cloning into 'themes/yilia'...remote: Enumerating objects: 2037, done.remote: Counting objects: 100% (1/1), done.remote: Total 2037 (delta 0), reused 0 (delta 0), pack-reused 2036Receiving objects: 100% (2037/2037), 10.53 MiB | 1.40 MiB/s, done.Resolving deltas: 100% (1079/1079), done.[root@localhost test]# vi _config.yml  # 批改博客配置文件#theme: landscape   # 正文字段 theme: yilia  # 增加字段[root@localhost test]# hexo server  INFO  Validating configINFO  Start processingINFO  Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.(node:2222) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency(Use `node --trace-warnings ...` to show where the warning was created)(node:2222) Warning: Accessing non-existent property 'column' of module exports inside circular dependency(node:2222) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency(node:2222) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency(node:2222) Warning: Accessing non-existent property 'column' of module exports inside circular dependency(node:2222) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency^CINFO  Have a nice day[root@localhost test]# hexo server  #ctrl+c进行之前的前台过程,之后重启hexo服务INFO  Validating configINFO  Start processingWARN  Trying to "create" _posts/My-New-Post-test-hello.md, but the file already exists!INFO  Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.

进入浏览器页面 按F5 刷新页面,主题批改胜利:

实现github域名拜访咱们博客:

[root@localhost test]# ssh-keygen  # 生成密钥:私钥和公钥Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /root/.ssh/id_rsa.Your public key has been saved in /root/.ssh/id_rsa.pub.The key fingerprint is:SHA256:2U+9DP3wcgJKZb3So8yoOWhsiQ8BQR/HL8F7RKO/30w root@localhost.localdomainThe key's randomart image is:+---[RSA 2048]----+| .o .o..o        ||   o o+...   .   ||  . . .=    o .  ||   .  o.oo o + . ||    .  oS o = B  ||     .   o B * * ||    .o o. o E = +||    ..* .+ +   + ||     +. o.. o    |+----[SHA256]-----+[root@localhost test]# cat /root/.ssh/id_rsa.pub  # 查看公钥文件内容ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgxY4+7mlK4gVaadT6WPVua/gSslYoIYbF9FQmZmsTZ4oxZzpTiDndH05xdN1LJ8qs4Xm56IuDKAdUWYe6kqEtNVkoqYB3SCTMdaTYN6IqQMOFcFzhsI4k/FMsN3D3mDmaJ3gTvUDUHsuu27i9r5FcpZqbPEN78tJ2FkodQgbqp8z/fTJ8r2aI5CUVMDgQ6ZzKGaKgHF/oLEiNncyPHq6TMw/kZgLCA0s3wpfe/jGx9EtxgRPTj69ZR/31IAOs6sG20M75+KZelSSOzg9RoyMn3Y/zXPq10yZr0VrGm/UwGdom7K/haSS3tWL96tgLgmi1sj1MFOfLLdifQf4vbumn root@localhost.localdomain

账号自行创立

在github上增加咱们的ssh公钥地址(/root/.ssh/id_rsa.pub)


复制粘贴咱们的ssh公钥文件(/root/.ssh/id_rsa.pub)的内容:

在github上创立一个仓库寄存咱们本地的代码文件:

仓库名称格局 <你的 GitHub 用户名>.github.io 等会咱们的站点会通过这个名称实现域名拜访

如图所示:

这里务必应用ssh地址否则会报错:具体信息查看本文档的 谬误题目 选项

[root@localhost test]# git init  # 当前目录建设一个git代码库Reinitialized existing Git repository in /root/test/.git/[root@localhost test]# git add .  # 当前目录代码推送到暂存空间[root@localhost test]# git commit -m "first commit"  # 提交到资源库[master e162d0b] first commit 1 file changed, 2 insertions(+), 1 deletion(-)[root@localhost test]# git remote add origin git@github.com:yjcadmin/yjcadmin.github.io.git  [root@localhost test]# git push -u origin master # 推送代码到目标仓库Counting objects: 24, done.Delta compression using up to 2 threads.Compressing objects: 100% (19/19), done.Writing objects: 100% (24/24), 49.82 KiB | 0 bytes/s, done.Total 24 (delta 4), reused 0 (delta 0)remote: Resolving deltas: 100% (4/4), done.To git@github.com:yjcadmin/yjcadmin.github.io.git * [new branch]      master -> masterBranch master set up to track remote branch master from origin.

F5刷新页面:

[root@localhost test]# cnpm install --save hexo-deployer-git  # 装置hexo-deployer-git模块✔ Installed 1 packages✔ Linked 52 latest versions✔ Run 0 scripts✔ All packages installed (53 packages installed from npm registry, used 8s(network 8s), speed 396.04KB/s, json 53(289.51KB), tarball 2.86MB, manifests cache hit 0, etag hit 0 / miss 0)[root@localhost test]# vi _config.ymldeploy:  type: git  repo: git@github.com:yjcadmin/yjcadmin.github.io.git[root@localhost test]# hexo clean && hexo deploy  # 革除缓存、近程部署INFO  Validating configINFO  Deleted database.INFO  Deleted public folder.INFO  Validating configINFO  Start processingINFO  Files loaded in 292 msINFO  Generated: archives/index.htmlINFO  Generated: archives/2022/index.htmlINFO  Generated: archives/2022/04/index.htmlINFO  Generated: index.htmlINFO  Generated: fonts/default-skin.b257fa.svgINFO  Generated: img/default-skin.pngINFO  Generated: fonts/iconfont.16acc2.ttfINFO  Generated: fonts/iconfont.45d7ee.svgINFO  Generated: fonts/iconfont.8c627f.woffINFO  Generated: fonts/iconfont.b322fa.eotINFO  Generated: fonts/tooltip.4004ff.svgINFO  Generated: img/preloader.gifINFO  Generated: img/scrollbar_arrow.pngINFO  Generated: main.0cf68a.cssINFO  Generated: main.0cf68a.jsINFO  Generated: mobile.992cbe.jsINFO  Generated: slider.e37972.jsINFO  Generated: 2022/04/14/My-New-Post-test-hello/index.htmlINFO  Generated: 2022/04/14/hello-world/index.htmlINFO  19 files generated in 84 msINFO  Deploying: gitINFO  Clearing .deploy_git folder...INFO  Copying files from public folder...INFO  Copying files from extend dirs...# On branch masternothing to commit, working directory cleanCounting objects: 34, done.Delta compression using up to 2 threads.Compressing objects: 100% (27/27), done.Writing objects: 100% (34/34), 151.02 KiB | 0 bytes/s, done.Total 34 (delta 6), reused 0 (delta 0)remote: Resolving deltas: 100% (6/6), done.To git@github.com:yjcadmin/yjcadmin.github.io.git + fccc4b8...50105b6 HEAD -> master (forced update)Branch master set up to track remote branch master from git@github.com:yjcadmin/yjcadmin.github.io.git.INFO  Deploy done: git

期待120秒F5刷新

卸载Hexo

npm uninstall hexo-cli -g  # 卸载 hexo博客

再找到文件夹中的blog,手动删除即可。

谬误


这是本人遇到的错误信息以及解决方案(经供参考)

问题1

报错地址:

装置Hexo(题目)hexo init 之后

问题形容:

4高严重性破绽

[root@master blog]# npm installup to date, audited 248 packages in 2s18 packages are looking for funding  run `npm fund` for details4 high severity vulnerabilitiesTo address all issues (including breaking changes), run:  npm audit fix --forceRun `npm audit` for details.

解决方案:

审计修复——强制

[root@master blog]# npm audit fix --forcenpm WARN using --force Recommended protections disabled.npm WARN audit Updating hexo-renderer-ejs to 1.0.0,which is a SemVer major change.removed 3 packages, changed 2 packages, and audited 245 packages in 2s18 packages are looking for funding  run `npm fund` for detailsfound 0 vulnerabilities[root@master blog]# npm installup to date, audited 245 packages in 1s18 packages are looking for funding  run `npm fund` for detailsfound 0 vulnerabilities

问题2

报错地址:

github域名拜访(题目),推送本地仓库时

问题形容:

明码验证的反对在2021年8月13日被删除。应用集体拜访令牌(ssh密钥)。

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.fatal: Authentication failed for 'https://github.com/yjcadmin/yjcadmin.github.io.git/'

解决方案:

配置github免密登录(ssh免密)

问题3

报错地址:

装置node(题目),解压node-v16.14.2-linux-x64.tar.xz时

问题形容:

不是gzip格局

[root@master ~]# tar -vzxf node-v16.14.2-linux-x64.tar.xzgzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exiting now

解决方案:

-z 参数 :通过gzip指令压缩/解压缩文件
所以不应用-z参数

tar -vxf node-v16.14.2-linux-x64.tar.xz

<br/>

自我总结


看到这里必定是英俊潇洒、温顺慷慨的帅哥、美女!!!

写这一篇文章也不容易,前前后后2个的工作日是有的。也可能我一个新人破费的工夫多一点,不过当初本人也写技术博客,才明确用心的每一位作者都不容易。须要学习 、测试、记录、写正文、布局目录构造、调整格局

目录构造是昨晚(2022/4/14)想到de蕴含:介绍、具体版、简洁版、卸载、谬误记录。特点是蕴含简洁版、谬误记录

这样设置目录构造我认为就是一个在线电子笔记本,在忘掉某些技术的时候,能够在各大平台搜寻 小叶的技术Logs (微信工作号、CSDN、简书、稀土掘金、segmentfault思否、博客源)查看简洁版能够让你疾速回忆起整篇文章的内容。大大节约工夫老本

之后集体的所有博客都将会应用这种形式. 所以你或者须要关注这莫一个在线电子笔记本。 小叶的技术Logs

最初非常感激大家能看到最初!!!


简洁版


入门:搭建步骤

装置git:

[root@localhost ~]# rm -rf /etc/yum.repos.d/*[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo[root@localhost ~]# yum clean all ; yum makecache[root@localhost ~]# yum install -y git

装置node:

[root@localhost ~]# yum install wget -y[root@localhost ~]# wget https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz[root@localhost ~]# tar -vxf node-v16.14.2-linux-x64.tar.xz[root@localhost ~]# mv node-v16.14.2-linux-x64 /usr/local/bin[root@localhost ~]# cd /usr/local/bin/[root@localhost bin]# mv node-v16.14.2-linux-x64/ node[root@localhost bin]# vi /etc/profileexport NODE_HOEM=/usr/local/bin/nodeexport PATH=$PATH:$NODE_HOEM/bin[root@localhost bin]# source /etc/profile[root@localhost bin]# node -vv16.14.2[root@localhost bin]# npm -v8.5.0

装置Hexo:

[root@localhost bin]# cd[root@localhost ~]# npm install -g cnpm --registry=https://registry.npm.taobao.org[root@localhost ~]# cnpm -v[root@localhost ~]#  cnpm install -g hexo-cli[root@localhost ~]# mkdir test[root@localhost ~]# cd test/[root@localhost test]# hexo init[root@localhost ~]# systemctl stop firewalld[root@localhost ~]# setenforce 0[root@localhost test]# hexo server

进阶:hexo基本操作

公布文章 :

[root@localhost test]# hexo new "My New Post---test hello"[root@localhost test]# echo "hello world --- this is a test" >>  ~/test/source/_posts/My-New-Post-test-hello.md[root@localhost test]# hexo clean[root@localhost test]# hexo g

批改主题:

[root@localhost test]# cd /root/test[root@localhost test]# git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia[root@localhost test]# vi _config.yml#theme: landscape   # 正文字段 theme: yilia  # 增加字段[root@localhost test]# hexo server  #重启服务[root@localhost test]# hexo server  #重启服务

github域名拜访:

[root@localhost test]# ssh-keygen[root@localhost test]# cat /root/.ssh/id_rsa.pub## github设置ssh免密## github创立本人    github用户名.github.io 格局命名的仓库,格局不能扭转[root@localhost test]# git init[root@localhost test]# git add .[root@localhost test]# git commit -m "first commit"[root@localhost test]# git remote add origin git@github.com:yjcadmin/yjcadmin.github.io.git[root@localhost test]# git push -u origin master[root@localhost test]# cnpm install --save hexo-deployer-git[root@localhost test]# vi _config.ymldeploy:  type: git  repo: git@github.com:yjcadmin/yjcadmin.github.io.git[root@localhost test]# hexo clean && hexo deploy

卸载Hexo

npm uninstall hexo-cli -g