是基于Ruby,所以服务器需要安装有ruby,国内需要把ruby的源改为淘宝的
Centos上
yum groupinstall "Development Tools"
yum -y install freeglut libX11-devel mesa-libGL-devel perl-Time-HiRes freeglut-devel readline-devel libffi-devel libtool bison libxml2-devel libxslt-devel zlib zlib-devel sqlite-devel git openssl-devel
编译安装ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
tar zxvf ruby-1.9.3-p392.tar.gz
cd ruby-1.9.3-p392
./configure --prefix=/usr/local --enable-shared --disable-install-doc --with-opt-dir=/usr/local/lib
make
make install
gem install chipmunk net-ssh-gateway net-ssh mkrf ftools net-ssh ruby-opengl file-tail
gem install opengl -v 0.7.0.pre1
2. 下载ruby源码包
安装(2014.04.20最新版本是2.1.1,查看最新版本可点击进入https://www.ruby-lang.org/en/downloads/ 查看)
#wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz
#tar -zxvf ./ruby-2.1.1.tar.gz
#cd ./ruby-2.1.1
3. 加入参数编译安装
#./configure --with-zlib=/usr/local/include --with-openssl=/usr/local/include
通过添加--with-openssl和--with-zlib两个参数让zlib和openssl编译进ruby模块中
#make
#make install
2.0以上的版本自带gem
以上是网上搜索到的ruby安装情况,实际过程中会遇到一些问题
以下是自己在实际安装步骤
编译安装ruby2.1.2
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar zxvf ruby-2.1.2.tar.gz
cd ruby-2.1.2
./configure
make
make install
移除并更新国内淘宝源
gem sources --remove https://rubygems.org/
gem sources -a http://ruby.taobao.org/
gem sources -l
gem update --system
gem install bundler
gem update
gem install opengl net-ssh glu glut net-ssh-gateway chipmunk
这个主要在执行gltail的提示缺少的组件
RVM 改用淘宝下载源, 提高 Ruby 安装速度
$ sed -i 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
下载gltail
git clone git://github.com/Fudge/gltail.git
修改配置文件
servers:
site1:
host: 10.40.2.10
user: root
password: thistset
command: tail -f -n0
files: /var/log/httpd/access_log
parser: apache
color: 0.2, 1.0, 0.2, 1.0
# rails:
# gateway: gw-server.anotherfunsite.com
# host: anotherfunsite.com
# user: anotherfunuser
# port: 222
# command: tail -f -n0
# files: /var/www/apps/funapp/current/log/production.log
# parser: rails
# color: 0.2, 0.2, 1.0, 1.0
config:
dimensions: 1200x600
min_blob_size: 0.004
max_blob_size: 0.04
highlight_color: orange
bounce: false
left_column:
size: 25
alignment: -0.99
blocks:
info:
order: 0
size: 10
auto_clean: false
show: total
hosts:
order: 1
size: 3
sites:
order: 2
size: 10
content:
order: 3
size: 5
show: total
color: 1.0, 0.8, 0.4, 1.0
status:
order: 4
size: 10
color: 1.0, 0.8, 0.4, 1.0
types:
order: 5
size: 5
color: 1.0, 0.4, 0.2, 1.0
users:
order: 6
size: 10
smtp:
order: 7
size: 5
logins:
order: 8
size: 5
database:
order: 9
size: 10
memcached:
order: 10
size: 3
right_column:
size: 25
alignment: 0.99
blocks:
urls:
order: 0
size: 15
slow requests:
order: 1
size: 5
show: average
referrers:
order: 2
size: 10
user agents:
order: 3
size: 5
color: 1.0, 1.0, 1.0, 1.0
mail from:
order: 4
size: 5
mail to:
order: 5
size: 5
viruses:
order: 6
size: 5
rejections:
order: 7
size: 5
color: 1.0, 0.2, 0.2, 1.0
warnings:
order: 8
size: 5
resolver:
reverse_ip_lookups: true
reverse_timeout: 0.5
执行操作
./gl_tail ../config.yaml
目前纠结的是IIS日志没能实现,公司全是iis服务器,纠结啊