Total Pageviews

Friday, 25 October 2013

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

as3:~# wget http://loup-vaillant.fr/projects/ussm/ussm.tar.gz
as3:~# tar zxvf ussm.tar.gz
as3:~# cd ussm/
as3:~/ussm# ls
defaults  makefile  src
as3:~/ussm# apt-get install ocaml-core ocaml-libs -y
as3:~/ussm# make
(如果遇到错误:
Error: Unbound value mk_error
make: *** [src/parsec.mli] Error 2
则:
make clean)
as3:~/ussm# make (重新make)
as3:~/ussm# make install
as3:~/ussm# ls
bin  defaults  makefile  src
as3:~/ussm# mkdir ussm-site
as3:~/ussm# cd ussm-site
as3:~/ussm/ussm-site# ussm
This is not a ussm repository.  Do you want me to create one? (y/N)y
as3:~/ussm/ussm-site# ls
favicon.png  foo  index.txt  skin.txt  style.css  under-the-hood.txt  _ussm
as3:~/ussm/ussm-site# nano test1.txt
as3:~/ussm/ussm-site# ussm
/root/bin/ussm-core: line 30: markdown: command not found
(遇到上述错误,是未安装markdown的缘故。)
as3:~/ussm/ussm-site# apt-get install markdown
as3:~/ussm/ussm-site# ussm
as3:~/ussm/ussm-site# ls
favicon.png  index.txt  style.css  under-the-hood.txt
foo          skin.txt   test1.txt  _ussm
as3:~/ussm/ussm-site# cd _ussm
as3:~/ussm/ussm-site/_ussm# cd www
as3:~/ussm/ussm-site/_ussm/www# ls
favicon.png  index.txt  style.css   under-the-hood.html
foo          skin.html  test1.html  under-the-hood.txt
index.html   skin.txt   test1.txt
as3:~/ussm/ussm-site/_ussm/www#
(可见~/ussm/ussm-site/_ussm/www/就是静态网站的根目录。可绑定一个域名到此目录)

发贴方法:
as3:~/ussm/ussm-site/_ussm/www# cd  ~/ussm/ussm-site/
as3:~/ussm/ussm-site# nano test2.txt
格式为:
{
title: 测试2
description: xxx
}

这是测试2.

as3:~/ussm/ussm-site# ussm (这个就是生成/更新静态网站的命令)

演示站点:http://as3.brite.biz:5438/,http://ussm.brite.biz/
项目地址:http://loup-vaillant.fr/projects/ussm/

如果你网站里的链接有问题,(即打不开或显示错误页),且你的服务器是apache,你可这样做:
<VirtualHost *:80>
ServerName ussm.brite.biz
DocumentRoot /root/ussm/ussm-site/_ussm/www/
<Directory /root/ussm/ussm-site/_ussm/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>

</VirtualHost>

需加上上述蓝色部分,重启apache即可。如果是nginx webserver,我还需测试一下如何做。