11k+star 开源笔记应用真香 centos部署教程

leanote binary installation on Mac and Linux (En)

life edited this page on Jul 21, 2017 · 10 revisions

 Pages 26

Clone this wiki locally

This tutorial explains doing a binary installation on Mac and Linux systems.

If you wish to experience the new feature sooner or help develop Leanote, please try using the source distribution.

  • For source installation on Mac and Linux, see here.
  • For binary installation on Windows, see here.
  • For source installation on Windows, see here.

Installation Overview:

  1. Download the binary file of Leanote.
  2. Install the database -- Mongodb.
  3. Import initial data to Mongodb.
  4. Configure Leanote.
  5. Run Leanote.

1. Download the binary file of Leanote

Choose and download the binary file corresponding to your system from here.

Suppose it is saved in the /home/user1 folder, extract the .zip file there using:

$> cd /home/user1
$> unzip master.zip

This will create a Leanote directory under /home/user1.


2. Install the database -- Mongodb

2.1 Download Mongodb and configure

You could download a more up-to-date version from the official site of Mongodb. Or, you could use the following links to get the versions that are validated to be working by the developers.

Fast download:

Save the file to /home/user1, then extract it:

$> cd /home/user1
$> tar -xzvf mongodb-linux-x86_64-3.0.1.tgz/

To make sure that you can reference the Mongodb command from anywhere, configure its environment variable by editing your ~/bash_profile or /etc/profile:

sudo vim /etc/profile

Here I'm using the vim editor, feel free to use whatever text editor you prefer (e.g. nano). Add the following line to the file, and remember to replace with you own username and version strings:

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

To make your modification take effect:

$> source /etc/profile

2.2 Test Mongodb installation

To verify the installation of mongodb, make a new folder (e.g. data) under /home/user1 to store data:

$> mkdir /home/user1/data

Then start the Mongodb database server. You might want it to run in the background, so append & to the end:

$> mongod --dbpath /home/user1/data &

Now Mongodb is up and running, you can open a new terminal (or in the same terminal session if you have mongod run in the background) and launch it:

$> mongo
> show dbs

Should no error pops up, your Mongodb installation is complete, let's import initial data to Mongodb.


3. Import initial Leanote data

Leanote's initial data is stored in PATH_TO_LEANOTE/mongodb_backup/leanote_install_data

Open a terminal and paste in the following command to import initial data. Note the difference between the version 2 and 3 of Mongodb:

$> mongorestore -h localhost -d leanote --dir PATH_TO_LEANOTE/mongodb_backup/leanote_install_data/

Now Mongodb has created a Leanote database, you can have a peek into it, for instance query how many tables leanote database has:

$> mongo
> show dbs 
leanote	0.203125GB
local	0.078125GB

Tell Mongodb to use our newly created leanote database:

> use leanote 
switched to db leanote

Bit more playing around:

> show collections # a collection in Mongodb is a table in mysql
files
has_share_notes
note_content_histories
note_contents
notebooks
...

The initial users table has two accounts:

user1 username: admin, password: abc123 (administrator who can manage Leanote)
user2 username: demo@leanote.com, password: demo@leanote.com (just for demonstration)

4. Configure Leanote

The configuration of Leanote is controlled by this file: PATH_TO_LEANOTE/conf/app.conf.

One setting that you are strongly suggested to modify is app.secret, please change arbitrary number of digits of the string to something different, but keeping the string length unchanged. This is to avoid potential security issues.

Other optional changes you can make includes db.usernamedb.password (more on these in the Trouble Shooting section) and etc..


5. Run Leanote

If you have successfully come to this stage, there is just one more step to go:

$> cd /home/user1/leanote/bin
$> bash run.sh

If you see a message similar to this, Leanote has started successfully:

...
TRACE 2013/06/06 15:01:27 watcher.go:72: Watching: /home/user1/leanote/bin/src/github.com/leanote/leanote/conf/routes
Go to /@tests to run the tests.
Listening on :9000...

Congratulations, now fire up you browser and enter http://localhost:9000 into the address bar. Voilà! Welcome to Leanote and happy note-taking!


Attention!!!!!

Please note that you run Mongodb with no auth option which mentioned in this paper, if your server is exposed to the internet, anyone can access and modify and delete it!!!!!! So it's very dangerous to run Mongodb in this way. You must add user and password to Mongodb and run it with auth option. Please see How to add new users to mongodb database?

Trouble shooting

If you encounter issues or want to know more about Leanote's configurations, refer to the FAQ page.

参考文档:

leanote binary installation on Mac and Linux (En) · leanote/leanote Wiki · GitHub

相关推荐

  1. 11k+star 开源笔记应用 centos部署教程

    2024-01-16 22:16:01       56 阅读
  2. 缓存预热!

    2024-01-16 22:16:01       57 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-16 22:16:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-16 22:16:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-16 22:16:01       87 阅读
  4. Python语言-面向对象

    2024-01-16 22:16:01       96 阅读

热门阅读

  1. QT中线程的退出分析

    2024-01-16 22:16:01       58 阅读
  2. C语言—存储管理

    2024-01-16 22:16:01       50 阅读
  3. 网络基础知识

    2024-01-16 22:16:01       47 阅读
  4. 搭建feign远程调用环境

    2024-01-16 22:16:01       61 阅读
  5. C语言经典算法之快速排序算法

    2024-01-16 22:16:01       53 阅读
  6. [DM8] 序列使用说明

    2024-01-16 22:16:01       57 阅读
  7. 【vue】vue跑马灯vue-marquee-text-component

    2024-01-16 22:16:01       48 阅读
  8. samba

    2024-01-16 22:16:01       43 阅读