Total Pageviews

Monday 26 August 2013

在linux vps上搭建静态博客程序-jekyll bootstrap

首先在你的vps上编译ruby:
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
tar zxvf ruby-1.9.3-p327.tar.gz
cd ruby-1.9.3-p327
./configure --prefix=/usr/local/ruby/
make
make install

然后安装jekyll:
# gem install jekyll
然后 
# git clone https://github.com/plusjade/jekyll-bootstrap.git 
# cd jekyll-bootstrap 
# jekyll serve
然后访问http://urvps.com:4000就可看到博客的效果了。
我的例子:http://as3.brite.biz:4000/
(以上要想jekyll serve命令在后台运行,需改为:
# nohup jekyll serve > /dev/null &)
(http://as3.brite.biz:3399/,这个我是使用Rwebserver实现的:
as3:~/jekyll-bootstrap/_site# Rwebserver 3399 > /dev/null &)
(http://as3.brite.biz:3400/,这个我是使用python -m SimpleHTTPServer实现的:
as3:~/jekyll-bootstrap/_site# nohup python -m SimpleHTTPServer 3400 > /dev/null &)

jekyll-bootstrap目录里,运行jekyll serve命令后,在jekyll-bootstrap目录下,会生成_site目录,这个_site目录就是博客网站的根目录。在我vps里的显示情况:
as3:~/jekyll-bootstrap# jekyll serve
Configuration file: /root/jekyll-bootstrap/_config.yml
       Deprecation: Auto-regeneration can no longer be set from your configuration file(s). Use the --watch/-w command-line option instead.
            Source: /root/jekyll-bootstrap
       Destination: /root/jekyll-bootstrap/_site
      Generating... done.


以我的情况为例子,给/root/jekyll-bootstrap/_site/绑定一个域名即可,我的例子:
http://jkbs1.brite.biz/ ,感觉比在github空间上操作简单多了。我在github空间上的例子:
http://luckypoem12.github.io/,http://luckypoem13.github.io/ 

发贴的方法:
as3:~/jekyll-bootstrap#cd  _posts
(进入_posts目录,新建帖子即md文件,yyyy-mm-dd-somewording.md。帖子的格式为

---
layout: post
title: xxx
categories: yyy
---
此处写正文或代码. )
然后
as3:~/jekyll-bootstrap/_posts#cd ..
as3:~/jekyll-bootstrap# jekyll serve
( _posts里的内容将会被产生到_site里面。这个步骤就是更新网站的过程。)


官网-http://jekyllbootstrap.com/ 

相关帖子: http://briteming.blogspot.co.uk/2013/06/linux-vpsruby-jekyll.html
https://github.com/poole/poole
https://github.com/poole/hyde
https://github.com/poole/lanyon
https://github.com/mdo/jekyll-example