一台连上外网的机器
1.下载对应的 node 安装包
2.下载 Elasticsearch-head 安装包(顺便解压)
3.cmd 输入下面命名安装taobao提供的镜像(原因你懂的)
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
4.cmd cd 到你解压的 elasticsearch-head 目录下$ cnpm install这时你会发现多了一个 node_modules 目录
5.install 后,head 目录下会自动生成一个 node_modules 目录,里面为相关的依赖
到此,本地的准备工作都已完成。
可以把两个安装包上传到服务器。
建议:elasticsearch-head 重新压缩后上传
在 /etc/profile 添加(改成你的路径)
export NODE_HOME=/usr/local/elastic/node/node-v6.9.2-linux-x64export PATH=$NODE_HOME/bin:$PATH
记得 $ source /etc/profile
在 elastic/config/elasticsearch.yml 添加(否则完成后网页中会显示未连接)
http.cors.enabled: true http.cors.allow-origin: "*"
之后(后台启动加 &)
./grunt server
在网页中输入你的
http://localhost:9100