安装LAMP
echo 'export PATH=/usr/local/php/bin:/usr/local/mysql/bin:$PATH' >> /etc/profile

cd /usr/local/mysql/scripts

./mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/data --user=mysql

/usr/local/mysql/bin/mysqld_safe --user=mysql &
如果出错,查看出错信息,基本都是配置文件my.cnf的参数问题。

CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';



启动Apache
/usr/local/apache2/bin/apachectl start

添加zabbix用户
groupadd zabbix
useradd -g zabbix zabbix

开始安装zabbix
解压,cd zabbix-3.2.0,需要安装支持包yum install net-snmp*
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2  &&  make  && make install

编辑配置
vim  /usr/local/zabbix/etc/zabbix_server.conf

添加
DBPassword=zabbix

修改权限
chown zabbix.zabbix /usr/local/zabbix -R

导入数据库 cd 安装包/database/mysql/
  105  mysql -u zabbix -p zabbix < schema.sql
  106  mysql -u zabbix -p zabbix < p_w_picpaths.sql
  107  mysql -u zabbix -p zabbix < data.sql

关联Apache cd 安装包/frontends/php
cp -r * /usr/local/apache2/htdocs/






修改配置
vim /usr/local/apache2/conf/httpd.conf
ServerName 192.168.56.108:80
DocumentRoot "/usr/local/apache2/htdocs"
Include conf/extra/httpd-vhosts.conf

vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

    ServerAdmin [email protected]
    DocumentRoot "/usr/local/apache2/htdocs/"
    ServerName 192.168.56.108
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common


启动Apache
/usr/local/apache2/bin/apachectl restart
注意关闭iptable


启动zabbix
sudo -u zabbix /usr/local/zabbix/sbin/zabbix_server -c /usr/local/zabbix/etc/zabbix_server.conf -R
为什么要加sudo呢?因为系统不允许root启动

报错信息查看
less /tmp/zabbix_server.log

打开网页ip地址。。
缺少php模块,需要重新编译安装

根据不同的需要把插件安装上就好了