标签:
系统:CentOS-6.8-x86_64
httpd:2.4.20
mysql:5.6.31
php:5.6.22
IP:10.0.0.4
[root@localhost src]# cd /usr/local/src/
[root@localhost src]# wget http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.3/zabbix-3.0.3.tar.gz
[root@localhost src]# tar -xvzf zabbix-3.0.3.tar.gz
[root@localhost src]# cd zabbix-3.0.3
[root@localhost zabbix-3.0.3]# cat /usr/local/apache/conf/httpd.conf|grep libphp5
LoadModule php5_module modules/libphp5.so
[root@localhost zabbix-3.0.3]# useradd -M -s /sbin/nologin zabbix
[root@localhost zabbix-3.0.3]#
./configure \ --prefix=/usr/local/zabbix/ \ --enable-server \ --enable-agent \ --with-mysql \ --enable-ipv6 \ --with-net-snmp \ --with-libcurl \ --with-libxml2 \ --with-iconv=/usr/local/libiconv[root@localhost zabbix-3.0.3]# make && make install
[root@localhost zabbix]# mysql -uroot -p12345678
#创建zabbix数据库和账号
mysql> create database zabbix;
mysql> grant all privileges on zabbix.* to ‘zabbix‘@‘localhost‘ identified by ‘zabbix‘;
mysql> flush privileges;
#导入数据库
mysql> use zabbix
mysql> source /usr/local/src/zabbix-3.0.3/database/mysql/schema.sql
mysql> source /usr/local/src/zabbix-3.0.3/database/mysql/images.sql
mysql> source /usr/local/src/zabbix-3.0.3/database/mysql/data.sql
mysql> quit;
[root@localhost etc]# vim /usr/local/zabbix/etc/zabbix_server.conf
LogFile=/var/log/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/data/mysql/mysql.sock
DBPort=3306
Timeout=4
LogSlowQueries=3000
AlertScriptsPath=/usr/local/zabbix/alertscripts
[root@localhost etc]# chown -R zabbix:zabbix /usr/local/zabbix/
[root@localhost etc]# cp /usr/local/src/zabbix-3.0.3/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server
[root@localhost etc]# cp /usr/local/src/zabbix-3.0.3/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd
[root@localhost etc]# vim /usr/local/php/etc/php.ini
#修改如下部分参数
post_max_size 16M
max_execution_time 300
max_input_time 300
date.timezone=Asia/Shanghai
[root@localhost etc]# service httpd restart
[root@localhost etc]# mkdir -pv /data/www/zabbix
[root@localhost etc]# chown -R root:daemon /data/www/zabbix/
[root@localhost etc]# chmod 775 -R /data/www/zabbix/
[root@localhost etc]# cp -R /usr/local/src/zabbix-3.0.3/frontends/php/* /data/www/zabbix/
[root@localhost conf]# vim httpd.conf
Include /usr/local/apache/conf/extra/zabbix.conf
[root@localhost conf]# vim /usr/local/apache/conf/extra/zabbix.conf
#增加如下内容
<VirtualHost *:80>
ServerAdmin admin@toor.com
DocumentRoot "/data/www/zabbix/"
ServerName zabbix.toor.com
ErrorLog "logs/zabbix.toor.com-error_log"
CustomLog "logs/zabbix.toor.com-access_log" common
</VirtualHost>
[root@localhost extra]# service httpd restart
标签:
原文地址:http://www.cnblogs.com/xelaris/p/5571427.html