环境准备:web环境(apache,php,mysql)
三个都使用yum来安装
准备yum源,使用阿里的源(新浪源安装apache的时候有问题)
[[email protected]_master yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
安装php,apache,mysql
[[email protected]_master yum.repos.d]# yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml [[email protected]_master yum.repos.d]# yum install mysql-server mysql
web环境已准备
设置mysql密码,并创建zabbix数据库
[[email protected]_master ~]# mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. mysql> set password for ‘root‘@‘localhost‘=password(‘123456‘); Query OK, 0 rows affected (0.00 sec) mysql> create database zabbix character set utf8; Query OK, 1 row affected (0.00 sec)
使用yum安装zabbix
先获取第三方源
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
开始安装
[[email protected]_master yum.repos.d]# yum install zabbix-server-mysql zabbix-web-mysql
查看其安装后的路径
[[email protected]_master create]# whereis zabbix zabbix: /etc/zabbix /usr/lib/zabbix /usr/share/zabbix
进入zabbix的数据库信息目录
[[email protected]_master create]# cd /usr/share/doc/zabbix-server-mysql-2.4.2/create [[email protected]_master create]# ll 总用量 2988 -rw-r--r--. 1 root root 972744 11月 10 19:25 data.sql -rw-r--r--. 1 root root 1978341 11月 5 16:01 images.sql -rw-r--r--. 1 root root 104816 11月 5 16:02 schema.sql
把zabbix数据库脚本导入到数据库中
要按以下顺序导入,否则会报错
[[email protected]_master create]# mysql -uroot -p123456 zabbix < schema.sql [[email protected]_master create]# mysql -uroot -p123456 zabbix < images.sql [[email protected]_master create]# mysql -uroot -p123456 zabbix < data.sql
修改zabbix配置文件信息
[[email protected]_master create]# cd /etc/zabbix/ [[email protected]_master zabbix]# ll 总用量 20 drwxr-x---. 2 apache apache 4096 12月 3 15:02 web -rw-r-----. 1 root zabbix 13184 11月 10 19:32 zabbix_server.conf [[email protected]_master zabbix]# cp zabbix_server.conf zabbix_server.conf.bak20141203 [[email protected]_master zabbix]# vim zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix
最后将zabbix站点添加到apache中(直接yum安装会直接自动添加zabbix配置文件)
启动服务
[[email protected]_master conf.d]# service httpd start 正在启动 httpd:httpd: apr_sockaddr_info_get() failed for puppet_master httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName [确定] [[email protected]_master conf.d]# service zabbix-server start Starting Zabbix server: [确定]
剩下的就从页面配置了
http://192.168.164.132/zabbix/setup.php
后续记录
修改php.ini文件中的
date.timezone = ‘Asia/Chongqing‘
否则页面安装提示没有time zone内容,并且要改为chongqing地区。
时间: 2024-10-13 17:14:42