Leanote笔记搭建

Leanote笔记搭建

主机环境:
[root@test ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
[root@test ~]# uname -a
Linux test 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

1.安装mongodb:
yum安装参考:https://www.tracymc.cn/archives/492
编译安装参考:https://www.tracymc.cn/archives/168

2.安装Leanote
[root@test ~]# cd /home/
[root@test home]# wget https://jaist.dl.sourceforge.net/project/leanote-bin/2.6.1/leanote-linux-amd64-v2.6.1.bin.tar.gz
如果wget慢的话,可以先本地下载了再传到主机上.
[root@test home]# tar -zxvf leanote-linux-amd64-v2.6.1.bin.tar.gz
[root@test home]# cd leanote
[root@test leanote]# ll
total 24
drwxr-xr-x 3 501 games 4096 May 26 22:10 app
drwxr-xr-x 3 501 games 4096 May 26 22:10 bin
drwxr-xr-x 2 501 games 4096 May 26 22:10 conf
drwxr-xr-x 9 501 games 4096 May 26 22:10 messages
drwxr-xr-x 3 501 games 4096 May 26 22:10 mongodb_backup
drwxr-xr-x 14 501 games 4096 Mar 8 11:15 public
修改配置文件:
[root@test conf]# cat app.conf |grep -v ‘^#’|grep -v ‘^$’
http.addr=0.0.0.0 # listen on all ip addresses
http.port=80 //端口默认为9000,我这里修改为80
site.url=http://localhost:9000 # or http://x.com:8080, http://www.xx.com:9000
adminUsername=admin
db.host=127.0.0.1
db.port=27017
db.dbname=leanote # required
db.username= # if not exists, please leave it blank
db.password= # if not exists, please leave it blank
app.secret=test123456789 #修改了这个
app.name=leanote
http.ssl=false
cookie.httponly=false
cookie.prefix=LEANOTE
cookie.domain= # for share cookie with sub-domain
cookie.secure=false
session.expires=3h # 3 hour. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”.
format.date=2006-01-02
format.datetime=2006-01-02 15:04:05 # 必须这样配置
results.chunked=false
log.trace.prefix = “TRACE ”
log.info.prefix = “INFO ”
log.warn.prefix = “WARN ”
log.error.prefix = “ERROR ”
i18n.default_language=en-us
module.static=github.com/revel/modules/static
[dev]
mode.dev=true
results.pretty=true
watch=true
module.testrunner = # github.com/revel/modules/testrunner
log.trace.output = stderr
log.info.output = stderr
log.warn.output = stderr
log.error.output = stderr
[prod]
mode.dev=false
results.pretty=false
watch=false
module.testrunner =
log.trace.output = off
log.info.output = off
log.warn.output = %(app.name)s.log
log.error.output = %(app.name)s.log
初始化数据库:
[root@test conf]# mongorestore -h localhost -d leanote –dir /home/leanote/mongodb_backup/leanote_install_data/
[root@test ~]# mongo
MongoDB shell version v3.6.5
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.5
admin 0.000GB
config 0.000GB
leanote 0.001GB //说明导入成功
local 0.000GB
> show collections;
albums
attachs
blog_comments
blog_likes
blog_singles
configs
email_logs
files
find_pwds
group_users
groups
has_share_notes
leanote.ShareNotes
leanote.has_share_notes
note_content_histories
note_contents
note_images
note_tags
notebooks
notes
reports
sessions
share_notebooks
share_notes
suggestions
tag_count
tags
themes
tokens
traffics
user_blogs
users
启动Leanote服务:
[root@test bin]# chmod u+x /home/leanote/bin/run.sh
[root@test bin]# nohup /home/leanote/bin/run.sh >> /var/log/leanote.log 2>&1 &
访问Leanote:
通过访问http://yourip或http://yourdomain.com就可以了使用自己的笔记本.
默认登录用户/密码为admin/123abc,请务必修改密码已确保使用安全!

部分截图如下:

还能将笔记公开为博客,如下:

注意:
按照本教程启动Mongodb是没有权限控制的,如果你的Leanote服务器和端口(27017)暴露在外网,任何人都可以访问你的Mongodb并修改,所以这是极其危险的!请务必为Mongodb设置相关权限!!!

點閱: 37

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料