centos7安装zabbix +lnmp

1 安装LNMP

wget http://soft.vpser.net/lnmp/lnmp1.6.tar.gz -cO lnmp1.6.tar.gz && tar zxf lnmp1.6.tar.gz && cd lnmp1.6 && ./install.sh lnmp

安装php 5.6+
mysql 5.7

  • 接下来zabbix也会安装自己的php nginx ,注意!
  • nginx的目录为 conf-path=/etc/nginx/nginx.conf
  • php-fpm的配置目录为 /etc/php.ini

记住你设置的mysql root密码

下载 zabbix

https://www.zabbix.com/download

安装软件源
Install Zabbix repository

rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm
 yum clean all

注意 国内的rpm使用不了,需要更替下面的文件内容

/etc/yum.repos.d/zabbix.repo

[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1

然后

 yum clean all

运行命令继续安装

yum install zabbix-server-mysql zabbix-agent -y
yum install epel-release -y
yum install zabbix-web-mysql zabbix-nginx-conf -y

添加数据库与用户

mysql -uroot -p
你的之前密码
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix的密码';
mysql> quit;

确定以上安装无错误后

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
@最后输入你的zabbix密码

配置文件 /etc/zabbix/zabbix_server.conf

DBPassword=password
DBHost=127.0.0.1
还有别的自己看吧 我懒得翻了
注意 注解取消掉

编辑/etc/nginx/conf.d/zabbix.conf,
取消掉注解,也请修改端口 免得nginx冲突

# listen 80;
# server_name example.com;

如果没错误了就可以启动了

systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm

如果上面不得 是沙雕centos的问题
那么久拆解输入

systemctl restart zabbix-server 
systemctl restart zabbix-agent 
systemctl restart nginx 
systemctl restart php-fpm
systemctl enable zabbix-server 
systemctl enable zabbix-agent 
systemctl enable nginx 
systemctl enable php-fpm

最后输入你刚才在nginx配置里面的地址,可以访问了

你可能感兴趣的:(虚拟化技术,centos)