Pages

Wednesday, 30 October 2013

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

as3:~# git clone https://github.com/edvanbeinum/snowshoe.git
Cloning into snowshoe...
remote: Counting objects: 1114, done.
remote: Compressing objects: 100% (549/549), done.
remote: Total 1114 (delta 504), reused 1086 (delta 476)
Receiving objects: 100% (1114/1114), 575.14 KiB | 479 KiB/s, done.
Resolving deltas: 100% (504/504), done.
as3:~# cd snowshoe
as3:~/snowshoe# git submodule init
Submodule 'Snowshoe/Vendor/Formatters/php-markdown' (https://github.com/wolfie/php-markdown.git) registered for path 'Snowshoe/Vendor/Formatters/php-markdown'
Submodule 'Snowshoe/Vendor/Formatters/textile' (https://github.com/netcarver/textile.git) registered for path 'Snowshoe/Vendor/Formatters/textile'
Submodule 'Snowshoe/Vendor/TemplateEngines/twig' (https://github.com/fabpot/Twig.git) registered for path 'Snowshoe/Vendor/TemplateEngines/twig'
Submodule 'Snowshoe/Vendor/Yadif' (https://github.com/beberlei/yadif.git) registered for path 'Snowshoe/Vendor/Yadif'
as3:~/snowshoe# git submodule update
Cloning into Snowshoe/Vendor/Formatters/php-markdown...
remote: Counting objects: 449, done.
remote: Compressing objects: 100% (225/225), done.
remote: Total 449 (delta 227), reused 444 (delta 223)
Receiving objects: 100% (449/449), 155.81 KiB, done.
Resolving deltas: 100% (227/227), done.
Submodule path 'Snowshoe/Vendor/Formatters/php-markdown': checked out 'f510ab4921de2d21027eab610b27b43f7e826018'
Cloning into Snowshoe/Vendor/Formatters/textile...
remote: Counting objects: 2632, done.
remote: Compressing objects: 100% (1300/1300), done.
remote: Total 2632 (delta 1115), reused 2502 (delta 998)
Receiving objects: 100% (2632/2632), 715.51 KiB | 374 KiB/s, done.
Resolving deltas: 100% (1115/1115), done.
Submodule path 'Snowshoe/Vendor/Formatters/textile': checked out 'afb8a4da392591ff69bbe71696d97dc00ad3a667'
Cloning into Snowshoe/Vendor/TemplateEngines/twig...
remote: Counting objects: 16230, done.
remote: Compressing objects: 100% (7421/7421), done.
remote: Total 16230 (delta 8366), reused 14683 (delta 6907)
Receiving objects: 100% (16230/16230), 4.32 MiB | 3.57 MiB/s, done.
Resolving deltas: 100% (8366/8366), done.
Submodule path 'Snowshoe/Vendor/TemplateEngines/twig': checked out '4a5057997d6d3ffacb2dad1550972a244d459ab8'
Cloning into Snowshoe/Vendor/Yadif...
remote: Counting objects: 399, done.
remote: Compressing objects: 100% (162/162), done.
remote: Total 399 (delta 234), reused 369 (delta 223)
Receiving objects: 100% (399/399), 122.65 KiB, done.
Resolving deltas: 100% (234/234), done.
Submodule path 'Snowshoe/Vendor/Yadif': checked out 'd874042a506e416a6d2a1c114f496c60e036c10f'
as3:~/snowshoe# ls
assets  bin  README.md  Snowshoe  tests
as3:~/snowshoe# ls bin
snowshoe
as3:~/snowshoe# php bin/snowshoe
PHP Notice:  Undefined index: SERVER_NAME in /root/snowshoe/Snowshoe/Vendor/Formatters/php-markdown/markdown.php on line 1701
 ____                          _
/ ___| _ __   _____      _____| |__   ___   ___
\___ \| '_ \ / _ \ \ /\ / / __| '_ \ / _ \ / _ \
 ___) | | | | (_) \ V  V /\__ \ | | | (_) |  __/
|____/|_| |_|\___/ \_/\_/ |___/_| |_|\___/ \___|
has run...
See your new site at:
/root/snowshoe/public
as3:~/snowshoe# ls
assets  bin  public  README.md  Snowshoe  tests (出现了public目录)
as3:~/snowshoe# cd public
as3:~/snowshoe/public# ls
about.html  docs  index.html (可见~/snowshoe/public就是静态网站的根目录。可绑域名到该目录)
as3:~/snowshoe/public# Rwebserver 3521 > /dev/null &

演示站点:http://ss.brite.biz/,http://as3.brite.biz:3521/

发贴方法:
as3:~/snowshoe/public# cd  ~/snowshoe/assets/content/
as3:~/snowshoe/assets/content# ls
about.md  docs  index.md
as3:~/snowshoe/assets/content#
按~/snowshoe/assets/content/里的about.md的格式新建帖子test1.md,格式如下:
## test1 (不支持中文标题,就只好用英文或拼音)

这是测试1.


as3:~/snowshoe/assets/content# cd ~/snowshoe/
as3:~/snowshoe# php bin/snowshoe -p (这个就是生成/更新静态网站的命令.生产模式需加上-p参数)
还需修改配置文件/root/snowshoe/Snowshoe/Config/App.php,
把'is_production_mode' => FALSE,改为'is_production_mode' => TRUE,
把'publish_location' => 'http://getsnowshoe.com',改为
'publish_location' => 'http://urdomain.com', 
 然后:
as3:~/snowshoe# php bin/snowshoe -p 

项目地址:https://github.com/edvanbeinum/snowshoe