您现在的位置是:首页 > 日记日记

centos 搭建Leanote +Mongodb个人云笔记本

薄荷2022-06-02【日记】1人已围观

简介centos 搭建Leanote +Mongodb个人云笔记本

下载启动 MongoDB

cd /home

wget http://labs-1253675457.cosgz.myqcloud.com/mongodb-linux-x86_64-3.0.1.tgz

tar -xzvf mongodb-linux-x86_64-3.0.1.tgz

创建db存放文件

mkdir -p /data/db

编辑 /etc/profile

export PATH=$PATH:/home/mongodb-linux-x86_64-3.0.1/bin

source /etc/profile

mongod --bind_ip localhost --port 27017 --dbpath /data/db/ --logpath=/var/log/mongod.log --fork

安装 Leanote

cd /home

wget http://labs-1253675457.cosgz.myqcloud.com/leanote-linux-amd64-v2.4.bin.tar.gz

tar -zxvf leanote-linux-amd64-v2.4.bin.tar.gz

编辑文件 /home/leanote/conf/app.conf

app.secret=qcloud666

导入初始化数据

mongorestore -h localhost -d leanote --dir /home/leanote/mongodb_backup/leanote_install_data/

启动 Leanote 服务

nohup /bin/bash /home/leanote/bin/run.sh >> /var/log/leanote.log 2>&1 &

通过ip+9000端口可以访问了 默认账号密码admin abc123

安装nginx

yum install nginx

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install nginx

配置nginx

location / {

proxy_pass http://127.0.0.1:9000;

proxy_set_header Host localhost

proxy_set_header X-Forwarded-For $remote_addr;

}

service nginx start

nginx -v

systemctl status nginx

Tags: