请访问我的个人博客 sourcod

安装hexo

  1. 安装node npm
    由于我的电脑是ubuntu
    可以使用 apt方试安装sudo apt-get install nodejs
    或者编译安装,这里不详系介绍
    (※我使用的编译源码方试安装,这种方试安装的是最新版※)
  2. 安装hexo
npm install hexo-cli -g 
hexo init blog
cd blog
npm install
hexo server
  1. 安装git
    同1;
    sudo apt-get install git
    编译安装可以看这里
    编译安装git

配置hexo themes

hexo themes 可以去官网找 [themes](https://hexo.io/themes) ※可能需要翻墙※ 我用的是next themes. [github地址](https://github.com/iissnan/hexo-theme-next) [使用文档](http://theme-next.iissnan.com)

配置emacs hexo插件

*我使用的是spacemacs,所以创建一个layer `m-x create-layer` ![创建layer](http://image.sourcod.com/hexo/创建layer.png) 编辑package.el ![test_编辑package.png](http://image.sourcod.com/hexo/test_编辑package.png) 可以使用`hexo-my-blog`打开hexo buffer ![test_hexo_buffer.png](http://image.sourcod.com/hexo/test_hexo_buffer.png)

配置aliyun oss

我使用的是阿里云ossimport同步工具 [ossimport快速安装](https://help.aliyun.com/document_detail/32201.html?spm=5176.doc44075.2.10.5fCjLR)
  1. 下载
    wget http://import-service-package.oss.aliyuncs.com/ossimport2/ossimport-v2.1-linux.zip
  2. 解压
    unzip ./ossimport-v2.1-linux.zip -d ./ossimport-v2.1-linux
  3. 配置conf/sys.properties
    vi conf/sys.properties
    test_配置sysproperties.png
    ※跟具个人实际情况配置
  4. 运行

    1. 启动服务
      nohup java -Dskip_exist_file=false -jar /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/bin/ossimport2.jar -c /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/conf/sys.properties start > /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/logs/ossimport2.log 2>&1 &
    2. 编辑任务描述文件
      vi local_job.cfg
      test_20170316_165446.png

    3. 启动服务
      java -jar /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/bin/ossimport2.jar -c /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/conf/sys.properties submit /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/local_job.cfg

    4. 查看状态

      java -jar /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/bin/ossimport2.jar -c /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/conf/sys.properties  stat detail

    停止服务

    ps axu | grep "ossimport2.jar.* start" | grep -v grep | awk '{print "kill -9 "$2}' | bash
    java -jar $work_dir/bin/ossimport2.jar  -c $work_dir/conf/sys.properties clean  local_test
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐