首页 > 编程知识 正文

leanote怎么设置中文,pipephase安装教程

时间:2023-05-03 09:04:25 阅读:155059 作者:1547

安装配置Leanote安装配置Leanote环境: Linux :CentOS 6.9 64位; AlibabaCloud (阿里巴巴云)服务器; 高效云盘40G; 60G数据磁盘

(一)安装golang

mkdir/usr/local/leanotecd/usr/local/leanote/3.wget https://dl.Google.com/go/go1. 10.1.Linux-amd64。

4 .按4.tar-xzvfgotab完成

在/usr/local/leanote/下创建防止go的软件包和编译文件的新目录goPackage

mkdir/usr/local/leanote/gopackage

7 .使用vim编辑添加环境变量vim /etc/profile

在unset语句之前的空行之前添加以下几句话

exportgoroot=/usr/local/leanote/goexportgopath=/usr/local/leanote/gopackageeexportpath=$ path 3360 $ go root

12 .使用source/etc/profile命令启用环境变量

13 .然后需要安装revel和leanote源代码。 1 )本地下载完成后,如何通过ftp服务上传到云服务器2 )使用git克隆到仓库的源代码。 这里采用第二种方式

(二)Linux(CentOS)下安装git

1 .先安装依赖项

yuminstallcurl-devel expat-devel gettext-develOpenSSL-devel zlib-devel

2 .下载最新的git tar.gz源代码:

wget 3359 mirrors.edge.kernel.org/pub/software/SCM/git/git-2.9.5.tar.gz

3 .解冻:

tar-xzvfgit使用tab键访问-C/usr/local/

4.

cdgit .

5.

makeprefix=/usr/localall

6 .在上一步中发现没有安装gcc。 接下来安装gcc : yum install gcc

7.gcc安装完成后进入第五部分,出现错误: can’tlocateextutils/makemaker.pmin @ Inc (@ Inc contains :/usr/local/pmin @ Inc ) () ) ) ) ) 65 share/perl5/vendor _ perl/usr/lib 64/perl5/usr/share/perl5. ) at Makefile.PL line 1。

8 .解决上述错误:

yuminstallperl-extutils-cbuilder perl-extutils-makemaker

9 .继续第五部分的成功

10.

makeprefix=/usr/localinstall

11 .成功安装了git

参考资料:安装千兆:【https://千兆- SCM.com/book/zh/v1 /开始-安装千兆】

参考资料:解决git安装错误【http://blog.51cto.com/212395/1582370】

(三)获取Revel和 Leanote 的源码

1.gogetgithub.com/revel/cmd/revel (失败)

2.gogetgithub.com/leanote/leanote/app (失败) )

3.wget https://github.com/leanote/leanote-all/archive/master.zip为/usr/local/leanote/

4 .解冻: unzip leanote…

5 .将中的src文件夹粘贴到goPackage目录下

6 .使用以下命令生成revel二进制命令: goinstallgithub.com/revel/cmd/revel

(四)安装64位 linux Mongodb 3.6.3

1 .下载:

wget 3359 fast dl.MongoDB.org/Linux/MongoDB-Linux-x86 _ 64-Amazon-3.6.3.tgz

2 .解冻

tar-z

xvf mongodb-linux-x86_64-amazon-3.6.3.tgz​


3. 配置环境变量, 编辑/etc/profile文件 加入

export PATH=$PATH:/usr/local/leanote/mongodb-linux-x86_64-amazon-3.6.3/axdjr​​


4. 在终端运行以下命令使环境变量生效:

source /etc/profile​​

5. 先在 /usr/local/leanote下新建一个目录 data 存放Mongodb数据:

mkdir /usr/local/leanote/data​

6. 用以下命令启动 mongodb :

mongod --dbpath /usr/local/leanote/data​

7. 打开终端, 输入以下命令导入数据

mongorestore -h localhost -d leanote --dir /usr/local/leanote/gopackage/src/github.com/leanote/leanote/mongodb_backup/leanote_install_data​


9. Leanote的配置存储在文件 /usr/local/leanote/goPackage/src/github.com/leanote/leanote/conf/app.conf
10. 修改app.secret=ChroblertJerrybird


(五)为mongodb数据库添加用户

 

mongo v3数据库use leanotedb.createUser({user:'root',pwd:'xxxxxxxx',roles:[{role:'dbOwner',db:'leanote'}]});​


8. 数据库用户添加完毕,下面验证是否添加成功:db.auth(‘root’,’xxxxxxxx’);若返回为1,则成功
9. 启动数据库:screen mongod –dbpath /usr/local/data –auth


(六)修改leanote的配置文件

 

db.host=127.0.0.1db.port=27017db.dbname=leanotedb.username=rootdb.password=xxxxxxxx​


7. 配置文件修改完毕,重新启动leanote。先将之前开启的关闭,然后重新启动 revel run github.com/leanote/leanote


(七)设置mongo数据库在后台运行


1. 在后台运行,启动时只需添加 –fork 函数即可。可以在日志路径后面添加 –logappend,防止日志被删除。

mongod --fork --dbpath=/usr/local/leanote/data --logpath=/usr/local/leanote/mongoDBLog/mongodb.log --logappend --auth​

2. 或者

screen mongod --dbpath /usr/local/leanote/data --auth​
(八)mongo数据库设置开机自动启动


1. 将(七).1中的代码添加至 /etc/rc.local文件中即可


(九)为leanote配置https


(1)生成ssl脚本

#!/axdjr/sh# create self-signed server certificate:read -p "Enter your domain [www.example.com]: " DOMAINecho "Create server key..."openssl genrsa -des3 -out $DOMAIN.key 1024echo "Create server certificate signing request..."SUBJECT="/C=US/ST=Mars/L=iTranswarp/O=iTranswarp/OU=iTranswarp/CN=$DOMAIN"openssl req -new -subj $SUBJECT -key $DOMAIN.key -out $DOMAIN.csrecho "Remove password..."mv $DOMAIN.key $DOMAIN.origin.keyopenssl rsa -in $DOMAIN.origin.key -out $DOMAIN.keyecho "Sign SSL certificate..."openssl x509 -req -days 3650 -in $DOMAIN.csr -signkey $DOMAIN.key -out $DOMAIN.crt​


(2)设置nginx /usr/local/nginx/conf/nginx.conf

# 本配置只有http部分, 不全http { include /etc/nginx/mime.types; default_type application/octet-stream;  upstream leanote_app { server localhost:9000; }# http server { listen 80; server_name notebook.isdevil.com;  # 强制https # 如果不需要, 请注释这一行rewrite #rewrite ^/(.*) https://jp_linode2.com/$1 permanent;  location / { proxy_pass http://notebook.isdevil.com; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }  # https server { listen 443 ssl; server_name notebook.isdevil.com; ssl_certificate ../cert/leanote/notebook.isdevil.com.crt; # 修改路径, 到a.com.crt, 下同 ssl_certificate_key ../cert/leanote/notebook.isdevil.com.key location / { proxy_pass http://notebook.isdevil.com; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }}​ (十)leanote配置开机启动


1. 在/etc/rc.local中加入一行

nohup revel run github.com/leanote/leanote 2>&1 &​


参考资料:【https://blog.csdn.net/yori_chen/article/details/79800853】
参考资料:官方:
【https://github.com/leanote/leanote/wiki/Leanote-%E6%BA%90%E7%A0%81%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B—-Mac-and-Linux】
参考资料:【http://www.bioinit.com/post/ecs-leanote】

转载请注明:大魔王ISDevil's Blog » leanote安装配置

喜欢 (0)

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。