環境準備
VMware Workstation Pro 15.0 版本
記憶體 4G
處理器 2G
硬碟 50G
網路配接器 NAT
清空 /etc/yum.repos.d/ 下面的所有檔案,并下載阿里云的centos7鏡像
rm -rf /etc/yum.repos.d/*
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
查看 /etc/yum.repos.d/ 下面的檔案,源檔案已經下載完成
[root@localhost ~]# ll /etc/yum.repos.d/
總用量 4
-rw-r--r--. 1 root root 2523 12月 26 19:31 CentOS-Base.repo
清空快取,生成快取
yum clean all
yum makecache
下載httpd,關閉防火墻并開啟httpd服務
systemctl stop firewalld
systemctl disable firewalld
systemctl enable httpd
systemctl start httpd
安裝MySQL
yum install -y mariadb mariadb-server
systemctl enable mariadb
systemctl start mariadb
安裝php環境
yum install -y php php-mysql
下載安裝包
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
安裝zabbix的包
yum install -y zabbix-server-mysql zabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender
創建一個zabbix庫并設定為utf8的字符編碼格式如圖

創建賬戶并且授權設定密碼,重繪并退出如圖

切換到此目錄下并查看檔案
[root@localhost ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.15/
[root@localhost zabbix-server-mysql-3.4.15]# ls
AUTHORS ChangeLog COPYING create.sql.gz NEWS README
進行解壓
[root@localhost zabbix-server-mysql-3.4.15]# gunzip create.sql.gz
[root@localhost zabbix-server-mysql-3.4.15]# ls
AUTHORS ChangeLog COPYING create.sql NEWS README
使用zabbix表對表進行匯入
mysql
user zabbix;
source create.sql;
配置zabbix server組態檔
組態檔目錄
[root@localhost zabbix-server-mysql-3.4.15]# cd /etc/zabbix
[root@localhost zabbix]# vi zabbix_server.conf
對zabbix_server.conf進行配置
set nu 顯示行數
91 DBHost=localhost
100 DBName=zabbix
116 DBUser=zabbix
125 DBPassword=zabbix
131 DBSocket=/var/lib/mysql/mysql.sock
運行zabbix-server服務,開機自啟zabbix-server服務如圖
[root@localhost zabbix]# systemctl start zabbix-server.service
[root@localhost zabbix]# systemctl enable zabbix-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
進入 /etc/httpd/conf.d/zabbix.conf 配置時間如圖

配置資料庫密碼
使用mysql_secure_installation,相關操作如下:
[root@localhost ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, 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 MySQL
root user without the proper authorisation.
Set root password? [Y/n] #是否設定root用戶密碼,輸入y并回車或直接回車
New password: #設定root用戶的密碼
Re-enter new password: #再輸入一次你設定的密碼
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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] #是否洗掉匿名用戶,生產環境建議洗掉,所以直接回車
… 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] #是否禁止root遠程登錄,根據自己的需求選擇Y/n并回車,建議禁止
… Success!
By default, MySQL 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] #是否洗掉test資料庫,直接回車
- 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] #是否重新加載權限表,直接回車
… Success!
Cleaning up…
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
重啟httpd服務
systemctl restart httpd
查看 本機IP

登陸zabbix網址:http://IP地址/zabbix
所以我們登錄 http://192.168.20.138/zabbix 登陸成功

點擊 Next step

點擊下一步

點擊下一步

后面一直點下一步
登陸賬戶是Admin
密碼是zabbix

安裝完成

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/258692.html
標籤:其他
上一篇:并發級別:阻塞、無障礙、無鎖、無等待-----區別與聯系
下一篇:計算機組裝筆記
