maptail

WBOY
WBOYOriginal
2016-06-07 15:05:271240browse

maptail的原理是基于node.js, 通过调用WEB服务器访问日志实时打印访问信息. 注:下面node是基于源码编译安装.并依赖python2.6~2.7版本,如果python是2.6以上版本无需再安装. 软件包下载地址: maptail:https://github.com/stagas/maptail/ node:http://nodejs.o

maptail的原理是基于node.js, 通过调用WEB服务器访问日志实时打印访问信息.
注:下面node是基于源码编译安装.并依赖python2.6~2.7版本,如果python是2.6以上版本无需再安装.
软件包下载地址:
maptail:https://github.com/stagas/maptail/
node:http://nodejs.org

一、安装node

<code class="bash">#wget http://nodejs.org/dist/v0.10.0/node-v0.10.0.tar.gz#tar zxvf node-v0.10.0.tar.gz#cd node-v0.10.0#./configure#make && make install</code>

二、安装maptail

解压出来就可以了,无需编译安装.

<code class="bash">#wget https://github.com/stagas/maptail/archive/master.zip#unzip master.zip#mv maptail-master /usr/local/maptail</code>

三、安装其它依赖包

运行maptail报以下错误安装以下依赖包:
Error: Cannot find module 'geoip-lite-with-city-data'
Error: Cannot find module 'express'
Error: Cannot find module 'simpl'

<code class="bash">#cd /usr/local/maptail/bin#npm install geoip-lite#npm install express#npm install simpl</code>


修改maptail.js.

<code class="bash">#cd /usr/local/maptail/lib#vi maptail.js</code>


将geoip-lite-with-city-data改为geoip-lite

四、下载数据文件

<code class="bash">#cd /usr/local/maptail/node_modules/geoip-lite/data#wget https://github.com/bluesmoon/node-geoip/blob/master/data/geoip-city-names.dat#wget https://github.com/bluesmoon/node-geoip/blob/master/data/geoip-city.dat</code>

五、运行maptail

<code class="bash">#cd /usr/local/maptail/bin#nohup tail -fn 20 /htdocs/logs/access.log | ./maptail -h 192.168.1.1 -p 8080 &</code>


访问:http://192.168.1.1:8080
注:/htdocs/logs/access.log为站点访问日志文件.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:RHEL6上课笔记之aclNext article:PPT 技巧学习