1. 最小安裝CentOS7
2. 開啓網卡
sed -i "s/ONBOOT=no/ONBOOT=yes/" /etc/sysconfig/network-scripts/ifcfg-ens33
3. 重啓網絡服務
systemctl restart network
4. 安裝vim
yum -y install vim
5. 安裝epel倉庫
yum -y install epel-release
6. 更新系統
yum -y update
[root@test ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
7. 設置主機名
echo "test.zeng.com" > /etc/hostname
8. 關閉SELINUX
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/sysconfig/selinux
9. 關閉firewalld(僅測試環境)
systemctl stop firewalld
systtemctl disable firewalld
10. 重啓系統
reboot
11. yum -y install wget
12. 下載與安裝zabbix和mysql倉庫
wget http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum localinstall zabbix-release-3.4-2.el7.noarch.rpm
yum localinstall mysql57-community-release-el7-11.noarch.rpm
13. 安裝LAMP
yum -y install php mysql-server
14. 啓動mysqld服務
systemctl start mysqld; systemctl enable mysqld
15. 找到mysql默認root密碼
grep password /var/log/mysqld.log
16. mysql安全初始化
mysql_secure_installation
17. 安裝Zabbix
yum -y install zabbix-server-mysql zabbix-web-mysql
18. 導入zabbix數據庫
cd /usr/share/doc/zabbix-server-mysql-3.4.1/
gzip -d create.sql.gz
mysql -u root -p
create database zabbix character set utf8 collate utf8_bin; # 創建zabbix數據庫
grant all privileges on zabbix.* to zabbix@localhost identified by 'redhat' with grant option; # 賦權限
use zabbix;
source create.sql; # 導數據
flush privileges; exit;
19. 設置php時區
vim /etc/php.ini
date.timezone = Asia/Shanghai
20. 啓動httpd服務
systemctl start httpd; systemctl enable httpd
21. 修改zabbix_server配置文件
vim /etc/zabbix/zabbix_server.conf
DBPassword=redhat # 只需取消此行註釋,並輸入zabbix數據庫密碼
22. 啓動zabbix服務
systemctl start zabbix-server; systemctl enable zabbix-server
23. 查看監聽端口
netstat -antupl
24. 將頁面語言設置爲中文後,圖形顯示會有亂碼,此時需爲zabbix web更換中文字體。
25. 找到字體存放目錄
find / -name fonts
cd /usr/share/zabbix/fonts
26. 在C:\Windows\Fonts目錄下找到喜歡的字體,如微軟雅黑(簡體中文),拷貝到 /usr/share/zabbix/fonts
27. 重命名字體
cp graphfont.ttf graphfont.ttf.bak
cp MSYHBD.TTC graphfont.ttf
28. 重啓zabbix服務
systemctl restart zabbix-server
29. 訪問zabbix web
http://127.0.0.1/zabbix
默認用戶名: Admin
默認密碼: zabbix