Pages

Wednesday, 29 January 2014

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


git clone https://github.com/daeken/Benjen benjen
cd benjen
pip install -r requirements.pip
python setup.py install
cd daeken.com

as3:~/benjen/daeken.com# ls
config.yaml  entries  static  templates
as3:~/benjen/daeken.com# nano config.yaml
把config.yaml里面的path的值指定为你vps中的某个目录,我指定为/root/benjen/daeken.com/output
as3:~/benjen/daeken.com# benjen (这个就是生成/更新静态网站的命令)
as3:~/benjen/daeken.com# ls
config.yaml  entries  output  static  templates
(新出现了output目录)
as3:~/benjen/daeken.com# cd output
as3:~/benjen/daeken.com/output# ls
2009-06-30_New.html
2009-07-02_Partially_Destructive_Garbage_Collection.html
2009-07-03_Renraku__Future_OS.html
2009-07-09_Renraku_OS__It_Lives_.html
2009-07-17_Renraku_OS__Initial_Release.html
2009-08-06_Renraku_OS__The_Way_Up.html
2009-08-19_Reversing_The_Pokerstars_Protocol__Part_1__Compression_and_transport__basics.html
2009-09-23_Injecting_Arbitrary_Python_Into_EVE_Online.html
2009-09-26_RMS_is_a_traitor_to_the_Free_Software_community.html
2009-10-29_More_Illegal_Numbers.html
2009-11-13_How_To_Lose_A_Customer_In_Two_Lines.html
2009-11-19_Designing_a__NET_Computer.html
2009-11-19_Renraku_OS__FAQ.html
2009-11-19_Renraku_OS__Networking__Hosted_Mode__Moving_Forward.html
2009-12-27_Alky_Postmortem.html
2010-01-23_Renraku_OS__Road_to_v1.html
2010-02-20_Python_Marshal_Format.html
2010-02-26_Daeken_Discount_Program.html
2010-03-25_Demo_a_week__week_1__Waveride.html
2010-03-27_Straytex__Online_procedural_texture_studio.html
2010-04-02_Demo_a_week__week_2__Armitage.html
2010-04-09_Dotpack_Beta_1.html
2010-09-05_Hacking_the_Belkin_Network_USB_Hub.html
2010-09-13_Emokit__Hacking_the_Emotiv_EPOC_Brain-Computer_Interface.html
2010-09-21_The_Hardware_Hacker_Manifesto.html
2010-09-24_Looking_for_work.html
2010-09-25_Emokit_status__JsDataFlowEditor__and_looking_for_work.html
2010-11-04_New_Job.html
2010-11-27_Further_Freedom_Attacks.html
2011-08-31_Superpacking_JS_Demos.html
2012-02-29_2012.html
2012-07-24_Blackhat_paper.html
2012-08-17_Onity_s_Plan_To_Mitigate_Hotel_Lock_Hack.html
2012-10-20_Confusing_Crypto_Blobs.html
2012-12-06_Responsible_Disclosure_Can_Be_Anything_But.html
2013-01-09_Holy_crap__it_s_2013.html
2013-02-21_Distributed_Balance.html
2013-03-17.1_So_You_Want_To_Be_A_Breaker__Pt__1__Web_Security.html
2013-03-17_Benjen_v1.html
960.css
archive.html
favicon.png
feed.xml
index_1.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index.html
reset.css
satinweave.png
style.css
text.css
as3:~/benjen/daeken.com/output#
可见~/benjen/daeken.com/output/就是静态网站的根目录。
as3:~/benjen/daeken.com/output# nohup Rwebserver 34293 > /dev/null &

发贴方法:
as3:~/benjen/daeken.com/output# cd ../entries
as3:~/benjen/daeken.com/entries# nano test2.md
按~/benjen/daeken.com/entries/里面的new-job.md的格式,新建帖子test2.md,格式如下:
title: 测试2
date: 2014-01-29

#

这是测试2.

然后,
as3:~/benjen/daeken.com/entries# cd ..
as3:~/benjen/daeken.com# benjen

演示站点:http://as3.brite.biz:34293/,http://bj.brite.biz
项目地址:https://github.com/daeken/Benjen