首先推薦一下螞蟻筆記(leanote)這款軟件,一款開源而且很是好用的筆記軟件,很是好的支持Markdown文本編輯,雖然近期開始收費,可是有必定技術基礎的能夠自建服務器,就能夠愉快的使用屬於本身的螞蟻筆記。今天我在本身的阿里雲服務器上部署了螞蟻筆記的服務,整個過程記錄一下,以做備用。linux
yum install -y git
cd /home/leanote/
wget https://redirector.gvt1.com/edgedl/go/go1.8.5.linux-amd64.tar.gz
下載golangtar -zxvf go1.8.5.linux-amd64.tar.gz
,解壓後獲得一個go文件夾vi /etc/profile
export GOROOT=/home/leanote/go
export GOPATH=/home/leanote/gopackage
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
複製代碼
source /etc/profile
命令使環境變量生效go version
來測試是否配置成功,若是成功則出現go的版本號/home/leanote/
文件夾下wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.1.tgz
tar -zxvf mongodb-linux-x86_64-3.0.1.tgz
後獲得文件夾mongodb-linux-x86_64-3.0.1
vi /etc/profile
export PATH=$PATH:/home/leanote/mongodb-linux-x86_64-3.0.1/bin
複製代碼
source /etc/profile
命令使環境變量生效/home/leanote/
下建立data
文件夾用來存放mongo的數據mongod --dbpath /home/leanote/data
,啓動後這個終端就先不要關閉了mongo
,測試啓動是否成功ctrl + c
退出/home/leanote/
文件夾下git clone https://github.com/leanote/leanote-all.git
下載獲得leanote-all-master
文件夾/home/leanote/
文件夾下建立gopackage
文件夾leanote-all-master
文件下的src
整個文件夾都拷貝到gopackage
文件夾下:cp -r lenote-all-master/ gopackge/
go get github.com/revel/cmd/revel
mongorestore -h localhost -d leanote --dir /home/leanote/gopackage/src/github.com/leanote/leanote/mongodb_backup/leanote_install_data
mongo
> show dbs
leanote
,則表示數據導入成功/home/leanote/gopackage/src/github.com/leanote/leanote/conf
下的app.conf
,使用vi編輯器編輯,爲了安全期間,請務必修改app.secret
一項,在若干隨機位置處,將字符修改爲一個其餘的值。revel run github.com/leanote/leanote
命令運行Leanote/home/leanote/data/
下建立log
文件夾,用來存放後臺運行的mongodb的日誌mongod --fork --dbpath /home/leanote/data/ --logpath /home/leanote/data/log/20180225.log --logappend
用來後臺啓動mongodb服務nohup revel run github.com/leanote/leanote
啓動Leanote