一.安装mysql-5.6.21(通用二进制)
详见博客中的mysql安装
二、安装zabbix-2.4.2(源码包)
#useradd -r zabbix
#yum install -y libcurl libcurl-devel libxml2 libxml2-devel gcc gcc-c++ net-snmp-devel php* httpd
#tar xf zabbix-2.4.2
#cd zabbix-2.4.2
#./configure --prefix=/usr/local/zabbix-2.4.2 --enable-server --enable-agent --enable-java --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2
#make install
三、拷贝启动脚本
cp misc/init.d/fedora/core/zabbix_* /etc/init.d/
chmod 755 /etc/init.d/zabbix_*
sed -i"s/BASEDIR=/usr/local/BASEDIR=/usr/local/zabbix-2.4.2/g" /etc/init.d/zabbix_server
sed -i"s/BASEDIR=/usr/local/BASEDIR=/usr/local/zabbix-2.4.2/g" /etc/init.d/zabbix_agentd
echo"/usr/local/zabbix-2.4.2/sbin/zabbix_server" >> /etc/rc.local
echo"/usr/local/zabbix-2.4.2/sbin/zabbix_agentd" >> /etc/rc.local
chkconfig zabbix_server on
chkconfig zabbix_agentd on
service zabbix_server start
service zabbix_agentd start
四、导入数据
mysql -uzabbix -pzabbix zabbix <./database/mysql/schema.sql
mysql -uzabbix -pzabbix zabbix <./database/mysql/images.sql
mysql -uzabbix -pzabbix zabbix <./database/mysql/data.sql
五、修改PHP设置
sed -i "s/;date.timezone=/date.timezone = Asia\/Shanghai/g" /etc/php.ini
sed -i "s/max_execution_time =30/max_execution_time = 300/g" /etc/php.ini
sed -i "s/post_max_size =8M/post_max_size = 32M/g" /etc/php.ini
sed -i "s/max_input_time = 60/max_input_time= 300/g" /etc/php.ini
sed -i "s/memory_limit =128M/memory_limit = 128M/g" /etc/php.ini
六、拷贝网页文件到apache目录
mkdir -p /var/www/html/zabbix
cp -r /usr/local/zabbix-2.4.2/frontends/php/* /var/www/html/zabbix/
chown -R apache.apache/var/www/html/zabbix
七、配置zabbix_server.conf服务端文件
sed -i "s/#DBUser\=root/DBUser\=zabbix/g" /usr/local/zabbix/etc/zabbix_server.conf
sed -i "s/#DBPassword=/aDBPassword=zabbix\n" /usr/local/zabbix/etc/zabbix_server.conf
chkconfig mysqld on
chkconfig httpd on
service mysqld restart
service httpd restart
八、web配置
默认登录admin/zabbix