Total Pageviews

Tuesday, 3 June 2014

在linux vps上搭建基于nodejs的静态相册程序-thumbsup

as3:~# npm install -g thumbsup
执行文件为/root/npm/bin/thumbsup

as3:~# git clone https://github.com/rprieto/thumbsup thumbsup-site
as3:~# cd thumbsup-site/example
as3:~/thumbsup-site/example# ls
build.js media
as3:~/thumbsup-site/example# /root/npm/bin/thumbsup --input . --output .
显示:
Static website      [===================] done
Original media      [===================] 9/9 files
Photos (large)      [===================] 16/16 files
Photos (thumbs)     [===================] 32/32 files
Videos (web)        [=========----------] 1/2 files
{ [Error: Command failed: /bin/sh: ffmpeg: command not found
] killed: false, code: 127, signal: null }
(这是因为未安装ffmpeg所致)

as3:~# wget http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.2014-06-01.tar.gz
as3:~# tar zxvf ffmpeg.static.32bit.2014-06-01.tar.gz
ffmpeg
ffprobe
(这2个文件是执行文件)
as3:~# cp ffmpeg /bin/
(这样就装好了ffmpeg)
as3:~# cd ~/thumbsup-site/example
as3:~/thumbsup-site/example# /root/npm/bin/thumbsup --input . --output .
显示:
Static website      [===================] done
Original media      [===================] 57/57 files
Photos (large)      [===================] 104/104 files
Photos (thumbs)     [===================] 192/192 files
Videos (web)        [===================] 3/3 files
Videos (poster)     [===================] 6/6 files
Videos (thumbs)     [===================] 6/6 files

Gallery generated successfully

as3:~/thumbsup-site/example# ls
build.js  index.html  media  output  public
(可见~/thumbsup-site/example/就是静态网站的根目录)
as3:~/thumbsup-site/example# nohup Rwebserver 45329 > /dev/null &
访问http://as3.brite.biz:45329/即可看到网站效果。

演示站点:http://as3.brite.biz:45329
项目地址:https://github.com/rprieto/thumbsup