一 、安装mongodb 4 最新版本
tar -zxvf mongodb-linux-x86_64-4.0.9.tgz
mv mongodb-linux-x86_64-4.0.9/ mongodb
vi /etc/profile
#mongodb export MONGODB_HOME=/opt/mongodb export PATH=$PATH:$MONGODB_HOME/bin
|
---|
创建目录data/db和logs/mongodb.log文件
后台运行
./mongod --fork --dbpath /opt/mongodb/data/db --logpath /opt/mongodb/logs/mongodb.log
测试
[root@weikeu mongodb]# /opt/mongodb/bin/mongo MongoDB shell version v4.0.9 connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb Implicit session: session { "id" : UUID("d6e33e1e-b0d3-4f11-b320-18092a27cefd") } MongoDB server version: 4.0.9 > show dbs; admin 0.000GB config 0.000GB local 0.000GB |
---|
创建zanperfor需要的库performance
mongo > db |
---|
二 、安装redis 5
tar -zxvf redis-5.0.5.tar.gz
cd redis-5.0.5/
make
生成src文件夹
cp redis.conf src/redis.conf
vi src/redis.conf
修改daemonize no 为 yes
后台启动 ./redis-server redis.conf
ps -ef | grep redis
测试 ./redis-cli
$ ./redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
三、安装node
wget http://cdn.npm.taobao.org/dist/node/v10.15.3/node-v10.15.3-linux-x64.tar.xz
xz -d node-v10.15.3-linux-x64.tar.xz
tar -xvf node-v10.15.3-linux-x64.tar
mv node-v10.15.3-linux-x64 /opt/
vi ~/.bashrc
[root@weikeu opt]# cat ~/.bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
#末尾添加
export PATH=$PATH:/opt/node-v10.15.3-linux-x64/bin
生效该文件
source ~/.bashrc
或者 修改/etc/profile文件,在末尾添加
export PATH=$PATH:/opt/node-v10.15.3-linux-x64/bin
生效 profile文件 source /etc/profile
验证nodejs安装成功
[root@weikeu opt]# node -v
v10.15.3
[root@weikeu opt]# npm -v
6.4.1
四 、安装zanePerfor
git clone https://github.com/wangweianger/zanePerfor.git
cd zanePerfor
npm install --unsafe-perm=true --save-dev grunt
cd conf
vi config.default.js
// 线上环境此处替换为项目根域名 例如:blog.seosiwei.com (这里不需要填写http|https和斜杠等字符)
// 用于安全校验和回调域名根路径 开发路径域名
config.host = 'zp.weikeu.com';
config.port = 7001;
运行 npm run dev
后台运行
[root@weikeu zanePerfor]# touch zanperfor.log [root@weikeu zanePerfor]# chmod u+w zanperfor.log [root@weikeu zanePerfor]# nohup npm run dev > zanperfor.log 2>zanperfor.log & [1] 17593 [root@weikeu zanePerfor]# ps -ef | grep dev root 18 2 0 Jun25 ? 00:00:00 [kdevtmpfs] root 1454 1 0 Jun25 ? 00:00:00 /usr/lib/systemd/systemd-udevd root 17604 17593 2 23:07 pts/0 00:00:00 node /opt/zanePerfor/node_modules/.bin/egg-bin dev root 17674 13134 0 23:07 pts/0 00:00:00 grep --color=auto dev |
---|
五、nginx 设置
/usr/local/nginx/ngconfs
[root@weikeu ngconfs]# cat zp.conf
server {
listen 80;
server_name zp.weikeu.com ;
autoindex on ;
location / {
proxy_pass http://localhost:7001/;
}
}
[root@weikeu conf]# pwd
/usr/local/nginx/conf
[root@weikeu conf]# vi nginx.conf
#gzip on;
#添加一行
include /usr/local/nginx/ngconfs/*.conf ;
六、访问
zp.weikeu.com
注册管理员帐号 admin 123456
个人博客: http://weikeu.com