DOCLever--安裝篇

DOCLever是一個完全免費的商業化開源產品,主要用於解決接口管理、測試與數據生成,以實現真正的一體化解決方案。

項目地址https://github.com/sx1989827/DOClever
根據官方文檔整理的安裝步驟:http://doclever.cn/controller/read/read.html#5a532f98b7731a2ba86093b3

安裝步驟:

1、安裝node

wget https://nodejs.org/dist/v8.11.4/node-v8.11.4-linux-x64.tar.xz
tar xvf node-v8.11.4-linux-x64.tar.xz

2、設置node環境變量

vim /etc/profile

export NODE_HOME=/node/node-v8.11.4-linux-x64
export PATH=$PATH:$NODE_HOME/bin 
export NODE_PATH=$NODE_HOME/lib/node_modules

source /etc/profile
# 驗證node安裝配置成功
node -v

3、安裝mongodb

mkdir mongodb
cd mongodb
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.4.tgz
tar zxvf mongodb-linux-x86_64-4.0.4.tgz
mkdir db
mkdir logs
cd bin
vim mongodb.conf #初始沒有該文件,在該文件中添加以下代碼

bind_ip=安裝mongodb機器的ip
port=27017
fork=true
dbpath=/data/mongodb/27017_mongo/data
pidfilepath=/data/mongodb/27017_mongo/mongodb.pid
logpath=/data/mongodb/27017_mongo/log/mongodb.log
logappend=true
journal=true
nohttpinterface=true
maxConns=50000
directoryperdb=true
auth=true  # auth認證開啓連接時需要額外的配置,後續說明
syncdelay=60

# 啓動mongodb
./mongod -f mongodb.conf

4、DOCLever源碼安裝

git clone https://github.com/sx1989827/DOClever.git

node /DOCLever/Server/bin/www
# 需要輸入mongodb連接
1、如果mongodb未開啓認證,連接命令如下
mongodb://ip:port/dbname
2、如果mongodb開啓了認證,需要使用以下的連接方式,authMechanism需要查看一下自己安裝的mongodb
mongodb://username:password@ip:port/dbname?authSource=admin&authMechanism=SCRAM-SHA-1
# 需要設置端口,默認10000
驗證:瀏覽器裏面輸入:http://ip:port即可驗證

5、DOCLever進程守護設置

爲什麼需要進程守護?因爲不進程守護的話退出服務器之後DOCLever進程會自己kill掉
# 安裝forever進程守護軟件
npm install cnpm -g
cnpm install forever -g
forever start /DOCLever/Server/bin/www

注:forever守護node.js進程

好了,至此DOCLever已經安裝完成可以嘗試使用了!!!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章