cd ~/tmp git clone https://github.com/leanote/leanote-all.git --depth=1 mkdir /usr/local/apps/gopackage cp -r leanote-all/src/ gopackage/ # install revel # go get github.com/revel/cmd/revel # timeout! mkdir -p /usr/local/apps/go/src/golang.org/x/ cd /usr/local/apps/go/src/golang.org/x/ git clone https://github.com/golang/net.git --depth=1 git clone https://github.com/golang/crypto.git --depth=1 git clone https://github.com/golang/sys.git --depth=1 git clone https://github.com/golang/tools.git --depth=1 git clone https://github.com/golang/mod.git --depth=1 git clone https://github.com/golang/xerrors.git --depth=1 cd /usr/local/apps/go/bin go build github.com/revel/cmd/revel revel # init data mongorestore -h 127.0.0.1(your server private IP) -d leanote --dir /usr/local/apps/gopackage/src/github.com/leanote/leanote/mongodb_backup/leanote_install_data mongo show dbs # if there is a leanote database, it means that the initialization data is successful. # create a super administrator use admin db.createUser({user: 'root', pwd: 'root', roles: ['clusterAdmin', 'dbAdminAnyDatabase', 'userAdminAnyDatabase', 'readWriteAnyDatabase']}) db.auth('root', 'root')
use leanote db.createUser({user: 'leanote', pwd: 'leanotepwd', roles: ['readWrite']}) db.auth('leanote', 'leanotepwd') # stop mongodb service and quit use admin db.shutdownServer() exit
5 Configure Leanote
1 2 3 4 5 6 7 8 9 10 11 12 13
cd /usr/local/apps/gopackage vim src/github.com/leanote/leanote/conf/app.conf # you website public ip or url site.url=http://www.example.com:9000 # mongodb db.username=leanote db.password=leanotepwd # You Must Change It !!! app.secret=[you can modify it at will] # start mongodb service mongod --auth --config /usr/local/apps/mongodb/conf/mongodb.conf # start leanote nohup revel run src/github.com/leanote/leanote >leanote.log 2>&1 &
Now, you can try to open www.example.com:9000 ! The default account is admin and password is abc123.
6 Other
6.1 MongoDB Error
ERROR: child process failed, exited with error number 48 To see additional information in this outpu
1 2 3 4 5 6
# start in repair mode again ./mongod --dbpath=/usr/local/apps/mongodb/data/db --logpath=/usr/local/apps/mongodb/data/log/mongodb.log --repair # According to the tips to fix! and kill mongod pkill mongod # restart mongodb mongod --auth --config /usr/local/apps/mongodb/conf/mongodb.conf