Server config:
yum -y install gcc-c++
wget http://nodejs.org/dist/v0.8.14/node-v0.8.14.tar.gz
tar -zxvf node-v0.8.14.tar.gz -C /usr/src/
cd /usr/src/node-v0.8.14/
./configure && make && make install && echo OK
# wget https://npmjs.org/install.sh && sh install.sh
装 log.io(包含了 log server 和 log harvester)
# npm config set unsafe-perm true ; echo $?
# npm install -g --prefix=/usr/local log.io ; echo $?
# vim /root/.log.io/web_server.conf # start authentication
exports.config = {
host: '0.0.0.0',
port: 28778,
// Enable HTTP Basic Authentication
auth: {
user: "admin",
pass: "1234"
},
/*
// Enable HTTPS/SSL
ssl: {
key: '/path/to/privatekey.pem',
cert: '/path/to/certificate.pem'
},
*/
# start log.io
# log.io-server start &
# netstat -nputl | grep node
tcp 0 0 0.0.0.0:28777 0.0.0.0:* LISTEN 18901/node
tcp 0 0 0.0.0.0:28778 0.0.0.0:* LISTEN 18901/node
client config:
vim /root/.log.io/harvester.conf
exports.config = {
nodeName: "nodeB", #nodename
logStreams: {
nginx_access: [ #log name
"/var/log/nginx/access.log", #dir
],
nginx_error: [ #log name
"/var/log/nginx/error.log" #dir
]
},
server: {
host: '10.10.0.2', #Server IP
port: 28777 #Server default
}
访问:server端, x.x.x.x:28778
博文出自:http://8824130.blog.51cto.com/8814130/1573421
本文出自 “linux网络服务搭建” 博客,谢绝转载!