网上的配置步骤都是一样的,按照步骤来还捣弄了一下午,有部分问题我在此处在声明一下:

转载请注明原文出处:http://www.minunix.com/2013/04/maptail/    原文作者:MinUnix

具体效果图见http://views.minunix.com:78

安装参考:https://github.com/stagas/maptail

一 . 下载软件包:

node.tar.gz

maptail-master.zip

Python-2.7.3.tgz

二 . 安装

1 . 依赖python2.6-2.7版本模块的支持,已经安装python,且版本为2.6以上的跳过此步骤:
python -V \\\ 查看当前系统python 版本

安装python 方法, 1) wget ... 2)./configure ...3)make && make install 4) 创建软链接

2 . 安装nodeJS . maptail

1
2
3
4
5
6
7
8
9
10
11
12
13
mkdir -p /tmp/src
cd /tmp/src
wget http://www.minunix.com/docs/other/node.tar.gz
wget http://www.minunix.com/docs/other/maptail-master.zip
tar xf node.tar.gz
cd node-v0.8.16
./configure
make && make install
npm install \\\ 如果遇到错误见下文
cd ../ && tar xf maptail-master
/bin/cp -rf ./maptail-master /usr/local/maptail
chmod +x /usr/local/maptail/bin/maptail
ln -sv /usr/local/maptail/bin/maptail /usr/local/bin/maptail

3.启动maptail监听

1
2
nohup tail -f /usr/local/nginx/logs/access.log|maptail -h 192.168.133.179 -p 8080 &
echo "/usr/bin/nohup /usr/bin/tail -f /usr/local/nginx/logs/access.log |/usr/local/maptail/bin/maptail -h 192.168.133.179 -p 8080 &" >> /etc/rc.local

打开浏览器访问  http://192.168.133.179:8080
很多新童鞋可能会在此处看不到内容,需要说明几个参数:

access.log: 是您的网站的日志文件
-h :  指定您本机的地址
-p : 指定一个端口,此端口node会自动运行在此端口,需要注意下!!! 

转载请注明原文出处:http://www.minunix.com/2013/04/maptail/    原文作者:MinUnix

 注: 问题解决:
1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# npm install
npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open '/tmp/src/node-v0.8.16/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>

npm ERR! System Linux 2.6.32-220.el6.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /tmp/src/node-v0.8.16
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! path /tmp/src/node-v0.8.16/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/src/node-v0.8.16/npm-debug.log
npm ERR! not ok code 0

在执行npm install 时提示以上的错误,运行以下命令可解决:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# npm install -g express
npm http GET https://registry.npmjs.org/express
npm http 200 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express/-/express-3.2.0.tgz
...
...
...
npm http 200 https://registry.npmjs.org/bytes/0.2.0
npm http GET https://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz
npm http 200 https://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz
/usr/local/bin/express -> /usr/local/lib/node_modules/express/bin/express
express@3.2.0 /usr/local/lib/node_modules/express
├── methods@0.0.1
├── fresh@0.1.0
├── range-parser@0.0.4
├── cookie-signature@1.0.1
├── buffer-crc32@0.2.1
├── cookie@0.0.5
├── debug@0.7.2
├── commander@0.6.1
├── mkdirp@0.3.5
├── send@0.1.0 (mime@1.2.6)
└── connect@2.7.6 (pause@0.0.1, bytes@0.2.0, buffer-crc32@0.1.1, formidable@1.0.11, qs@0.5.1)

如果看到以上信息表示依赖包的安装已经成功了,之后再启动即可;

2.
启动遇到的问题:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
##出现:
1.) Error: Cannot find module 'geoip-lite-with-city-data'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/usr/local/maptail/lib/maptail.js:2:13)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
2.) Error: Cannot find module 'express'

3.) Error: Cannot find module 'simpl'

##解决
1.) #npm install geoip-lite-with-city-data
2.) #npm install express
3.) #npm install simpl

具体效果图见http://views.minunix.com:78

转载请注明原文出处:http://www.minunix.com/2013/04/maptail/    原文作者:MinUnix