3.zabbix服务端web界面安装与配置
//修改/etc/php.ini的配置并重启php-fmp
[root@linuxidc ~]# sed -ri 's/(post_max_size =).*/\1 16M/g' /etc/php.ini
[root@linuxidc ~]# sed -ri 's/(max_execution_time =).*/\1 300/g' /etc/php.ini
[root@linuxidc ~]# sed -ri 's/(max_input_time =).*/\1 300/g' /etc/php.ini
[root@linuxidc ~]# sed -i '/;date.timezone/a date.timezone = Asia/Shanghai' /etc/php.ini
[root@linuxidc ~]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm done
[root@linuxidc ~]# cd /usr/src/zabbix-3.4.12
[root@linuxidc zabbix-3.4.12]# ls
[root@linuxidc zabbix-3.4.12]# mkdik /usr/local/apache/htdocs/zabbix
[root@linuxidc zabbix-3.4.12]# cp -a frontends/php/* /usr/local/apache/htdocs/zabbix/
[root@linuxidc zabbix-3.4.12]# chown -R apache.apache /usr/local/apache/htdocs/
//配置apache虚拟主机
//在配置文件的末尾加入下内容:
[root@linuxidc ~]# vim /etc/httpd24/httpd.conf
……
<VirtualHost *:80>
DocumentRoot "/usr/local/apache/htdocs/zabbix"
ServerName zabbix.linuxidc.com
ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/zabbix/$1
<Directory "/usr/local/apache/htdocs/zabbix">
Options none
AllowOverride none
Require all granted
</Directory>
</VirtualHost>
//设置zabbix/conf目录的权限,让zabbix有权限生成配置文件zabbix.conf.php
[root@linuxidc ~]# chmod 777 /usr/local/apache/htdocs/zabbix/conf
[root@linuxidc ~]# ll -d /usr/local/apache/htdocs/zabbix/conf
drwxrwxrwx. 2 apache apache 81 7月 30 19:41 /usr/local/apache/htdocs/zabbix/conf
//重启apache
[root@linuxidc ~]# apachectl -t
Syntax OK
[root@linuxidc ~]# apachectl stop
[root@linuxidc ~]# apachectl start
[root@linuxidc ~]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 *:10050 *:*
LISTEN 0 128 *:10051 *:*
LISTEN 0 128 127.0.0.1:9000 *:*
LISTEN 0 128 :::22 :::*
LISTEN 0 100 ::1:25 :::*
LISTEN 0 80 :::3306 :::*
7.安装zabbix web 界面 (验证)
~修改/etc/hosts 文件,添加域名与IP映射
Linux中详细搭建监控服务zabbix部署