rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpmphp
安裝jdk
rpm -ivh (自行在網上下載rpm包)html
安裝php並修改相應參數
yum -y install php56w php56w-gd php56w-mysqlnd php56w-bcmath php56w-mbstring php56w-xml php56w-ldapjava
vim /etc/php.ini
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Asia/Shanghai
always_populate_raw_post_data = -1mysql
安裝apache
yum -y install httpdlinux
vim /etc/httpd/conf.d/zabbix.conf
<VirtualHost *:80>
DocumentRoot /var/www/html/zabbix
# ServerName www.weiyanxt.com
# ServerAlias weiyanxt.com
ErrorLog /var/www/html/logs/error_log
CustomLog /var/www/html/logs/access_log common
DirectoryIndex index.html index.html.var index.php
</VirtualHost>web
編譯安裝zabbix
groupadd zabbix
useradd -g zabbix zabbixsql
yum install -y gcc* libxml2-devel net-snmp* curl-devel unixODBC-devel libssh2-devel openldap openldap-devel OpenIPMI OpenIPMI-devel mysql-devel libevent-devel pcre*
cd /root/zabbix-3.4.15
chmod +x configure
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --enable-java --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl --prefix=/usr/local/zabbixapache
make installvim
mkdir /var/www/html/zabbix
mkdir /var/www/html/logs
cp -r zabbix-3.4.15/frontends/php/* /var/www/html/zabbixfrontend
chown -R apache:apache /var/www/html/zabbix/
chmod +x /var/www/html/zabbix/conf/
設置zabbix db帳戶
vim /usr/local/zabbix/etc/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
#ListenIP=192.168.40.135
cp zabbix-3.4.15/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server
cp zabbix-3.4.15/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd
安裝mysql
yum -y install mysql-server
service mysqld start
mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> use zabbix;
mysql> source /root/zabbix-3.4.15/database/mysql/schema.sql;
mysql> source /root/zabbix-3.4.15/database/mysql/images.sql;
mysql> source /root/zabbix-3.4.15/database/mysql/data.sql;
mysql> quit
service httpd start
啓動httpd遇到的報錯
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
解決:在/etc/httpd/conf/httpd.conf 中添加
ServerName localhost:80
chmod +x zabbix*
/etc/init.d/zabbix_server start
啓動報錯
Starting zabbix_server: /etc/init.d/functions: line 722: /usr/local/sbin/zabbix_server: No such file or directory
解決:編輯 /etc/init.d/zabbix_server 修改BASEDIR路徑爲 /usr/local/zabbix
chkconfig httpd on
chkconfig mysqld on
chkconfig --add /etc/init.d/zabbix_server
chkconfig zabbix_server on
打開ip網頁 進行zabbix安裝
原文地址:http://www.ttlsa.com/zabbix/install-zabbix-on-linux-5-ttlsa/