yum安装zabbix,ngixn,mysql,源码安装php,并不是有特别的效果,而是zabbix源码安装失败了。。。
1.安装zabbix的repo 2.yum 安装
3.yum安装mariadb mariadb-server 4.创库zabbix,赋权给zabbix用户 5.将zabbix文件的库导入mysql中
6.修改zabbix_server.conf配置文件 7.启动开机自启zabbix_server.service
8.yum安装nginx 9.修改nginx.conf配置文件,用nginx -t检查,如果代码没问题,检查80端口有没有被占用 10.启动开机自启nginx.service 11.给于/etc/zabbix/web属主属组nginx 11..检查zabbix端口,php-fpm服务
12.页面访问:http://IP/index.php 13.页面安装zabbix 14.以上有几个点值得注意!!! ======推荐mysql5.7版本,不要使用mysql8.0,不是别的,实在以笔者的水平驾驭不了 ======php源码安装之前也有写,这里就不重复了,细心就好, ======编译安装和yum安装都做过一般会有两个配置文件,需要看程序是运行的哪一个 15.安装代码 rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent yum -y install mariadb mariadb-server
vim /etc/my.cnf skip-grant-tables wq systemctl restart mariadb.service systemctl enable mariadb.service mysql_secure_installation mysql -uroot -plixiang45.bbyA!
create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@'localhost' identified by 'lixiang45.bbyA!'; grant all privileges on zabbix.* to zabbix@'%' identified by 'lixiang45.bbyA!'; grant all privileges on zabbix.* to zabbix@'127.0.0.1' identified by 'lixiang45.bbyA!'' flush privileges; cd /usr/share/doc/zabbix-server-mysql-3.2.11/ zcat create.sql.gz | mysql -uzabbix -plixiang45.bbyA! zabbix
vim /etc/zabbix/zabbix_server.conf DBHost=10.18.42.163 DBName=zabbix DBUser=zabbix DBPassword=password wq systemctl restart zabbix-server.service systemctl enable zabbix-server.service vim /etc/nginx/nginx.conf location / { root /usr/share/zabbix; }
location ~ "\.php$" {
fastcgi_pass 10.18.42.163:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/zabbix/$ fastcgi_script_name;
include fastcgi_params;
}
wq nginx -t systemctl status httpd systemctl stop httpd systemctl disable httpd systemctl start nginx systemctl enable nginx
lsof -i:9000 systemctl status zabbix-server.service ll /etc/zabbix/web/ chown -R nginx.nginx /etc/zabbix/web
vim /etc/php.ini systemctl restart php-fpm.service vim /usr/local/php/lib/php.ini systemctl restart php-fpm.service systemctl status zabbix-server.service