------------------------------------------------------------------------------------------------------------------------------------
1 安装 epel源:
[root@moban ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
warning: /var/tmp/rpm-tmp.LJLYq3: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
--------------------------------------------------------------------------------------------------------------------------------------------------------------
2 安装PHP
[root@moban ~]# yum install php -y
The other application is: PackageKit
Memory : 189 M RSS (507 MB VSZ)
Started: Mon Sep 12 14:39:53 2016 - 07:59 ago
State : Sleeping, pid: 3059
Determining fastest mirrors
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* updates: mirrors.aliyun.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-48.el6_8 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-48.el6_8 for package: php-5.3.3-48.el6_8.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.3.3-48.el6_8 for package: php-5.3.3-48.el6_8.x86_64
--> Running transaction check
---> Package php-cli.x86_64 0:5.3.3-48.el6_8 will be installed
---> Package php-common.x86_64 0:5.3.3-48.el6_8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
php x86_64 5.3.3-48.el6_8 updates 1.1 M
Installing for dependencies:
php-cli x86_64 5.3.3-48.el6_8 updates 2.2 M
php-common x86_64 5.3.3-48.el6_8 updates 530 k
Transaction Summary
=====================================================================================================================================================================================================
Install 3 Package(s)
Total download size: 3.8 M
Installed size: 13 M
Downloading Packages:
(1/3): php-5.3.3-48.el6_8.x86_64.rpm | 1.1 MB 00:01
(2/3): php-cli-5.3.3-48.el6_8.x86_64.rpm | 2.2 MB 00:05
(3/3): php-common-5.3.3-48.el6_8.x86_64.rpm | 530 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 536 kB/s | 3.8 MB 00:07
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : php-common-5.3.3-48.el6_8.x86_64 1/3
Installing : php-cli-5.3.3-48.el6_8.x86_64 2/3
Installing : php-5.3.3-48.el6_8.x86_64 3/3
Verifying : php-common-5.3.3-48.el6_8.x86_64 1/3
Verifying : php-cli-5.3.3-48.el6_8.x86_64 2/3
Verifying : php-5.3.3-48.el6_8.x86_64 3/3
Installed:
php.x86_64 0:5.3.3-48.el6_8
Dependency Installed:
php-cli.x86_64 0:5.3.3-48.el6_8 php-common.x86_64 0:5.3.3-48.el6_8
Complete!
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.安装php5.6 源
[root@moban ~]# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Retrieving https://mirror.webtatic.com/yum/el6/latest.rpm
warning: /var/tmp/rpm-tmp.YDiEpt: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
Preparing... ########################################### [100%]
1:webtatic-release ########################################### [100%]
--------------------------------------------------------------------------------------------
4 安装yum replace 插件
[root@moban ~]# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Retrieving https://mirror.webtatic.com/yum/el6/latest.rpm
warning: /var/tmp/rpm-tmp.YDiEpt: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
Preparing... ########################################### [100%]
1:webtatic-release ########################################### [100%]
[root@moban ~]# yum install yum-plugin-replace –y
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* updates: mirrors.aliyun.com
* webtatic: sp.repo.webtatic.com
webtatic | 3.6 kB 00:00
webtatic/primary_db | 183 kB 00:09
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-replace.noarch 0:0.2.7-1.ius.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
yum-plugin-replace noarch 0.2.7-1.ius.el6 webtatic 17 k
Transaction Summary
=====================================================================================================================================================================================================
Install 1 Package(s)
Total download size: 17 k
Installed size: 35 k
Is this ok [y/N]: y
Downloading Packages:
yum-plugin-replace-0.2.7-1.ius.el6.noarch.rpm | 17 kB 00:00
warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy
Importing GPG key 0xCF4C4FF9:
Userid : Andy Thompson <andy@webtatic.com>
Package: webtatic-release-6-6.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : yum-plugin-replace-0.2.7-1.ius.el6.noarch 1/1
Verifying : yum-plugin-replace-0.2.7-1.ius.el6.noarch 1/1
Installed:
yum-plugin-replace.noarch 0:0.2.7-1.ius.el6
Complete!
-------------------------------------------------------------------------------------------------------------
5.更新php 为php-5.6版本
第一步
[root@zabbix-6 ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
有可能出现以下错误:error: skipping http://rpms.famillecollet.com/enterprise/remi-release-6.rpm - transfer failed
解决办法打开浏览器 下载 http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 下载remi-release-6.rpm 上传至服务器安装
[root@moban yum.repos.d]# rpm -ivh /root/remi-release-6.rpm
warning: /root/remi-release-6.rpm: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Preparing... ########################################### [100%]
1:remi-release ########################################### [100%]
第二部
[root@moban yum.repos.d]# yum --enablerepo=remi install php php-fpm -y
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* remi: mirror.innosol.asia
* remi-safe: mirror.innosol.asia
* updates: mirrors.aliyun.com
* webtatic: uk.repo.webtatic.com
remi | 2.9 kB 00:00
remi/primary_db | 1.6 MB 00:01
remi-safe | 2.9 kB 00:00
remi-safe/primary_db | 392 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-48.el6_8 will be updated
---> Package php.x86_64 0:5.4.45-11.el6.remi will be an update
--> Processing Dependency: php-common(x86-64) = 5.4.45-11.el6.remi for package: php-5.4.45-11.el6.remi.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.4.45-11.el6.remi for package: php-5.4.45-11.el6.remi.x86_64
---> Package php-fpm.x86_64 0:5.4.45-11.el6.remi will be installed
--> Running transaction check
---> Package php-cli.x86_64 0:5.3.3-48.el6_8 will be updated
---> Package php-cli.x86_64 0:5.4.45-11.el6.remi will be an update
---> Package php-common.x86_64 0:5.3.3-48.el6_8 will be updated
---> Package php-common.x86_64 0:5.4.45-11.el6.remi will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
php-fpm x86_64 5.4.45-11.el6.remi remi 1.4 M
Updating:
php x86_64 5.4.45-11.el6.remi remi 2.8 M
Updating for dependencies:
php-cli x86_64 5.4.45-11.el6.remi remi 4.1 M
php-common x86_64 5.4.45-11.el6.remi remi 968 k
Transaction Summary
=====================================================================================================================================================================================================
Install 1 Package(s)
Upgrade 3 Package(s)
Total download size: 9.3 M
Downloading Packages:
(1/4): php-5.4.45-11.el6.remi.x86_64.rpm | 2.8 MB 00:03
(2/4): php-cli-5.4.45-11.el6.remi.x86_64.rpm | 4.1 MB 00:07
(3/4): php-common-5.4.45-11.el6.remi.x86_64.rpm | 968 kB 00:00
(4/4): php-fpm-5.4.45-11.el6.remi.x86_64.rpm | 1.4 MB 00:01
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 717 kB/s | 9.3 MB 00:13
warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Importing GPG key 0x00F97F56:
Userid : Remi Collet <RPMS@FamilleCollet.com>
Package: remi-release-6.8-1.el6.remi.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Updating : php-common-5.4.45-11.el6.remi.x86_64 1/7
Updating : php-cli-5.4.45-11.el6.remi.x86_64 2/7
Updating : php-5.4.45-11.el6.remi.x86_64 3/7
Installing : php-fpm-5.4.45-11.el6.remi.x86_64 4/7
Cleanup : php-5.3.3-48.el6_8.x86_64 5/7
Cleanup : php-cli-5.3.3-48.el6_8.x86_64 6/7
Cleanup : php-common-5.3.3-48.el6_8.x86_64 7/7
Verifying : php-5.4.45-11.el6.remi.x86_64 1/7
Verifying : php-cli-5.4.45-11.el6.remi.x86_64 2/7
Verifying : php-fpm-5.4.45-11.el6.remi.x86_64 3/7
Verifying : php-common-5.4.45-11.el6.remi.x86_64 4/7
Verifying : php-5.3.3-48.el6_8.x86_64 5/7
Verifying : php-cli-5.3.3-48.el6_8.x86_64 6/7
Verifying : php-common-5.3.3-48.el6_8.x86_64 7/7
Installed:
php-fpm.x86_64 0:5.4.45-11.el6.remi
Updated:
php.x86_64 0:5.4.45-11.el6.remi
Dependency Updated:
php-cli.x86_64 0:5.4.45-11.el6.remi php-common.x86_64 0:5.4.45-11.el6.remi
Complete!
[root@moban yum.repos.d]# yum replace php-common --replace-with=php56w-common -y
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* remi-safe: mirror.innosol.asia
* updates: mirrors.aliyun.com
* webtatic: uk.repo.webtatic.com
Replacing packages takes time, please be patient...
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.4.45-11.el6.remi will be erased
---> Package php-cli.x86_64 0:5.4.45-11.el6.remi will be erased
---> Package php-common.x86_64 0:5.4.45-11.el6.remi will be erased
---> Package php-fpm.x86_64 0:5.4.45-11.el6.remi will be erased
---> Package php56w.x86_64 0:5.6.25-1.w6 will be installed
---> Package php56w-cli.x86_64 0:5.6.25-1.w6 will be installed
---> Package php56w-common.x86_64 0:5.6.25-1.w6 will be installed
---> Package php56w-fpm.x86_64 0:5.6.25-1.w6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
php56w x86_64 5.6.25-1.w6 webtatic 2.7 M
php56w-cli x86_64 5.6.25-1.w6 webtatic 2.6 M
php56w-common x86_64 5.6.25-1.w6 webtatic 1.2 M
php56w-fpm x86_64 5.6.25-1.w6 webtatic 1.3 M
Removing:
php x86_64 5.4.45-11.el6.remi @remi 9.4 M
php-cli x86_64 5.4.45-11.el6.remi @remi 12 M
php-common x86_64 5.4.45-11.el6.remi @remi 7.0 M
php-fpm x86_64 5.4.45-11.el6.remi @remi 4.1 M
Transaction Summary
=====================================================================================================================================================================================================
Install 4 Package(s)
Remove 4 Package(s)
Total download size: 7.9 M
Downloading Packages:
(1/4): php56w-5.6.25-1.w6.x86_64.rpm | 2.7 MB 02:39
(2/4): php56w-cli-5.6.25-1.w6.x86_64.rpm | 2.6 MB 01:00
(3/4): php56w-common-5.6.25-1.w6.x86_64.rpm | 1.2 MB 00:18
(4/4): php56w-fpm-5.6.25-1.w6.x86_64.rpm | 1.3 MB 00:24
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 30 kB/s | 7.9 MB 04:27
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php56w-common-5.6.25-1.w6.x86_64 1/8
Installing : php56w-cli-5.6.25-1.w6.x86_64 2/8
Installing : php56w-5.6.25-1.w6.x86_64 3/8
Installing : php56w-fpm-5.6.25-1.w6.x86_64 4/8
Erasing : php-5.4.45-11.el6.remi.x86_64 5/8
Erasing : php-cli-5.4.45-11.el6.remi.x86_64 6/8
Erasing : php-fpm-5.4.45-11.el6.remi.x86_64 7/8
Erasing : php-common-5.4.45-11.el6.remi.x86_64 8/8
Verifying : php56w-cli-5.6.25-1.w6.x86_64 1/8
Verifying : php56w-fpm-5.6.25-1.w6.x86_64 2/8
Verifying : php56w-common-5.6.25-1.w6.x86_64 3/8
Verifying : php56w-5.6.25-1.w6.x86_64 4/8
Verifying : php-5.4.45-11.el6.remi.x86_64 5/8
Verifying : php-cli-5.4.45-11.el6.remi.x86_64 6/8
Verifying : php-fpm-5.4.45-11.el6.remi.x86_64 7/8
Verifying : php-common-5.4.45-11.el6.remi.x86_64 8/8
Removed:
php.x86_64 0:5.4.45-11.el6.remi php-cli.x86_64 0:5.4.45-11.el6.remi php-common.x86_64 0:5.4.45-11.el6.remi php-fpm.x86_64 0:5.4.45-11.el6.remi
Installed:
php56w.x86_64 0:5.6.25-1.w6 php56w-cli.x86_64 0:5.6.25-1.w6 php56w-common.x86_64 0:5.6.25-1.w6 php56w-fpm.x86_64 0:5.6.25-1.w6
Complete!
第四部 检查下php的版本
[root@moban yum.repos.d]# php -v
PHP 5.6.25 (cli) (built: Aug 20 2016 09:39:48)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
[root@moban yum.repos.d]# php-fpm -v
PHP 5.6.25 (fpm-fcgi) (built: Aug 20 2016 09:42:47)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
第五步 修改php.ini
sed -i 's/;always_populate_raw_post_data = -1/always_populate_raw_post_data = -1/g' /etc/php.ini
第六步 安装libcurl,这里需要注意下,设置dns 为8.8.8.8,修改/etc/resolv.conf. 不然安装会找不到服务器。
安装city-fan.org-release-1-13.rhel6.noarch.rpm
[root@moban yum.repos.d]# rpm -ivh http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-1-13.rhel6.noarch.rpm
Retrieving http://mirror.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-1-13.rhel6.noarch.rpm
warning: /var/tmp/rpm-tmp.A3nhVC: Header V3 DSA/SHA1 Signature, key ID b56a8bac: NOKEY
Preparing... ########################################### [100%]
1:city-fan.org-release ########################################### [100%]
安装libcurl
[root@moban yum.repos.d]# yum install libcurl -y
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* city-fan.org: www.city-fan.org
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* remi-safe: mirror.innosol.asia
* updates: mirrors.aliyun.com
* webtatic: uk.repo.webtatic.com
city-fan.org | 2.9 kB 00:00
city-fan.org/primary_db | 447 kB 00:02
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libcurl.x86_64 0:7.19.7-37.el6_4 will be updated
--> Processing Dependency: libcurl = 7.19.7-37.el6_4 for package: curl-7.19.7-37.el6_4.x86_64
---> Package libcurl.x86_64 0:7.50.2-1.0.cf.rhel6 will be an update
--> Processing Dependency: libssh2(x86-64) >= 1.7.0 for package: libcurl-7.50.2-1.0.cf.rhel6.x86_64
--> Processing Dependency: c-ares(x86-64) >= 1.11.0 for package: libcurl-7.50.2-1.0.cf.rhel6.x86_64
--> Processing Dependency: libnghttp2.so.14()(64bit) for package: libcurl-7.50.2-1.0.cf.rhel6.x86_64
--> Processing Dependency: libcares.so.2()(64bit) for package: libcurl-7.50.2-1.0.cf.rhel6.x86_64
--> Running transaction check
---> Package c-ares.x86_64 0:1.11.0-1.0.cf.rhel6 will be installed
---> Package curl.x86_64 0:7.19.7-37.el6_4 will be updated
---> Package curl.x86_64 0:7.50.2-1.0.cf.rhel6 will be an update
--> Processing Dependency: libmetalink.so.3()(64bit) for package: curl-7.50.2-1.0.cf.rhel6.x86_64
---> Package libnghttp2.x86_64 0:1.6.0-1.el6.1 will be installed
---> Package libssh2.x86_64 0:1.4.2-1.el6 will be updated
---> Package libssh2.x86_64 0:1.7.0-5.0.cf.rhel6 will be an update
--> Running transaction check
---> Package libmetalink.x86_64 0:0.1.2-9.rhel6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Updating:
libcurl x86_64 7.50.2-1.0.cf.rhel6 city-fan.org 366 k
Installing for dependencies:
c-ares x86_64 1.11.0-1.0.cf.rhel6 city-fan.org 90 k
libmetalink x86_64 0.1.2-9.rhel6 city-fan.org 23 k
libnghttp2 x86_64 1.6.0-1.el6.1 epel 56 k
Updating for dependencies:
curl x86_64 7.50.2-1.0.cf.rhel6 city-fan.org 419 k
libssh2 x86_64 1.7.0-5.0.cf.rhel6 city-fan.org 98 k
Transaction Summary
=====================================================================================================================================================================================================
Install 3 Package(s)
Upgrade 3 Package(s)
Total download size: 1.0 M
Downloading Packages:
(1/6): c-ares-1.11.0-1.0.cf.rhel6.x86_64.rpm | 90 kB 00:00
(2/6): curl-7.50.2-1.0.cf.rhel6.x86_64.rpm | 419 kB 00:01
(3/6): libcurl-7.50.2-1.0.cf.rhel6.x86_64.rpm | 366 kB 00:00
(4/6): libmetalink-0.1.2-9.rhel6.x86_64.rpm | 23 kB 00:00
(5/6): libnghttp2-1.6.0-1.el6.1.x86_64.rpm | 56 kB 00:00
(6/6): libssh2-1.7.0-5.0.cf.rhel6.x86_64.rpm | 98 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 258 kB/s | 1.0 MB 00:04
warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID b56a8bac: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org
Importing GPG key 0xB56A8BAC:
Userid : city-fan.org software librarian <software@city-fan.org>
Package: city-fan.org-release-1-13.rhel6.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) <epel@fedoraproject.org>
Package: epel-release-6-8.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : libmetalink-0.1.2-9.rhel6.x86_64 1/9
Installing : libnghttp2-1.6.0-1.el6.1.x86_64 2/9
Installing : c-ares-1.11.0-1.0.cf.rhel6.x86_64 3/9
Updating : libssh2-1.7.0-5.0.cf.rhel6.x86_64 4/9
Updating : libcurl-7.50.2-1.0.cf.rhel6.x86_64 5/9
Updating : curl-7.50.2-1.0.cf.rhel6.x86_64 6/9
Cleanup : curl-7.19.7-37.el6_4.x86_64 7/9
Cleanup : libcurl-7.19.7-37.el6_4.x86_64 8/9
Cleanup : libssh2-1.4.2-1.el6.x86_64 9/9
Verifying : libssh2-1.7.0-5.0.cf.rhel6.x86_64 1/9
Verifying : c-ares-1.11.0-1.0.cf.rhel6.x86_64 2/9
Verifying : libnghttp2-1.6.0-1.el6.1.x86_64 3/9
Verifying : libmetalink-0.1.2-9.rhel6.x86_64 4/9
Verifying : libcurl-7.50.2-1.0.cf.rhel6.x86_64 5/9
Verifying : curl-7.50.2-1.0.cf.rhel6.x86_64 6/9
Verifying : libssh2-1.4.2-1.el6.x86_64 7/9
Verifying : curl-7.19.7-37.el6_4.x86_64 8/9
Verifying : libcurl-7.19.7-37.el6_4.x86_64 9/9
Dependency Installed:
c-ares.x86_64 0:1.11.0-1.0.cf.rhel6 libmetalink.x86_64 0:0.1.2-9.rhel6 libnghttp2.x86_64 0:1.6.0-1.el6.1
Updated:
libcurl.x86_64 0:7.50.2-1.0.cf.rhel6
Dependency Updated:
curl.x86_64 0:7.50.2-1.0.cf.rhel6 libssh2.x86_64 0:1.7.0-5.0.cf.rhel6
Complete!
卸载 city-fan.org-release 到此 php安装完成
rpm -e city-fan.org-release
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
6 安装mysql,本次使用yum直接网络安装,也可以使用mysql rpm安装。(rpm安装参考之前mysql 安装文档)
安装 mysql-community-release-el6-5.noarch.rpm
[root@moban ~]# rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
Preparing... ########################################### [100%]
1:mysql-community-release########################################### [100%]
安装mysql
[root@moban ~]# yum install mysql-server -y
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* remi-safe: mirror.innosol.asia
* updates: mirrors.aliyun.com
* webtatic: uk.repo.webtatic.com
mysql-connectors-community | 2.5 kB 00:00
mysql-connectors-community/primary_db | 9.9 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql-tools-community/primary_db | 31 kB 00:01
mysql56-community | 2.5 kB 00:00
mysql56-community/primary_db | 159 kB 00:02
Setting up Install Process
Package mysql-server is obsoleted by mysql-community-server, trying to install mysql-community-server-5.6.33-2.el6.x86_64 instead
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.33-2.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.33-2.el6 for package: mysql-community-server-5.6.33-2.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.33-2.el6.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.33-2.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.33-2.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.33-2.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.6.33-2.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.33-2.el6 will be obsoleting
---> Package mysql-libs.x86_64 0:5.1.71-1.el6 will be obsoleted
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.6.33-2.el6 will be obsoleting
---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be updated
---> Package postfix.x86_64 2:2.6.6-6.el6_7.1 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
mysql-community-libs x86_64 5.6.33-2.el6 mysql56-community 1.9 M
replacing mysql-libs.x86_64 5.1.71-1.el6
mysql-community-libs-compat x86_64 5.6.33-2.el6 mysql56-community 1.6 M
replacing mysql-libs.x86_64 5.1.71-1.el6
mysql-community-server x86_64 5.6.33-2.el6 mysql56-community 54 M
Installing for dependencies:
mysql-community-client x86_64 5.6.33-2.el6 mysql56-community 18 M
mysql-community-common x86_64 5.6.33-2.el6 mysql56-community 308 k
perl-DBI x86_64 1.609-4.el6 base 705 k
Updating for dependencies:
postfix x86_64 2:2.6.6-6.el6_7.1 base 2.0 M
Transaction Summary
=====================================================================================================================================================================================================
Install 6 Package(s)
Upgrade 1 Package(s)
Total download size: 79 M
Downloading Packages:
(1/7): mysql-community-client-5.6.33-2.el6.x86_64.rpm | 18 MB 18:55
(2/7): mysql-community-common-5.6.33-2.el6.x86_64.rpm | 308 kB 00:18
(3/7): mysql-community-libs-5.6.33-2.el6.x86_64.rpm | 1.9 MB 01:30
(4/7): mysql-community-libs-compat-5.6.33-2.el6.x86_64.rpm | 1.6 MB 02:10
(5/7): mysql-community-server-5.6.33-2.el6.x86_64.rpm | 54 MB 42:03
(6/7): perl-DBI-1.609-4.el6.x86_64.rpm | 705 kB 00:03
(7/7): postfix-2.6.6-6.el6_7.1.x86_64.rpm | 2.0 MB 00:14
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 21 kB/s | 79 MB 65:19
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>
Package: mysql-community-release-el6-5.noarch (installed)
From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.6.33-2.el6.x86_64 1/9
Installing : mysql-community-libs-5.6.33-2.el6.x86_64 2/9
Installing : mysql-community-client-5.6.33-2.el6.x86_64 3/9
Installing : mysql-community-libs-compat-5.6.33-2.el6.x86_64 4/9
Installing : perl-DBI-1.609-4.el6.x86_64 5/9
Installing : mysql-community-server-5.6.33-2.el6.x86_64 6/9
Updating : 2:postfix-2.6.6-6.el6_7.1.x86_64 7/9
Cleanup : 2:postfix-2.6.6-2.2.el6_1.x86_64 8/9
Erasing : mysql-libs-5.1.71-1.el6.x86_64 9/9
Verifying : 2:postfix-2.6.6-6.el6_7.1.x86_64 1/9
Verifying : mysql-community-libs-5.6.33-2.el6.x86_64 2/9
Verifying : mysql-community-client-5.6.33-2.el6.x86_64 3/9
Verifying : mysql-community-server-5.6.33-2.el6.x86_64 4/9
Verifying : perl-DBI-1.609-4.el6.x86_64 5/9
Verifying : mysql-community-common-5.6.33-2.el6.x86_64 6/9
Verifying : mysql-community-libs-compat-5.6.33-2.el6.x86_64 7/9
Verifying : mysql-libs-5.1.71-1.el6.x86_64 8/9
Verifying : 2:postfix-2.6.6-2.2.el6_1.x86_64 9/9
Installed:
mysql-community-libs.x86_64 0:5.6.33-2.el6 mysql-community-libs-compat.x86_64 0:5.6.33-2.el6 mysql-community-server.x86_64 0:5.6.33-2.el6
Dependency Installed:
mysql-community-client.x86_64 0:5.6.33-2.el6 mysql-community-common.x86_64 0:5.6.33-2.el6 perl-DBI.x86_64 0:1.609-4.el6
Dependency Updated:
postfix.x86_64 2:2.6.6-6.el6_7.1
Replaced:
mysql-libs.x86_64 0:5.1.71-1.el6
Complete!
修改mysql配置文件. /etc/my.cnf,在[mysqld]中添加innodb_file_per_table=1,并登录数据库,创建zabbix 数据库以及授权zabbix用户
[root@moban ~]# grep -v "^#" /etc/my.cnf | grep -v "^$"
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
innodb_file_per_table=1
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
启动初始化数据库
[root@moban ~]# /etc/init.d/mysqld start
初始化 MySQL 数据库: 2016-09-12 16:33:52 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-09-12 16:33:52 0 [Note] /usr/sbin/mysqld (mysqld 5.6.33) starting as process 27435 ...
2016-09-12 16:33:52 27435 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-09-12 16:33:52 27435 [Note] InnoDB: The InnoDB memory heap is disabled
2016-09-12 16:33:52 27435 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-09-12 16:33:52 27435 [Note] InnoDB: Memory barrier is not used
2016-09-12 16:33:52 27435 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-09-12 16:33:52 27435 [Note] InnoDB: Using Linux native AIO
2016-09-12 16:33:52 27435 [Note] InnoDB: Not using CPU crc32 instructions
2016-09-12 16:33:52 27435 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-09-12 16:33:52 27435 [Note] InnoDB: Completed initialization of buffer pool
2016-09-12 16:33:52 27435 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-09-12 16:33:52 27435 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-09-12 16:33:52 27435 [Note] InnoDB: Database physically writes the file full: wait...
2016-09-12 16:33:52 27435 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-09-12 16:33:52 27435 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-09-12 16:33:52 27435 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-09-12 16:33:52 27435 [Warning] InnoDB: New log files created, LSN=45781
2016-09-12 16:33:52 27435 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-09-12 16:33:52 27435 [Note] InnoDB: Doublewrite buffer created
2016-09-12 16:33:52 27435 [Note] InnoDB: 128 rollback segment(s) are active.
2016-09-12 16:33:52 27435 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-09-12 16:33:52 27435 [Note] InnoDB: Foreign key constraint system tables created
2016-09-12 16:33:52 27435 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-09-12 16:33:52 27435 [Note] InnoDB: Tablespace and datafile system tables created.
2016-09-12 16:33:52 27435 [Note] InnoDB: Waiting for purge to start
2016-09-12 16:33:52 27435 [Note] InnoDB: 5.6.33 started; log sequence number 0
2016-09-12 16:33:53 27435 [Note] Binlog end
2016-09-12 16:33:53 27435 [Note] InnoDB: FTS optimize thread exiting.
2016-09-12 16:33:53 27435 [Note] InnoDB: Starting shutdown...
2016-09-12 16:33:55 27435 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2016-09-12 16:33:55 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-09-12 16:33:55 0 [Note] /usr/sbin/mysqld (mysqld 5.6.33) starting as process 27458 ...
2016-09-12 16:33:55 27458 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-09-12 16:33:55 27458 [Note] InnoDB: The InnoDB memory heap is disabled
2016-09-12 16:33:55 27458 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-09-12 16:33:55 27458 [Note] InnoDB: Memory barrier is not used
2016-09-12 16:33:55 27458 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-09-12 16:33:55 27458 [Note] InnoDB: Using Linux native AIO
2016-09-12 16:33:55 27458 [Note] InnoDB: Not using CPU crc32 instructions
2016-09-12 16:33:55 27458 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-09-12 16:33:55 27458 [Note] InnoDB: Completed initialization of buffer pool
2016-09-12 16:33:55 27458 [Note] InnoDB: Highest supported file format is Barracuda.
2016-09-12 16:33:55 27458 [Note] InnoDB: 128 rollback segment(s) are active.
2016-09-12 16:33:55 27458 [Note] InnoDB: Waiting for purge to start
2016-09-12 16:33:56 27458 [Note] InnoDB: 5.6.33 started; log sequence number 1625977
2016-09-12 16:33:56 27458 [Note] Binlog end
2016-09-12 16:33:56 27458 [Note] InnoDB: FTS optimize thread exiting.
2016-09-12 16:33:56 27458 [Note] InnoDB: Starting shutdown...
2016-09-12 16:33:57 27458 [Note] InnoDB: Shutdown completed; log sequence number 1625987
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h moban password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Note: new default config file not created.
Please make sure your config file is current
WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server
[确定]
正在启动 mysqld: [确定]
创建zabbix用户并赋权限
[root@moban ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.33 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.* To zabbix@localhost identified by 'zabbix'; 我是切割符复制我之前 (zabbix 密码根据自己要求设置,后期安装zabbix-server需要)
Query OK, 0 rows affected (0.05 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)
mysql> quit
Bye
7.现在开始安装zabbix-server 软件。
安装 git 工具
[root@moban ~]# git clone https://github.com/zabbixcn/zabbix3.0-rpm.git
-bash: git: command not found
[root@moban ~]# yum install git
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* remi-safe: mirror.innosol.asia
* updates: mirrors.aliyun.com
* webtatic: us-east.repo.webtatic.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-4.el6_7.1 will be installed
--> Processing Dependency: perl-Git = 1.7.1-4.el6_7.1 for package: git-1.7.1-4.el6_7.1.x86_64
--> Processing Dependency: perl(Git) for package: git-1.7.1-4.el6_7.1.x86_64
--> Processing Dependency: perl(Error) for package: git-1.7.1-4.el6_7.1.x86_64
--> Running transaction check
---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed
---> Package perl-Git.noarch 0:1.7.1-4.el6_7.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
git x86_64 1.7.1-4.el6_7.1 base 4.6 M
Installing for dependencies:
perl-Error noarch 1:0.17015-4.el6 base 29 k
perl-Git noarch 1.7.1-4.el6_7.1 base 28 k
Transaction Summary
=====================================================================================================================================================================================================
Install 3 Package(s)
Total download size: 4.7 M
Installed size: 15 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): git-1.7.1-4.el6_7.1.x86_64.rpm | 4.6 MB 00:35
(2/3): perl-Error-0.17015-4.el6.noarch.rpm | 29 kB 00:00
(3/3): perl-Git-1.7.1-4.el6_7.1.noarch.rpm | 28 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 133 kB/s | 4.7 MB 00:35
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:perl-Error-0.17015-4.el6.noarch 1/3
Installing : git-1.7.1-4.el6_7.1.x86_64 2/3
Installing : perl-Git-1.7.1-4.el6_7.1.noarch 3/3
Verifying : perl-Git-1.7.1-4.el6_7.1.noarch 1/3
Verifying : 1:perl-Error-0.17015-4.el6.noarch 2/3
Verifying : git-1.7.1-4.el6_7.1.x86_64 3/3
Installed:
git.x86_64 0:1.7.1-4.el6_7.1
Dependency Installed:
perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-4.el6_7.1
Complete!
下载zabbix包 注意
git clone https://github.com/zabbixcn/zabbix3.0-rpm.git
-bash: git: command not found 出现这个错误意味着为安装 git软件。
[root@moban ~]# git clone https://github.com/zabbixcn/zabbix3.0-rpm.git
Initialized empty Git repository in /root/zabbix3.0-rpm/.git/
remote: Counting objects: 82, done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 82 (delta 23), reused 82 (delta 23), pack-reused 0
Unpacking objects: 100% (82/82), done.
[root@moban ~]# cd zabbix3.0-rpm/RPMS/
[root@moban RPMS]# ll
总用量 13400
-rw-r--r-- 1 root root 382215 9月 12 16:55 zabbix-agent-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 262978 9月 12 16:55 zabbix-get-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 752816 9月 12 16:55 zabbix-java-gateway-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 746331 9月 12 16:55 zabbix-proxy-mysql-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 718686 9月 12 16:55 zabbix-proxy-pgsql-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 700152 9月 12 16:55 zabbix-proxy-sqlite3-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 276191 9月 12 16:55 zabbix-sender-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 1936432 9月 12 16:55 zabbix-server-mysql-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 1908286 9月 12 16:55 zabbix-server-pgsql-3.0.0-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 6005428 9月 12 16:55 zabbix-web-3.0.0-1.el6.noarch.rpm
-rw-r--r-- 1 root root 3379 9月 12 16:55 zabbix-web-japanese-3.0.0-1.el6.noarch.rpm
-rw-r--r-- 1 root root 2955 9月 12 16:55 zabbix-web-mysql-3.0.0-1.el6.noarch.rpm
-rw-r--r-- 1 root root 2967 9月 12 16:55 zabbix-web-pgsql-3.0.0-1.el6.noarch.rpm
安装
[root@moban RPMS]# yum install zabbix-server-mysql-3.0.0-1.el6.x86_64.rpm zabbix-web-3.0.0-1.el6.noarch.rpm zabbix-web-mysql-3.0.0-1.el6.noarch.rpm httpd php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml -y
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* remi-safe: mirror.innosol.asia
* updates: mirrors.aliyun.com
* webtatic: uk.repo.webtatic.com
Setting up Install Process
Examining zabbix-server-mysql-3.0.0-1.el6.x86_64.rpm: zabbix-server-mysql-3.0.0-1.el6.x86_64
Marking zabbix-server-mysql-3.0.0-1.el6.x86_64.rpm to be installed
Examining zabbix-web-3.0.0-1.el6.noarch.rpm: zabbix-web-3.0.0-1.el6.noarch
Marking zabbix-web-3.0.0-1.el6.noarch.rpm to be installed
Examining zabbix-web-mysql-3.0.0-1.el6.noarch.rpm: zabbix-web-mysql-3.0.0-1.el6.noarch
Marking zabbix-web-mysql-3.0.0-1.el6.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-29.el6.centos will be updated
---> Package httpd.x86_64 0:2.2.15-54.el6.centos will be an update
--> Processing Dependency: httpd-tools = 2.2.15-54.el6.centos for package: httpd-2.2.15-54.el6.centos.x86_64
---> Package php56w-bcmath.x86_64 0:5.6.25-1.w6 will be installed
---> Package php56w-gd.x86_64 0:5.6.25-1.w6 will be installed
--> Processing Dependency: libt1.so.5()(64bit) for package: php56w-gd-5.6.25-1.w6.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: php56w-gd-5.6.25-1.w6.x86_64
---> Package php56w-mbstring.x86_64 0:5.6.25-1.w6 will be installed
---> Package php56w-mysql.x86_64 0:5.6.25-1.w6 will be installed
--> Processing Dependency: php56w-pdo(x86-64) for package: php56w-mysql-5.6.25-1.w6.x86_64
---> Package php56w-xml.x86_64 0:5.6.25-1.w6 will be installed
---> Package zabbix-server-mysql.x86_64 0:3.0.0-1.el6 will be installed
--> Processing Dependency: fping for package: zabbix-server-mysql-3.0.0-1.el6.x86_64
--> Processing Dependency: libOpenIPMI.so.0()(64bit) for package: zabbix-server-mysql-3.0.0-1.el6.x86_64
--> Processing Dependency: libOpenIPMIposix.so.0()(64bit) for package: zabbix-server-mysql-3.0.0-1.el6.x86_64
--> Processing Dependency: libiksemel.so.3()(64bit) for package: zabbix-server-mysql-3.0.0-1.el6.x86_64
--> Processing Dependency: libnetsnmp.so.20()(64bit) for package: zabbix-server-mysql-3.0.0-1.el6.x86_64
--> Processing Dependency: libodbc.so.2()(64bit) for package: zabbix-server-mysql-3.0.0-1.el6.x86_64
---> Package zabbix-web.noarch 0:3.0.0-1.el6 will be installed
--> Processing Dependency: php-ldap for package: zabbix-web-3.0.0-1.el6.noarch
---> Package zabbix-web-mysql.noarch 0:3.0.0-1.el6 will be installed
--> Running transaction check
---> Package OpenIPMI-libs.x86_64 0:2.0.16-14.el6 will be installed
---> Package fping.x86_64 0:2.4b2-10.el6 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-29.el6.centos will be updated
---> Package httpd-tools.x86_64 0:2.2.15-54.el6.centos will be an update
---> Package iksemel.x86_64 0:1.4-2.el6 will be installed
---> Package libXpm.x86_64 0:3.5.10-2.el6 will be installed
---> Package net-snmp-libs.x86_64 1:5.5-57.el6_8.1 will be installed
--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-libs-5.5-57.el6_8.1.x86_64
---> Package php56w-ldap.x86_64 0:5.6.25-1.w6 will be installed
---> Package php56w-pdo.x86_64 0:5.6.25-1.w6 will be installed
---> Package t1lib.x86_64 0:5.1.2-6.el6_2.1 will be installed
---> Package unixODBC.x86_64 0:2.2.14-14.el6 will be installed
--> Running transaction check
---> Package lm_sensors-libs.x86_64 0:3.1.1-17.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
php56w-bcmath x86_64 5.6.25-1.w6 webtatic 34 k
php56w-gd x86_64 5.6.25-1.w6 webtatic 144 k
php56w-mbstring x86_64 5.6.25-1.w6 webtatic 944 k
php56w-mysql x86_64 5.6.25-1.w6 webtatic 112 k
php56w-xml x86_64 5.6.25-1.w6 webtatic 150 k
zabbix-server-mysql x86_64 3.0.0-1.el6 /zabbix-server-mysql-3.0.0-1.el6.x86_64 3.4 M
zabbix-web noarch 3.0.0-1.el6 /zabbix-web-3.0.0-1.el6.noarch 28 M
zabbix-web-mysql noarch 3.0.0-1.el6 /zabbix-web-mysql-3.0.0-1.el6.noarch 0.0
Updating:
httpd x86_64 2.2.15-54.el6.centos updates 833 k
Installing for dependencies:
OpenIPMI-libs x86_64 2.0.16-14.el6 base 473 k
fping x86_64 2.4b2-10.el6 epel 31 k
iksemel x86_64 1.4-2.el6 epel 48 k
libXpm x86_64 3.5.10-2.el6 base 51 k
lm_sensors-libs x86_64 3.1.1-17.el6 base 38 k
net-snmp-libs x86_64 1:5.5-57.el6_8.1 updates 1.5 M
php56w-ldap x86_64 5.6.25-1.w6 webtatic 38 k
php56w-pdo x86_64 5.6.25-1.w6 webtatic 95 k
t1lib x86_64 5.1.2-6.el6_2.1 base 160 k
unixODBC x86_64 2.2.14-14.el6 base 378 k
Updating for dependencies:
httpd-tools x86_64 2.2.15-54.el6.centos updates 79 k
Transaction Summary
=====================================================================================================================================================================================================
Install 18 Package(s)
Upgrade 2 Package(s)
Total size: 37 M
Total download size: 5.1 M
Downloading Packages:
(1/17): OpenIPMI-libs-2.0.16-14.el6.x86_64.rpm | 473 kB 00:00
(2/17): fping-2.4b2-10.el6.x86_64.rpm | 31 kB 00:00
(3/17): httpd-2.2.15-54.el6.centos.x86_64.rpm | 833 kB 00:01
(4/17): httpd-tools-2.2.15-54.el6.centos.x86_64.rpm | 79 kB 00:00
(5/17): iksemel-1.4-2.el6.x86_64.rpm | 48 kB 00:00
(6/17): libXpm-3.5.10-2.el6.x86_64.rpm | 51 kB 00:00
(7/17): lm_sensors-libs-3.1.1-17.el6.x86_64.rpm | 38 kB 00:00
(8/17): net-snmp-libs-5.5-57.el6_8.1.x86_64.rpm | 1.5 MB 00:03
(9/17): php56w-bcmath-5.6.25-1.w6.x86_64.rpm | 34 kB 00:08
(10/17): php56w-gd-5.6.25-1.w6.x86_64.rpm | 144 kB 00:21
(11/17): php56w-ldap-5.6.25-1.w6.x86_64.rpm | 38 kB 00:03
(12/17): php56w-mbstring-5.6.25-1.w6.x86_64.rpm | 944 kB 01:06
(13/17): php56w-mysql-5.6.25-1.w6.x86_64.rpm | 112 kB 00:02
(14/17): php56w-pdo-5.6.25-1.w6.x86_64.rpm | 95 kB 00:01
(15/17): php56w-xml-5.6.25-1.w6.x86_64.rpm | 150 kB 00:03
(16/17): t1lib-5.1.2-6.el6_2.1.x86_64.rpm | 160 kB 00:00
(17/17): unixODBC-2.2.14-14.el6.x86_64.rpm | 378 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 41 kB/s | 5.1 MB 02:08
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : OpenIPMI-libs-2.0.16-14.el6.x86_64 1/22
Installing : lm_sensors-libs-3.1.1-17.el6.x86_64 2/22
Installing : 1:net-snmp-libs-5.5-57.el6_8.1.x86_64 3/22
Installing : php56w-ldap-5.6.25-1.w6.x86_64 4/22
Installing : php56w-pdo-5.6.25-1.w6.x86_64 5/22
Installing : php56w-mysql-5.6.25-1.w6.x86_64 6/22
Installing : php56w-mbstring-5.6.25-1.w6.x86_64 7/22
Installing : fping-2.4b2-10.el6.x86_64 8/22
Installing : php56w-bcmath-5.6.25-1.w6.x86_64 9/22
Installing : unixODBC-2.2.14-14.el6.x86_64 10/22
Installing : php56w-xml-5.6.25-1.w6.x86_64 11/22
Installing : t1lib-5.1.2-6.el6_2.1.x86_64 12/22
Updating : httpd-tools-2.2.15-54.el6.centos.x86_64 13/22
Updating : httpd-2.2.15-54.el6.centos.x86_64 14/22
Installing : iksemel-1.4-2.el6.x86_64 15/22
Installing : libXpm-3.5.10-2.el6.x86_64 16/22
Installing : php56w-gd-5.6.25-1.w6.x86_64 17/22
Installing : zabbix-web-mysql-3.0.0-1.el6.noarch 18/22
Installing : zabbix-web-3.0.0-1.el6.noarch 19/22
Installing : zabbix-server-mysql-3.0.0-1.el6.x86_64 20/22
Cleanup : httpd-2.2.15-29.el6.centos.x86_64 21/22
Cleanup : httpd-tools-2.2.15-29.el6.centos.x86_64 22/22
Verifying : php56w-gd-5.6.25-1.w6.x86_64 1/22
Verifying : libXpm-3.5.10-2.el6.x86_64 2/22
Verifying : iksemel-1.4-2.el6.x86_64 3/22
Verifying : httpd-tools-2.2.15-54.el6.centos.x86_64 4/22
Verifying : zabbix-web-mysql-3.0.0-1.el6.noarch 5/22
Verifying : t1lib-5.1.2-6.el6_2.1.x86_64 6/22
Verifying : php56w-xml-5.6.25-1.w6.x86_64 7/22
Verifying : unixODBC-2.2.14-14.el6.x86_64 8/22
Verifying : 1:net-snmp-libs-5.5-57.el6_8.1.x86_64 9/22
Verifying : php56w-bcmath-5.6.25-1.w6.x86_64 10/22
Verifying : fping-2.4b2-10.el6.x86_64 11/22
Verifying : php56w-mbstring-5.6.25-1.w6.x86_64 12/22
Verifying : php56w-pdo-5.6.25-1.w6.x86_64 13/22
Verifying : httpd-2.2.15-54.el6.centos.x86_64 14/22
Verifying : php56w-ldap-5.6.25-1.w6.x86_64 15/22
Verifying : zabbix-server-mysql-3.0.0-1.el6.x86_64 16/22
Verifying : zabbix-web-3.0.0-1.el6.noarch 17/22
Verifying : lm_sensors-libs-3.1.1-17.el6.x86_64 18/22
Verifying : OpenIPMI-libs-2.0.16-14.el6.x86_64 19/22
Verifying : php56w-mysql-5.6.25-1.w6.x86_64 20/22
Verifying : httpd-2.2.15-29.el6.centos.x86_64 21/22
Verifying : httpd-tools-2.2.15-29.el6.centos.x86_64 22/22
Installed:
php56w-bcmath.x86_64 0:5.6.25-1.w6 php56w-gd.x86_64 0:5.6.25-1.w6 php56w-mbstring.x86_64 0:5.6.25-1.w6 php56w-mysql.x86_64 0:5.6.25-1.w6 php56w-xml.x86_64 0:5.6.25-1.w6
zabbix-server-mysql.x86_64 0:3.0.0-1.el6 zabbix-web.noarch 0:3.0.0-1.el6 zabbix-web-mysql.noarch 0:3.0.0-1.el6
Dependency Installed:
OpenIPMI-libs.x86_64 0:2.0.16-14.el6 fping.x86_64 0:2.4b2-10.el6 iksemel.x86_64 0:1.4-2.el6 libXpm.x86_64 0:3.5.10-2.el6 lm_sensors-libs.x86_64 0:3.1.1-17.el6
net-snmp-libs.x86_64 1:5.5-57.el6_8.1 php56w-ldap.x86_64 0:5.6.25-1.w6 php56w-pdo.x86_64 0:5.6.25-1.w6 t1lib.x86_64 0:5.1.2-6.el6_2.1 unixODBC.x86_64 0:2.2.14-14.el6
Updated:
httpd.x86_64 0:2.2.15-54.el6.centos
Dependency Updated:
httpd-tools.x86_64 0:2.2.15-54.el6.centos
Complete!
安装zabbix-agent 客户端
[root@moban RPMS]# yum install zabbix-agent-3.0.0-1.el6.x86_64.rpm -y
Loaded plugins: fastestmirror, refresh-packagekit, replace, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.btte.net
* remi-safe: mirror.innosol.asia
* updates: mirrors.aliyun.com
* webtatic: uk.repo.webtatic.com
Setting up Install Process
Examining zabbix-agent-3.0.0-1.el6.x86_64.rpm: zabbix-agent-3.0.0-1.el6.x86_64
Marking zabbix-agent-3.0.0-1.el6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:3.0.0-1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
zabbix-agent x86_64 3.0.0-1.el6 /zabbix-agent-3.0.0-1.el6.x86_64 1.1 M
Transaction Summary
=====================================================================================================================================================================================================
Install 1 Package(s)
Total size: 1.1 M
Installed size: 1.1 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : zabbix-agent-3.0.0-1.el6.x86_64 1/1
Verifying : zabbix-agent-3.0.0-1.el6.x86_64 1/1
Installed:
zabbix-agent.x86_64 0:3.0.0-1.el6
Complete!
初始化http时区
[root@moban RPMS]# sed -i "s@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g" /etc/httpd/conf.d/zabbix.conf
初始化zabbix 数据库,建表。文件目录在/usr/share/zabbix-server-mysql-3.0.0
[root@moban zabbix-server-mysql-3.0.0]# pwd
/usr/share/zabbix-server-mysql-3.0.0
[root@moban zabbix-server-mysql-3.0.0]# ls
create.sql.gz
[root@moban zabbix-server-mysql-3.0.0]# zcat create.sql.gz | mysql -uzabbix -pzabbix zabbix
Warning: Using a password on the command line interface can be insecure.
建完后,修改zabbix-server 端的配置,主要改动下面这4处
[root@moban ~]# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=testzabbix
启动httpd、zabbix-server、zabbix-agent服务
注意 启动前要检查iptables selinux
[root@moban ~]# /etc/init.d/iptables status 注意:生产环境根据需求决定是否打开iptables 如果打开根据需求修改
iptables:未运行防火墙。
确保selinux 关闭
[root@moban ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
启动服务
[root@moban ~]# /etc/init.d/httpd start
正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using 219.146.13.36 for ServerName
[确定]
[root@moban ~]# /etc/init.d/zabbix-server start
Starting Zabbix server: [确定]
[root@moban ~]# /etc/init.d/zabbix-agent start
Starting Zabbix agent: [确定]
8.现在可以去web页面设置了进行安装了。简单配下图。
登陆地址 http://服务端ip/zabbix
第一页 check of pre-requisites 全部ok
第二页 添写mysql zabbix 密码
第三页 默认即可
第四页 查看信息
第五页 安装完成
默认初始账户 Admin 密码zabbix 注意A要大写
完成安装
修改支持中文
手动添加中文字符集支持
1 [root@moban ~]# vi /usr/share/zabbix/include/locales.inc.php
在第55行开启zh_CN语言显示
'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => false],
修改为
'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => true],
保存好,再次点击右上角小人图标,语言下拉框即可选择简体中文
点击update更新
修改为中文后 图形中乱码解决
Win+R打开运行,输入fonts,回车进入Windows字体目录,找到微软雅黑-常规字体,复制出来将文件名修改为msyh.ttf,注意后缀ttf。
将msyh.ttf上传到服务器zabbix字体目录中:/usr/share/zabbix/fonts/
[root@moban ~]# cd /usr/share/zabbix/fonts/
[root@moban fonts]# pwd
/usr/share/zabbix/fonts
[root@moban fonts]# ls
graphfont.ttf msyh.ttf
修改配置文件
查看字体配置
[root@moban fonts]# grep FONT_NAME /usr/share/zabbix/include/defines.inc.php -n
45:define('ZBX_GRAPH_FONT_NAME', 'graphfont'); // font file name
93:define('ZBX_FONT_NAME', 'graphfont');
确认字体名称是否可以替换
[root@moban fonts]# grep graphfont /usr/share/zabbix/include/defines.inc.php -n
45:define('ZBX_GRAPH_FONT_NAME', 'graphfont'); // font file name
93:define('ZBX_FONT_NAME', 'graphfont');
快捷替换
sed -i "s/graphfont/msyh/g" /usr/share/zabbix/include/defines.inc.php
确认是否成功
[root@moban fonts]# grep FONT_NAME /usr/share/zabbix/include/defines.inc.php -n
45:define('ZBX_GRAPH_FONT_NAME', 'msyh'); // font file name
93:define('ZBX_FONT_NAME', 'msyh');
最终成果查看
OK 大功告成
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22390488/viewspace-2124848/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22390488/viewspace-2124848/