安装nginx:
1: 安装GCC编辑器支持。
yum -y install pcre*
yum -y install openssl*
yum -y install gcc gcc-c++ make
yum -y install gcc-c++
yum -y install make
2: 上传并解压nginx,可使用root用户
3: 进入/modules/nginx 目录
./configure
make
make install
4: 进入 /usr/local/nginx/conf
修改配置文件:nginx.conf
nginx 日志采集
配置如下:
user root;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr,$remote_user,[$time_local],"$request" '
'$status,$body_bytes_sent,"$http_referer" '
'"$http_user_agent","$http_x_forwar