2018.06.10 - zabbix的安装

本文详细记录了从零开始搭建LAMP环境,并在此基础上安装配置Zabbix 3.5的过程。包括解决安装过程中遇到的问题,如数据库配置、防火墙设置等。

前面实际操作了 LAMP(mysql5.6,php5.6)的安装,基本安装运行都没什么问题。

于是今天开始在原来的环境上安装zabbix(3.5版本),结果运行失败。甚至系统都出现了问题,不能reboot、poweroff。

也可能是远程虚拟机的问题,也可能是我所安装的环境和zabbix所需求的环境不一致造成的。

不过不管了,直接将原来的虚拟机删除了,从头来过!!!


安装起来还是很快的,毕竟是最小化安装。配置下网卡,连上网络。


转到XSHELL操作了,先完成基本的升级---yum update。

查看当前系统环境 

安装LAMP环境

yum install epel-release

yum install mariadb mariadb-server php php-mysql httpd


查看环境版本:



初始化mysql数据库,并配置root用户密码


NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the currentpassword for the root user.  If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank,so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password: 
Re-enter new password: 

Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them.  This is intended only for testing, and to make the installation go a bit smoother.  You should remove them before moving into a production environment.
Remove anonymous users? [Y/n] y
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
 ... skipping.
By default, MariaDB comes with a database named 'test' that anyone can access.  This is also intended only for testing, and should be removed before moving into a production environment.
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reloading the privilege tables will ensure that all changes made so far will take effect immediately.
Reload privilege tables now? [Y/n] y
 ... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB installation should now be secure.
Thanks for using MariaDB!


创建zabbix数据库及其用户



测试刚刚创建的zabbix用户,是否可以连接mysql数据库


启动Apache服务

systemctl start httpd

netstat –tunl

firewall-cmd --zone=public --add-port=80/tcp –permanent

firewall-cmd --reload

安装zabbix的yum源(这里选择的是最新版本3.5)

rpm -ivh http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm

安装zabbix

yum install zabbix-server-mysql zabbix-web-mysql

数据库导入

zcat /usr/share/doc/zabbix-server-mysql-4.0.0/create.sql.gz | mysql -uzabbix -p zabbix

配置数据库用户及密码

vi /etc/zabbix/zabbix_server.conf

DBHost=localhost
DBName=zabbix
DBUser=zabbix

DBPassword=zabbix

SELinux配置(最终还是关闭了)

setsebool -P httpd_can_connect_zabbix on
setsebool -P httpd_can_network_connect_db on

编辑Zabbix前端PHP配置,更改时区
vim /etc/httpd/conf.d/zabbix.conf

php_value date.timezone Asia/Shanghai

重启Apache、zabbix服务

浏览器访问 http://10.50.8.230/zabbix,终于出现了这个页面了!


2018.06.12

基本设置了一下,使用正常。(报警很多....)






评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值