centos 6安装zabbix server

1:安装nginx

   1.1 检查依赖包

   [root@localhost software]# rpm -qa pcre pcre-devel openssl openssl-devel gcc-c++

   1.2 安装依赖包

   [root@localhost software]# yum install pcre pcre-devel openssl openssl-devel gcc-c++

2:添加nginx用户,禁止ssh登录

[root@localhost software]# useradd -s /sbin/nologin -M nginx

3:安装nginx

   3.1:解压nginx

   [root@localhost software]# tar xf nginx-1.10.1.tar.gz

   3.2:配置nginx

   [root@localhost nginx-1.10.1]# ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.10.1 --with-http_stub_status_module --with-http_ssl_module

   3.3:编译&安装

   [root@localhost nginx-1.10.1]# make

   [root@localhost nginx-1.10.1]# make install

   3.4 做硬链接

   [root@localhost nginx-1.10.1]# ln -s /application/nginx-1.10.1/ /application/nginx

   3.5 启动nginx

    [root@localhost application]# /application/nginx/sbin/nginx

[root@localhost application]# ps -ef| grep nginx

Root      6592     1  0 13:17 ?        00:00:00 nginx: master process /application/nginx/sbin/nginx

nginx     6593  6592  0 13:17 ?        00:00:00 nginx: worker process        

root      6595  3957  0 13:17 pts/1    00:00:00 grep nginx

[root@localhost application]# ss -lntup|grep nginx

tcp    LISTEN     0      128                    *:80                    *:*      users:(("nginx",6592,6),("nginx",6593,6))

3.6  配置nginx

[root@localhost conf]# pwd

/application/nginx/conf

[root@localhost conf]# egrep -v "#|^$" nginx.conf.default > nginx.conf

[root@localhost conf]# more nginx.conf

worker_processes  1;

events {

    worker_connections  1024;

}

http {

    include       mime.types;

    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    server {

        listen       80;

        server_name  localhost;

        location / {

            root   html;

            index  index.html index.htm;

        }

        error_page   500 502 503 504  /50x.html;

        location = /50x.html {

            root   html;

        }

       location ~\.(php|php5)?$ {

           root /application/nginx/html;

           fastcgi_pass                  127.0.0.1:9000;

           fastcgi_index                 index.php;

           fastcgi_param SCRIPT_FILENAME /application/nginx/html$fastcgi_script_name;

           include                       fastcgi_params;

       }

    }

}

3.7 重启nginx

[root@localhost conf]# ps -ef|grep nginx

nginx     6633     1  0 13:26 ?        00:00:00 nginx: worker process        

root      6647  3957  0 13:28 pts/1    00:00:00 grep nginx

[root@localhost conf]# kill -9 6633

[root@localhost conf]# /application/nginx/sbin/nginx

 

4:安装依赖包

   4.1 安装依赖包

   [root@localhost ~]# yum install zlib-devel libxml2-devel libjpeg-devel libiconv-devel freetype-devel libpng-devel gd-devel curl-devel libxslt-devel mysql-devel

   4.2 安装libiconv

    [root@localhost software]# tar zxf libiconv-1.14.tar.gz

    [root@localhost software]# cd libiconv-1.14

    [root@localhost libiconv-1.14]# ./configure --prefix=/usr/local/libiconv

    [root@localhost libiconv-1.14]# make

    [root@localhost libiconv-1.14]# make install

   4.3 安装epel

    [root@localhost ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

    [root@localhost ~]# rpm -ivh epel-release-latest-6.noarch.rpm

    [root@localhost ~]# yum install libmcrypt-devel mhash mcrypt

 

5:安装PHP

   5.1 解压php

   [root@localhost software]# tar xf php-5.6.22.tar.gz

[root@localhost software]# cd php-5.6.22

5.2 编译&安装

    [root@localhost php-5.6.22]# ./configure \

--prefix=/application/php-5.6.22 \

--with-mysql \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-iconv-dir=/usr/local/libiconv \

--with-freetype-dir \

--with-jpeg-dir \

--with-png-dir \

--with-zlib \

--with-libxml-dir=/usr \

--with-gettext \

--enable-xml \

--disable-rpath \

--enable-bcmath \

--enable-shmop \

--enable-sysvsem \

--enable-inline-optimization \

--with-curl \

--enable-mbregex \

--enable-fpm \

--enable-mbstring \

--with-mcrypt \

--with-gd \

--enable-gd-native-ttf \

--with-openssl \

--with-mhash \

--enable-pcntl \

--enable-sockets \

--with-xmlrpc \

--enable-soap \

--enable-short-tags \

--enable-static \

--with-xsl \

--with-fpm-user=nginx \

--with-fpm-group=nginx \

--enable-ftp \

--enable-opcache=no

      [root@localhost php-5.6.22]# make

      [root@localhost php-5.6.22]# make install

      [root@localhost php-5.6.22]# ln -s /application/php-5.6.22/ /application/php

      [root@localhost php-5.6.22]# cp php.ini-production /application/php/lib/php.ini

      [root@localhost php-5.6.22]#cd /application/php/etc/

[root@localhost etc]# cp php-fpm.conf.default php-fpm.conf

[root@localhost etc]# /application/php/sbin/php-fpm

5.3 查看是否已经启动php

[root@localhost php-5.6.22]#netstat -lntup|grep php-fpm

 

6 安装zabbix

      6.1 添加用户和组

      [root@localhost software]# tar zxvf zabbix-3.0.3.tar.gz

      [root@localhost software]# cd zabbix-3.0.3

      [root@localhost zabbix-3.0.3]# groupadd zabbix

[root@localhost zabbix-3.0.3]# useradd -g zabbix zabbix

6.2 安装依赖包

[root@localhost zabbix-3.0.3]# yum install net-snmp net-snmp-devel libssh2-devel OpenIPMI-devel

6.3 安装zabbix

[root@localhost zabbix-3.0.3]# ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-ssh2

[root@localhost zabbix-3.0.3]# make

[root@localhost zabbix-3.0.3]# make install

6.4 配置server文件

[root@localhost zabbix-3.0.3]# egrep -v "#|^$" /usr/local/etc/zabbix_server.conf

6.5 拷贝启动脚本

cp misc/init.d/fedora/core/zabbix_* /etc/rc.d/init.d/

6.6 修改配置文件

vim /application/php/lib/php.ini

max_execution_time = 300

max_input_time = 300

post_max_size = 16M

always_populate_raw_post_data = -1

date.timezone = Asia/Shanghai

6.7 重启php

[root@localhost init.d]# pkill -9 php-fpm

[root@localhost init.d]# /application/php/sbin/php-fpm

6.8 把从zabbix源码包拷贝网站到nginx

[root@localhost software]# cd zabbix-3.0.3

[root@localhost zabbix-3.0.3]# cp -rf frontends/php /application/nginx/html/zabbix/

6.9 赋予权限

[root@localhost zabbix-3.0.3]# chown -R nginx.nginx /application/nginx/html/

 

Zabbix搭建完毕

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值