安装yapi

1.安装MongoDB

curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz    # 下载
tar -zxvf mongodb-linux-x86_64-3.0.6.tgz                                   # 解压

mv  mongodb-linux-x86_64-3.0.6/ /usr/local/mongodb                         # 将解压包拷贝到指定目录

MongoDB 的可执行文件位于 bin 目录下,所以可以将其添加到 PATH 路径中:

export PATH=/bin:$PATH

创建数据库

mkdir -p /usr/local/mongodb/data/db

后台启动MongoDB

mkdir conf

mkdir mongodb.conf

mongodb.conf 文件:

dbpath=/usr/local/mongodb/data/db
logpath=/usr/local/mongodb/data/mongo.log
logappend=true
fork=true
port=27017

启动 ./mongod -f /usr/local/mongodb/mongodb.conf

 

 

2:安装node

wget https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.xz

tar xf  node-v10.9.0-linux-x64.tar.xz

cd node-v10.9.0-linux-x64

./bin/node -v

mkdir /usr/local/node

cp -R /root/node-v10.9.0-linux-x64/ /usr/local/node/node-v10.9.0-linux-x64

ln -s /usr/local/node/node-v10.9.0-linux-x64/bin/npm   /usr/local/bin/

ln -s /usr/local/node/node-v10.9.0-linux-x64/bin/node   /usr/local/bin/

node --version

 

3、安装yapi

cd /usr/local/mongodb/

./mongo use admin

 

cd /home/data

mkdir yapi

cd yapi

git clone https://github.com/YMFE/yapi.git vendors

cp vendors/config_example.json ./config.json

cd vendors

npm install --production --registry https://registry.npm.taobao.org

npm install -S pm2

 

默认账号 [email protected]   默认密码:ymfe.org

启动       pm2 start /home/data/yapi/vendors/server/app.js
关闭执行: pm2 stop /home/data/yapi/vendors/server/app.js

 

参考菜鸟教程

参考:https://blog.csdn.net/Tangyuan_92/article/details/85321075

参考 http://www.mamicode.com/info-detail-1498097.html

你可能感兴趣的:(工作笔记)