IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    cubieboard上部署Leanote

    Blackrose发表于 2015-10-03 01:43:00
    love 0

    最近Evernote裁员,所以还是有些准备比较好。关于Leanote的安装,wiki上已经有PC版本的安装方法了,但cubieboard上的安装方法,还不太多。下面开始安装步骤:

    1. 准备运行环境

    我在cubieboard上运行debian系统,毕竟支持架构多,软件源也丰富。系统是安装在TF卡内,至于安装的步聚在cubieboard上可以参考,这里不在重述。因为TF卡比较小,所以加了一块SATA HHD,这样把数据和Leanote放在HDD比较方便些。

    系统安装好后,开始更新软件,最好是升级到最新版本。国内部分源支持架构不太多,这里推荐使用华中科大的源,速度比较不错,但是受TF卡的读写,更新还是要比HDD时间长一些。

    deb http://mirrors.ustc.edu.cn/debian/ wheezy main non-free contrib
    deb http://mirrors.ustc.edu.cn/debian/ wheezy-updates main non-free contrib
    deb http://mirrors.ustc.edu.cn/debian/ wheezy-backports main non-free contrib
    deb-src http://mirrors.ustc.edu.cn/debian/ wheezy main non-free contrib
    deb-src http://mirrors.ustc.edu.cn/debian/ wheezy-updates main non-free contrib
    deb-src http://mirrors.ustc.edu.cn/debian/ wheezy-backports main non-free contrib
    deb http://mirrors.ustc.edu.cn/debian-security/ wheezy/updates main non-free contrib
    deb-src http://mirrors.ustc.edu.cn/debian-security/ wheezy/updates main non-free contrib
    

    然后安装Leanote的相关工具,git, golang, mongodb。

    1. 安装Leanote

    上一步把相关工具安装好后,就可以安装Leanote,由于Leanote是使用go语言开发,所以需要下载相关的的go开发库,但是golang.org已经被GFW认证,所以还是下载Leanote-all的完整包即可,https://github.com/leanote/leanote-all/releases。

    cd /media/data1/
    wget https://github.com/leanote/leanote-all/archive/master.zip
    unzip master.zip
    mkdir gopackage
    mv leanote-all-master/src gopackage/
    export GOPATH=/media/data1/gopackage:$GOPATH
    go install github.com/revel/cmd/revel
    

    上面就是安装revel,最后会在gopackage/bin下有revel的执行文件。接下来就是Leanote数据库的初始化,

    cd /media/data1
    mkdir leanote-db
    mongod --dbpath /media/data1/leanote-db
    mongorestore -h localhost -d leanote --directoryperdb \ 
    /media/data1/gopackage/src/github.com/leanote/leanote/mongodb_backup/leanote_install_data
    

    数据库初始化完成后,可以使用mongo命令进入,然后查看leanote数据库。

    然后是配置Leanote网站IP地址和端口。

    vi gopackage/src/github.com/leanote/leanote/conf/app.conf
    site.url=http://192.168.2.159:9000
    

    最后一步就是让Leanote运行,可以通过浏览器来访问此网站

    ./gopackage/bin/revel run github.com/leanote/leanote
    



沪ICP备19023445号-2号
友情链接