环境
阿里云ubuntu nginx mongodb
下载Leanote:
$:wget https://jaist.dl.sourceforge.net/project/leanote-bin/2.6.1/leanote-linux-amd64-v2.6.1.bin.tar.gz
安装MongoDB
在此将使用的是服务器安装在根目录下的MongoDB,而非将MongoDB放在了leanote下。
导入初始数据
leanote
初始数据存放在 /home/user1/leanote/mongodb_backup/leanote_install_data
中。打开终端, 输入以下命令导入数据。
$:mongorestore -h localhost -d leanote --dir /home/user1/leanote/mongodb_backup/leanote_install_data/
现在在mongodb
中已经新建了leanote
数据库, 可用命令查看下leanote
有多少张"表":
$> mongo
> show dbs # 查看数据库
leanote 0.203125GB
local 0.078125GB
> use leanote # 切换到leanote
switched to db leanote
> show collections # 查看表
files
has_share_notes
note_content_histories
note_contents
....
配置nginx
server {
listen 80;
server_name notes.52itstyle.com;
charset utf-8;
location / {
default_type text/html;
proxy_pass http://127.0.0.1:9000;
}
}
配置leanote
leanote
的配置存储在文件 conf/app.conf
中。请务必修改app.secret
一项, 在若干个随机位置处,将字符修改成一个其他的值, 否则会有安全隐患!
运行leanote
注意: 在此之前请确保mongodb
已在运行!新开一个窗口, 运行:
$> cd /home/user1/leanote/bin
$> bash run.sh
最后出现以下信息证明运行成功:
...
TRACE 2013/06/06 15:01:27 watcher.go:72: Watching: /home/life/leanote/bin/src/github.com/leanote/leanote/conf/routes
Go to /@tests to run the tests.
Listening on :9000...
访问
在浏览器中可以访问了。
修改信息
以用户:admin和密码:abc123登录,在个人中心修改密码。