2018.06.10 - zabbix的安装

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

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

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

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

2018.06.10 - zabbix的安装

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

2018.06.10 - zabbix的安装

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

查看当前系统环境 

2018.06.10 - zabbix的安装

安装LAMP环境

yum install epel-release

yum install mariadb mariadb-server php php-mysql httpd

2018.06.10 - zabbix的安装

查看环境版本:

2018.06.10 - zabbix的安装

2018.06.10 - zabbix的安装

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

2018.06.10 - zabbix的安装

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!

2018.06.10 - zabbix的安装

创建zabbix数据库及其用户

2018.06.10 - zabbix的安装

2018.06.10 - zabbix的安装

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

2018.06.10 - zabbix的安装

启动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.10 - zabbix的安装

2018.06.12

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

2018.06.10 - zabbix的安装

2018.06.10 - zabbix的安装