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
![46869d173da2660b7284d714af13df9a35228590](https://yqfile.alicdn.com/46869d173da2660b7284d714af13df9a35228590.jpeg?x-oss-process=image/resize,w_1400/format,webp)
![2e164122eea7b1d2733cb241052444d01048ba02](https://yqfile.alicdn.com/2e164122eea7b1d2733cb241052444d01048ba02.jpeg?x-oss-process=image/resize,w_1400/format,webp)
![a12d58f1e41c8b23dfe390af2e52a37b577360ff](https://yqfile.alicdn.com/a12d58f1e41c8b23dfe390af2e52a37b577360ff.jpeg?x-oss-process=image/resize,w_1400/format,webp)
![9dc51657d87c57c311445034e565f8326db99fdf](https://yqfile.alicdn.com/9dc51657d87c57c311445034e565f8326db99fdf.jpeg?x-oss-process=image/resize,w_1400/format,webp)
![93851e74f64771c25f7ecadea13cb1a46cb6a395](https://yqfile.alicdn.com/93851e74f64771c25f7ecadea13cb1a46cb6a395.jpeg?x-oss-process=image/resize,w_1400/format,webp)
![ab3f6feabe71935fc23a3e7c0a762c624cdaefd6](https://yqfile.alicdn.com/ab3f6feabe71935fc23a3e7c0a762c624cdaefd6.jpeg?x-oss-process=image/resize,w_1400/format,webp)
![6f92cee9bf937fb7ee836d0148ead549e95b23ac](https://yqfile.alicdn.com/6f92cee9bf937fb7ee836d0148ead549e95b23ac.jpeg?x-oss-process=image/resize,w_1400/format,webp)
![92981b708fb9e72a1148d7a60273e5bd037d91ad](https://yqfile.alicdn.com/92981b708fb9e72a1148d7a60273e5bd037d91ad.jpeg?x-oss-process=image/resize,w_1400/format,webp)
![b4e075d4dd730e028f8f13b0f35c79b57ababe97](https://yqfile.alicdn.com/b4e075d4dd730e028f8f13b0f35c79b57ababe97.jpeg?x-oss-process=image/resize,w_1400/format,webp)