Total Pageviews

Thursday, 10 April 2014

在linux vps上搭建基于perl的静态博客程序-chronicle


你需要先安装Date::Parse和 HTML::Template这2个perl modules. 可到http://search.cpan.org/,搜索他们的源码包,下载安装。

wget http://www.steve.org.uk/Software/chronicle/chronicle-4.6.tar.gz
tar zxvf chronicle-4.6.tar.gz
cd chronicle-4.6

as3:~/chronicle-4.6# ls
AUTHORS  blog     COMMENTS  LICENSE   MIGRATING  README 
bin      cgi-bin  etc       Makefile  tests      themes
as3:~/chronicle-4.6# make
显示:
Valid targets are (alphabetically) :
 clean         = Remove bogus files and any local output.
 demos[*]      = Generate and upload demo blogs.
 diff          = See the local changes.
 install       = Install upon the local system.
 release [*]   = Generate a release tarball.
 test          = Run our simple test cases.
 test-verbose  = Run our simple test cases, verbosely.
 tidy [*]      = Tidy the code via perltidy.
 update        = Update from the remote repository.
[*] - These targets are Steve-specific.  Probably.
as3:~/chronicle-4.6# make install
显示:
mkdir -p /etc
cp ./etc/chroniclerc /etc/chroniclerc
mkdir -p /usr/bin
cp ./bin/chronicle              /usr/bin
cp ./bin/chronicle-ping         /usr/bin
cp ./bin/chronicle-spooler      /usr/bin
cp ./bin/chronicle-entry-filter /usr/bin
cp ./bin/chronicle-rss-importer /usr/bin
mkdir -p /usr/share/chronicle/themes/xml
cp -r ./themes/xml/*.* /usr/share/chronicle/themes/xml
for i in themes/*/; do \
                mkdir -p /usr/share/chronicle/themes/$(basename $i) ;\
                cp -r ./themes/$(basename $i)/*.* /usr/share/chronicle/themes/$(basename $i)/ ;\
        done
as3:~/chronicle-4.6# ls
AUTHORS  blog     COMMENTS  LICENSE   MIGRATING  README 
bin      cgi-bin  etc       Makefile  tests      themes

发贴方法:
as3:~/chronicle-4.6# cd blog
as3:~/chronicle-4.6/blog# nano test1.html
内容为:
Title: test1(建议写英文标题,下面搞一行h2代码,起到翻译标题的作用)
Tags: comma, separated, tag, names
Date: 10th April 2014

<h2>测试1</h2>
<p>This is the first line of the blog entry.</p>

然后,
as3:~/chronicle-4.6/blog# cd ..
as3:~/chronicle-4.6# chronicle (这个就是生成/更新静态网站的命令)
as3:~/chronicle-4.6# ls
AUTHORS  blog     COMMENTS  LICENSE   MIGRATING  README  themes
bin      cgi-bin  etc       Makefile  output     tests
as3:~/chronicle-4.6# cd output
as3:~/chronicle-4.6/output# ls
index.rss   mountain_song.html  test1.html  xml.gif
archive     style.css           test1.rss
index.html  tags                vim.css
(新出现了index.html文件,可见~/chronicle-4.6/output/就是静态网站的根目录)
as3:~/chronicle-4.6/output# nohup Rwebserver 34562 > /dev/null &
访问http://as3.brite.biz:34562/即可看到网站效果。

演示站点:http://as3.brite.biz:34562/,http://crn.brite.biz.st
http://blog.steve.org.uk/,https://blog.steve.fi/
项目地址:http://www.steve.org.uk/Software/chronicle/,
 https://steve.fi/Software/chronicle/
下载地址:http://www.steve.org.uk/Software/chronicle/chronicle-4.6.tar.gz
为避免下载地址失效,我把源码包上传至此:
https://drive.google.com/file/d/0B1CmeJlGMtoLS09mSnVmbjBSLWM/
----------------------------------------

https://steve.fi/
https://steve.kemp.fi/#online
https://steve.kemp.fi/#domains