centos 3.0 搭建

前端之家收集整理的这篇文章主要介绍了centos 3.0 搭建前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Zabbix3.0界面焕然一新,一改10多年的老面孔,alpha4的更新具体记录如下:http://www.zabbix.com/rn3.0.0alpha4.php

What's New in 3.0.0alpha4

  • [ZBXNEXT-1762] added years,months and half of months periods displaying on graphs X axis

  • [ZBXNEXT-1679] implemented value map import/export

  • [ZBXNEXT-1679] added checkBox column in value map list view and bulk "Delete" button

  • [ZBXNEXT-1679] added "Used in items" column in value map list view and green text "Yes" if value map is used in items or item prototypes

  • [ZBXNEXT-1679] added value map sorting by name

  • [ZBXNEXT-1679] added limit for the amount of records and paging in value maps

  • [ZBXNEXT-1679] replaced built-in confirmation dialog with modal window dialog for image import when selecting "Update existing"

  • [ZBXNEXT-2683] added user macro context

  • [ZBX-2616] updated bundled DejaVu font from 2.34 to 2.35

  • [ZBX-9935] added check for item delay,to be between 0 and 86400 seconds

  • [ZBX-1357] updated Brazilian Portuguese,Czech,Finnish,Japanese,Polish,Russian and Slovak translations; thanks to Zabbix translators

  • [ZBXNEXT-2678] implemented trigger description and URL popups in the dashboard's "Last 20 issues" and screen element's "Host group issues" and "Host issues"

  • [ZBX-2517] minimum period for time navigator set to 5 minutes; thanks to Zabbix community

  • [ZBXNEXT-1424] implemented value mapping API,added clone button in value map edit form and slightly improved performance of value map caching in frontend

  • [ZBXNEXT-2960] reduced the default MaxLinesPerSecond value to 20

Zabbix 3.0安装过程与2.x的变化类似,但又少许需要注意的坑(以下标红的),否则会坑的不行。。。

基础环境:

Nginx:1.9.7

MysqL:5.5.32

PHP:5.5.30(zabbix_3.0 要求PHP版本至少在5.4以上)

Nginx安装:

1.rpm -qa pcre pcre-devel
2.yum install pcre pcre-devel openssl openssl-devel -y
4.useradd Nginx -s /sbin/nologin -M
5../configure  --user=Nginx --group=Nginx --prefix=/application/Nginx-1.9.7 --with-http_stub_status_module  --with-http_ssl_module
make && make installln -s /application/Nginx-.7 /application/Nginx
6.ls -l /application/
7./application/Nginx/sbin/Nginx
8.ps -ef|grep Nginx
9.ss -lntup|grep Nginx
[root@zabbix_3.0 conf]# egrep -v  "#|^$" Nginx.conf.default > Nginx.conf
[root# vim /application/Nginx/conf/Nginx.conf
worker_processes  1;
events {
  worker_connections  1024;
}
http {
  include	   mime.types;
  default_type  application/octet-stream;
  sendfile		on;
  keepalive_timeout  65;
  server {
    listen	   80;
    server_name  localhost;
    location / {
      root   html;
      index  index.PHP index.html index.htm;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
   root   html;
  }
  location ~ \.(PHP|PHP5)?$ {
   root		   /application/Nginx/html;
      fastcgi_pass   127.0.0.1:9000;
      fastcgi_index  index.PHP;
       # fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
      fastcgi_param  SCRIPT_FILENAME  /application/Nginx/html$fastcgi_script_name;
      include		fastcgi_params;
      }
    }
}

MysqL安装:

yum install tree nmap lrzsz dos2unix -y
[root0 tools]# tar xf MysqL-5.5.32-linux2.6-x86_64.tar.gz [root@zabbix_3.0 tools]# mv MysqL-5.5.32-linux2.6-x86_64 /application/MysqL-5.5.32[root@zabbix_3.0 tools]# ln -s /application/MysqL-5.5.32/ /application/MysqL
[root@zabbix_3.0tools]# useradd MysqL -s /sbin/nologin -M[root@zabbix_3.0 tools]# chown -R MysqL.MysqL /application/MysqL 
[root# cd /application/MysqL
vim /etc/hosts[root0 MysqL]# ./scripts/MysqL_install_db  --basedir=/application/MysqL --datadir=/application/MysqL/data/ --user=MysqL
cp support-files/MysqL.server /etc/init.d/MysqLd
sed -i 's#/usr/local/MysqL#/application/MysqL#g' /application/MysqL/bin/MysqLd_safe /etc/init.d/MysqLd
 cp support-files/my-small.cnf /etc/my.cnf
cp:是否覆盖@H_578_301@"/etc/my.cnf"? y
echo @H_578_301@'export PATH=/application/MysqL/bin:$PATH' >>/etc/profile
 source /etc/profile
[root0 application]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
# cp -a /application/MysqL/bin/* /usr/local/sbin
service MysqLd start
MysqLadmin -uroot password jiayuan.com

PHP安装:

1.yum -y install zlib-devel libxml2-devel libjpeg-devel libiconv-devel freetype-devel libpng-devel gd-devel curl-devel libxslt-devel
2.wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar zxf libiconv-1.14.tar.gzcd libiconv-1.14./configure --prefix=/usr/local/libiconvmakemake installcd ../
3.yum -y install libmcrypt-devel mhash mcrypt
ln -s /application/MysqL/lib/libMysqLclient.so.18 /usr/lib64/

PHP 5.5.30:(--with-MysqLi=MysqLnd和--with-gettext一定要加上,否则前者不装时安装zabbix时database type没有选项默认出来的数据库sqlite3,且不能切换,后者不装时,会报PHP gettext warning)

./configure \
--prefix=/application/PHP5.5.30 \
--with-MysqL=/application/MysqL/ \
--with-MysqLi=MysqLnd \
--with-pdo-MysqL=MysqLnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--with-gettext \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user=Nginx \
--with-fpm-group=Nginx \
--enable-ftp \
--enable-opcache=no
make && make install
0 PHP-5.5.30]# ln -s /application/PHP-5.5.30/ /application/PHP
生成配置PHP配置文件
[root# pwd
/tools/PHP-30
[root# cp PHP.ini-production /application/PHP/lib/PHP.ini
[root# cd /application/PHP/etc/
[root0 etc]# pwd
/application/PHP/etc
[root# cp PHP-fpm.conf.default PHP-fpm.conf
PHP启动测试
[root# /application/PHP/sbin/PHP-fpm
验证是否成功启动
[root# netstat -lntup|grep PHP-fpm

验证LNMP安装是否成功。

Zabbix安装:

0 ~]# wget http://110.96.193.9:81/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Development/3.0.0alpha4/zabbix-3.0.0alpha4.tar.gz
# tar xf zabbix-3.0.0alpha4.tar.gz
[root# groupadd zabbix
[root# useradd -g zabbix zabbix
[root# ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2 #添加软连接
[root# /sbin/ldconfig #使配置立即生效
[root# cd zabbix-3.0.0alpha4
[root@oldboy zabbix-3.0.0alpha4]# ./configure --enable-server --enable-agent --with-MysqL --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
参数说明
―prefix=/usr/local/zabbix为指定安装目录为/usr/local/zabbix
―enable-server为安装zabbix服务端程序
―enable-agent为安装agent程序
―with-MysqL为使用MysqL数据库
―enable-ipv6为启用ipv6支持
―with-net-snmp为启用snmp支持
―with-libcurl为启用curl
―with-libxml2编译xml模块,主要用于监控vm虚拟机
[root# make && make install 

shell> MysqL -uroot -p<password>
MysqL> create database zabbix character set utf8 collate utf8_bin;
MysqL> grant all privileges on zabbix.* to zabbix@localhost identified by @H_578_301@'<password>';
MysqL> flush privileges;
MysqL> quit;
按照sql语句顺序导入sql:
shell> MysqL -uzabbix -p<password> zabbix < database/MysqL/schema.sql
# stop here if you are creating database for Zabbix proxy
shell> MysqL -uzabbix -p<password> zabbix < database/MysqL/images.sql
shell> MysqL -uzabbix -p<password> zabbix < database/MysqL/data.sql

修改zabbix.conf:

# vim /usr/local/etc/zabbix_server.conf 
增加:DBPassword=zabbix
DBName=zabbix #数据库名称 
DBUser=zabbix #数据库用户名 
DBPassword=jiayuan.com #数据库密码 
ListenIP=localhost #数据库ip地址 
AlertScriptsPath=****/zabbix/alertscripts #zabbix运行脚本存放目录

zabbix 3.0启动方式:

# cp /application/tools/zabbix-3.0.0alpha4/misc/init.d/fedora/core/zabbix_server /etc/rc.d/init.d/zabbix_server #服务端 
[root# cp /application/tools/zabbix-3.0.0alpha4/misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/zabbix_agentd #客户端
shell> zabbix_server

修改PHP.ini:(PHP5.5默认值较小)

vim /application/PHP/lib/PHP.ini 主要为下面几个参数
PHP option post_max_size 16M
PHP option max_execution_time 300
PHP option max_input_time 300
PHP time zone Asia/Shanghai

然后启动PHP

/application/PHP/sbin/PHP-fpm

配置web环境:

cd /application/tools/zabbix-3.0.0alpha4/frontends
cp -rf PHP /application/Nginx/html/zabbix

这里修不修改端口都可,如果编译PHP时你没有带上--with-MysqLi=MysqLnd你会悲剧的发现这里默认出现的是sqlite3,且无法更换。。。

需要给此目录下/application/Nginx/html/zabbix/conf的zabbix.conf.PHP w+x权限,否则install之前会报错需要下载conf,且赋权。

安装至此完毕。界面如下(是比以前好看了。。):

中文支持

zabbix实际是有中文语言的,我们可以通过修改web端源文件来开启中文语言。

修改你的locales.inc.PHP 这个文件

@H_578_301@'zh_CN' => [@H_578_301@'name' => _(@H_578_301@'Chinese (zh_CN)'),@H_578_301@'display' => true],#也就是把false改为true

然后点击zabbix监控网页端右上角人头头像修改中文语言即可。

更换语言后,图形会出现乱码,我们做如下修改即可。

修改你的defines.inc.PHP 这个文件

#修改第93行
define(@H_578_301@'ZBX_FONT_NAME',68)">'msyh'); 
#修改第45行改为 
define(@H_578_301@'ZBX_GRAPH_FONT_NAME',68)">'msyh')

然后下载微软雅黑字体,改名为msyh传入/home/www/zabbix/fonts 目录下即可。

转载于http://www.tuicool.com/articles/JRVVniM

猜你在找的CentOS相关文章