查看自己得數(shù)據(jù)庫版本
yum list installed | grep MySQL
----------------------------------------
Expected output:
mysql-libs.x86_64 5.1.73-5.el6_6 @anaconda-CentOS-201508042137.x86_64/6.7
----------------------------------------
站在用戶的角度思考問題,與客戶深入溝通,找到商丘網(wǎng)站設(shè)計與商丘網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:網(wǎng)站設(shè)計制作、網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、空間域名、網(wǎng)頁空間、企業(yè)郵箱。業(yè)務(wù)覆蓋商丘地區(qū)。
刪除自己得老版本數(shù)據(jù)庫
yum remove mysql*
添加新得數(shù)據(jù)庫下載
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
----------------------------------------
Expected output:
Retrieving http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
Preparing... ########################################### [100%]
1:mysql-community-release########################################### [100%]
----------------------------------------
安裝數(shù)據(jù)庫和vim編譯器
yum install mysql-server vim -y
配置my.cnf文件
vim /etc/my.cnf
[mysqld]
innodb_file_per_table
啟動數(shù)據(jù)庫
service mysqld start
修改數(shù)據(jù)庫默認(rèn)用戶密碼以及匿名登錄
mysql_secure_installation
Enter current password for root (enter for none):
Set root password? [Y/n]
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]
Normally you should answer “Yes” to all these questions.
添加zabbix數(shù)據(jù)庫
mysql -u root -p
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';
----------------------------------------
Expected output:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| zabbix |
+--------------------+
4 rows in set (0.00 sec)
----------------------------------------
配置web服務(wù)
rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
yum -y install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap wget ntpdate net-snmp*
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=-1
service httpd start
調(diào)整防火墻配置
iptables -I INPUT -p tcp -m multiport --destination-port 80,10050:10051 -j ACCEPT
service iptables save
配置NTP時間
ntpdate time.windows.com
---------------------------------------------------------------------------------------------------------------
((((以上配置如果沒有問題 輸入 ip a s 查看自己得地址。嘗試http登陸 會發(fā)現(xiàn)web服務(wù)得界面就基本表示OK了))))
----------------------------------------------------------------------------------------------------------------
開始zabbix的安裝
創(chuàng)建用戶
groupadd zabbix
useradd -g zabbix zabbix
創(chuàng)建下載文件夾(zabbix就丟這里面)
mkdir /home/zabbix/downloads
cd /home/zabbix/downloads
下載
wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.0/zabbix-3.2.0.tar.gz
解壓
tar -zxvf zabbix-3.2.0.tar.gz
進(jìn)入zabbix文件數(shù)據(jù)庫 (如有提示密碼就是zabbix用戶得密碼 ”zabbix“)
cd /home/zabbix/downloads/zabbix-3.2.0/database/mysql
mysql -u zabbix -p zabbix < schema.sql
mysql -u zabbix -p zabbix < p_w_picpaths.sql
mysql -u zabbix -p zabbix < data.sql
下載依賴包
yum install -y gcc mysql-community-devel libxml2-devel unixODBC-devel net-snmp-devel libcurl-devel libssh3-devel OpenIPMI-devel openssl-devel openldap-devel
cd ../..
編譯安裝
./configure --enable-server --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh3 --with-openipmi --with-openssl
make install
修改配置啟動文件
vim /usr/local/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
創(chuàng)建zabbix-web頁面文件夾
mkdir /var/www/html/zabbix
cd /home/zabbix/downloads/zabbix-3.2.0/frontends/php/
cp -a . /var/www/html/zabbix/
關(guān)閉selinux
setenforce 0
創(chuàng)建一個規(guī)則允許web服務(wù)器訪問前端文件
chcon -Rv --type=httpd_sys_content_t /var/www/html
運行Apache和zabbix訪問外網(wǎng)
setsebool -P httpd_can_network_connect=1
setsebool -P zabbix_can_network=1
設(shè)置Apache用戶web接口文件的所有者
chown -R apache:apache /var/www/html/zabbix
為zabbix web界面添加權(quán)限
chmod +x /var/www/html/zabbix/conf/
啟動腳本
cp /home/zabbix/downloads/zabbix-3.2.0/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server
chkconfig --add /etc/init.d/zabbix_server
啟用Zabbix服務(wù)器,Apache和MySQL服務(wù)啟動
chkconfig httpd on
chkconfig mysqld on
chkconfig zabbix_server on
全面啟動
service zabbix_server start