基于rhel7.2的Zabbix平台搭建和部署(一)

基于rhel7.2的zabbix平台搭建和部署(一)


一、实验环境:

(1)虚拟机:rhel7.2 x86_64

(2)数据库:mysql5.7.13

(3)nginx1.10.2

(4)PHP5.6.27

(5)zabbix3.2.3

二、安装编译工具及库文件

[root@localhost ~]# yum-y install make apr* autoconf automake curl-devel gcc gcc-c++  openssl openssl-devel gd kernel keyutils patch perl kernel-headers compat* mpfr cpp glibc libgomp libstdc++-devel keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm* freetype libjpeg* libpng* libtool* libxml2 libxml2-devel patch libcurl-devel bzip2-devel freetype-devel

三、安装mysql5.7.13

(1)安装具体步骤,请参考我的博文:http://wutengfei.blog.51cto.com/10942117/1931482

(2)mysql安装完毕后,看一下mysql的服务

[root@localhost ~]# ps -ef |grep mysql

基于rhel7.2的Zabbix平台搭建和部署(一)

[root@localhost ~]# netstat -lnp |grep mysql

基于rhel7.2的Zabbix平台搭建和部署(一)

(3)防火墙开启3306端口例外

[root@localhost ~]# firewall-cmd --permanent --add-port=3306/tcp

success

[root@localhost ~]# firewall-cmd --reload

success

基于rhel7.2的Zabbix平台搭建和部署(一)

(4)数据库密码:123456

四、安装nginx1.10.2

(1)解压zlib和pcre

[root@localhost src]# tar -zxvf zlib-1.2.8.tar.广州

(root@localhost src) #焦油-zxvf pcre-8.39.tar。广州

<>强说明:不需要编译,只需要解压就行。

(2)创建组账户和用户账户

[root@localhost ~] # groupadd www

[root@localhost ~] # useradd - g www - s/sbin/nologin www

[root@localhost ~] # grep www/etc/passwd

www: x: 1000:1000::/home/www/sbin/nologin

(3)下载安装nginx

(root@localhost src) #焦油-zxvf nginx-1.10.3.tar。广州

(root@localhost src) # cd nginx-1.10.3

[root@localhost nginx-1.10.3] # ./configure——prefix=/usr/地方/nginx1.10——with-http_dav_module with-http_stub_status_module,——with-http_addition_module with-http_sub_module,——with-http_flv_module,——with-http_mp4_module with-pcre=/usr/src/pcre - 8.39——with-zlib=/usr/src/zlib-1.2.8,——with-http_ssl_module with-http_gzip_static_module——用户=www,——组=www,,使,,make install

(4)做软链接

[root@localhost nginx-1.10.3] # ln - s/usr/local/nginx1.10/sbin/nginx,/usr/地方/sbin/

(5) nginx语法检查

[root@localhost nginx-1.10.3] # nginx - t

基于rhel7.2的Zabbix平台搭建和部署(一)

(6)启动nginx并查看服务

[root@localhost nginx-1.10.3] # netstat lnp | grep nginx

基于rhel7.2的Zabbix平台搭建和部署(一)

(7)防火墙开80年启端口例外

[root@localhost ~] # firewall-cmd——永久添加一个端口=80/tcp

成功(root@localhost ~) # firewall-cmd成功——重载

基于rhel7.2的Zabbix平台搭建和部署(一)

(8)在一台客户端访问测试

基于rhel7.2的Zabbix平台搭建和部署(一)

<强>五、安装php5.6.27

(1)安装libmcrypt

(root@localhost src) #焦油-zxvf libmcrypt-2.5.7.tar。广州

(root@localhost src) # cd libmcrypt-2.5.7

[root@localhost libmcrypt-2.5.7] # ./configure,,使,,使安装

(2)做软链接

[root@localhost ~] # ln - s,/usr/地方/mysql/lib/libmysqlclient.so.20.3.0/usr/local/mysql/lib/libmysqlclient_r。所以

(3)安装php

(root@localhost src) #焦油-zxvf php-5.6.27.tar。广州

(root@localhost src) # cd php-5.6.27

[root@localhost php-5.6.27] #,。/configure——prefix=/usr/地方/php5.6,——with-config-file-path=/etc,使用mysql=/usr/地方/mysql——with-mysqli=/usr/地方/mysql/bin/mysql_config——with-mysql-sock=/usr/地方/mysql/mysql。袜子——与gd with-iconv——with-libxml-dir=/usr with-mhash——with-mcrypt with-config-file-scan-dir=/etc/php。d——with-bz2 with-zlib——with-freetype-dir with-png-dir——with-jpeg-dir启用xml——enable-bcmath enable-shmop——enable-sysvsem enable-inline-optimization——enable-mbregex enable-fpm——enable-mbstring enable-ftp——enable-gd-native-ttf openssl——enable-pcntl enable-sockets——with-xmlrpc enable-zip——enable-soap without-pear——with-gettext启用会话——with-mcrypt使用curl,,使,,使安装

基于rhel7.2的Zabbix平台搭建和部署(一)