Ubuntu下搭建自己的云笔记: 服务器篇
老规矩,上来先更新软件列表
sudo apt-get update
更新完列表后,我们开始安装Mongodb数据库
sudo apt-get install mongodb -y
通过"pgrep mongo -l "查看进程是否已经启动
pgrep mongo -l
root@iZwz92sZ:~# pgrep mongo -l
17624 mongod
下载Leanote
wget https://nchc.dl.sourceforge.net/project/leanote-bin/2.6.1/leanote-linux-amd64-v2.6.1.bin.tar.gz
解压压缩包
tar -zxvf leanote-linux-amd64-v2.6.1.bin.tar.gz
使用vi打开文件leanote/conf/app.conf
vi leanote/conf/app.conf
找到app.secret
# mongdb
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
# or you can set the mongodb url for more complex needs the format is:
# mongodb://myuser:mypass@localhost:40001,otherhost:40001/mydb
# db.url=mongodb://root:root123@localhost:27017/leanote
# db.urlEnv=${MONGODB_URL} # set url from env. eg. mongodb://root:root123@localhost:27017/leanote
# You Must Change It !! About Security!!
app.secret=asdf #
找到该项位置后按下i键进入编辑模式,修改该项的值为任意字符串。
修改完成后,按下esc键退出编辑模式,输入:wq保存并退出vi
初始化数据库
mongorestore -h localhost -d leanote --dir /root/leanote/mongodb_backup/leanote_install_data/
启动服务
nohup bash /root/leanote/bin/run.sh > /root/leanote/run.log 2>&1 &
root@iZwz92sq8e1hle3inkc5jkZ:~# nohup bash /root/leanote/bin/run.sh > /root/leanote/run.log 2>&1 &
[1] 18211