LINUX :Centos 5.6
Mysql :5.7
zabbix-2.4.8
php-5.6.23
apache ??
#zabbix下载地址
https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/
http://www.zabbix.com/download.php
#php下载地址
http://php.net/downloads.php
#当前 zabbix-2.4.8.tar.gz 下载
https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.4.8/zabbix-2.4.8.tar.gz/download
#当前 php-5.6.23 下载
http://cn2.php.net/get/php-5.6.23.tar.gz/from/this/mirror
#安装相关
yum -y install net-snmp net-snmp-devel curl curl-devel perl-DBI
#安装Apache
yum -y install httpd
#mysql 已经安装
#安装php
#rpm -ivh php-mbstring-5.3.3-26.el6.x86_64.rpm php-bcmath-5.3.3-26.el6.x86_64.rpm --force --nodep
yum -y install php php-mysql php-common php-gd php-odbc php-pear php-xml php-bcmath php-mbstring
#启动Apache
/etc/init.d/httpd start
#浏览器输入服务器地址测试是否正确安装Apache,此时可打开《Apache 2 Test Page》
http://10.18.192.147/
#添加文件info.php
vi /var/www/html/info.php
#浏览器输入网址看PHP是否安装成功,此时可打开《Apache 2 Test Page》
http://10.18.192.147/info.php
#设置自启动:
chkconfig httpd on
chkconfig mysqld on
#修改php配置文件# vi /etc/php.ini
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
----------------- 安装配置 zabbix -------------------
#mysql中创建zabbix所需的数据库及用户权限
create database zabbix character set utf8;
grant all privileges on zabbix.* to zabbix@'%' identified by 'zabbix';
flush privileges;
#解压安装zabbix
tar xvf zabbix-2.4.8.tar.gz
cd zabbix-2.4.8
./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl
make && make install
#导入zabbix结构和数据
cd database
mysql -u zabbix -p zabbix < ./database/mysql/schema.sql
mysql -u zabbix -p zabbix < ./database/mysql/images.sql
mysql -u zabbix -p zabbix < ./database/mysql/data.sql
#或者使用完整路径执行
/usr/local/mysql/bin/mysql -u zabbix -p zabbix < /home/zdtest/zabbix-2.4.8/database/mysql/schema.sql
/usr/local/mysql/bin/mysql -u zabbix -p zabbix < /home/zdtest/zabbix-2.4.8/database/mysql/images.sql
/usr/local/mysql/bin/mysql -u zabbix -p zabbix < /home/zdtest/zabbix-2.4.8/database/mysql/data.sql
#查看服务端口是否添加,没有可添加
cat /etc/services | grep zabbix
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
zabbix-trapper 10051/udp # Zabbix Trapper
#拷贝PHP网页文件到Apache中
cp -r /home/zdtest/zabbix-2.4.8/frontends/php/ /var/www/html/zabbix
#添加配置文件
cp -r /home/zdtest/zabbix-2.4.8/misc/init.d/fedora/core/* /etc/init.d/
chmod 755 /etc/init.d/zabbix_*
#编辑启动文件: vi /etc/init.d/zabbix_server
BASEDIR=/usr/local/zabbix
#编辑启动文件: vi /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix
#编辑配置文件: vi /usr/local/zabbix/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBPort=3306
#编辑配置文件:vi /usr/local/zabbix/etc/zabbix_agentd.conf
Server=127.0.0.1,10.18.192.147
ServerActive=127.0.0.1,10.18.192.147:10051
Hostname=Zabbix_server
UnsafeUserParameters=1
#编辑配置文件:vi /usr/local/zabbix/etc/zabbix_agent.conf
Server=127.0.0.1,10.18.192.147
UnsafeUserParameters=1
#启动zabbix服务
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start