zoukankan      html  css  js  c++  java
  • 开源监控zabbix的搭建


    yum-nginx-php-mysql

    1.依赖安装

    1.依赖
    yum -y install pcre* openssl*
    
    2.php
    rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
    yum install php56w php56w-cli php56w-common php56w-devel php56w-pear php56w-gd php56w-mbstring php56w-mysql php56w-xml php56w-bcmath php56w-ldap php56w-fpm
    
    service php-fpm start (启动fpm模块)
    
    3.mysql
    查看自己得数据库版本
    yum list installed | grep mysql
    删除自己得老版本数据库
    yum remove mysql* -y 
    添加新得数据库下载
    rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
    安装数据库和vim编译器
    yum -y install mysql-server mysql vim
    配置my.cnf文件 (InnoDB引擎默认为开启)
    vim /etc/my.cnf
    [mysqld]
    innodb_file_per_table=1
    启动数据库
    service mysqld start
    修改数据库默认用户密码以及匿名登录
    mysql_secure_installation
    
    4.nginx
    安装
    wget http://nginx.org/download/nginx-1.13.5.tar.gz
    tar zxvf nginx-1.13.5.tar.gz
    cd nginx-1,13,5
    ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre
    make && make install
    启动、关闭、重置
    /usr/local/nginx/sbin/nginx (启动)
    /usr/local/nginx/sbin/nginx -s stop (关闭)
    /usr/local/nginx/sbin/nginx -s reload(重置)
    echo "/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf/" >> /etc/rc.local
    wget http://nginx.org/download/nginx-1.13.5.tar.gz
    tar zxvf nginx-1.13.5.tar.gz
    cd nginx-1,13,5
    ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre
    make && make install
    启动、关闭、重置
    /usr/local/nginx/sbin/nginx (启动)
    /usr/local/nginx/sbin/nginx -s stop (关闭)
    /usr/local/nginx/sbin/nginx -s reload(重置)
    echo "/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf/" >> /etc/rc.local
    
    #配置
    #PHP
    php_value max_execution_time 300
    php_value memory_limit 128M
    php_value post_max_size 16M
    php_value upload_max_filesize 2M
    php_value max_input_time 300
    php_value always_populate_raw_post_data -1
    php_value date.timezone Asia/Shanghai    //主要去掉# 改成上海
    vi etc/nginx.conf
    server { 
    listen 80; 
    server_name localhost; 
    autoindex on; 
    #charset koi8-r; 
    #access_log /var/log/nginx/log/host.access.log main; 
    
    #Nginx
    location / { 
    root html; 
    index index.html index.htm index.php; 
    } 
    
    location ~ .php$ { 
    root html; 
    fastcgi_pass 127.0.0.1:9000; 
    fastcgi_index index.php; 
    fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; 
    include fastcgi_params; 
    }.... 
    

      

      

    2.zabbix

    1.安装相关组件
    yum -y install epel-release
    yum -y install OpenIPMI libssh2 fping libcurl libiksemel net-snmp
    2.添加repo源
    wget http://repo.zabbix.com/zabbix/3.4/rhel/6/i386/deprecated/zabbix-server-mysql-3.4.2-1.el6.i686.rpm
    wget http://repo.zabbix.com/zabbix/3.4/rhel/6/i386/deprecated/zabbix-web-3.4.2-1.el6.noarch.rpm
    wget http://repo.zabbix.com/zabbix/3.4/rhel/6/i386/deprecated/zabbix-web-mysql-3.4.2-1.el6.noarch.rpm
    3.安装
    yum -y localinstall zabbix-server-mysql-3.4.2-1.el6.i686.rpm zabbix-web-mysql-3.4.2-1.el6.noarch.rpm zabbix-web-3.4.2-1.el6.noarch.rpm 
    4.创建初始化数据库
    create database zabbix character set utf8 collate utf8_bin;
    grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';
    zcat /usr/share/doc/zabbix-server-mysql-3.2.*/create.sql.gz | mysql -uzabbix -p zabbix
    修改zabbix配置文件
    # vi /etc/zabbix/zabbix_server.conf 
    DBHost=localhost 
    DBName=zabbix 
    DBUser=zabbix 
    DBPassword=<password>
    修改nginx.conf的root目录
    server { 
    listen 80; 
    server_name localhost; 
    #autoindex on; 
    #charset koi8-r; 
    #access_log /var/log/nginx/log/host.access.log main; 
    
    location / { 
    root /usr/share/zabbix/; 
    index index.html index.htm index.php; 
    } 
    
    location ~ .php$ { 
    root /usr/share/zabbix/; 
    fastcgi_pass 127.0.0.1:9000; 
    fastcgi_index index.php; 
    fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; 
    include fastcgi_params; 
    }.... 
    iptables
    vi /etc/sysconfig/iptables
    -A INPUT -d ip/32 -p tcp -m tcp --dport 80 -j ACCEPT
    网页访问
    http://ip
    完成
    

      


  • 相关阅读:
    为Jupyter只安装目录的扩展包
    前端菜鸟的小程序摸索记录
    小计:Shopee批量删除修复~附脚本
    Python3 与 C# 并发编程之~ 协程篇
    记一次硬件故障,并普及点硬件知识
    小计:协同办公衍生出的需求
    监控MySQL|Redis|MongoDB的执行语句(go-sniffer)
    Linux IO实时监控iostat命令详解
    Linux下的磁盘缓存
    使用top命令查看系统状态
  • 原文地址:https://www.cnblogs.com/wazy/p/7717429.html
Copyright © 2011-2022 走看看