-
安装依赖
yum install pcre* #为了支持rewrite功能 yum install openssl openssl-devel
-
安装Nginx
wget http://Nginx.org/download/Nginx-1.12.2.tar.gz tar xvf Nginx-1.12.2.tar.gz cd Nginx-1.12.2 执行./configure --prefix=/usr/local/Nginx-1.12.2 \ --with-http_ssl_module --with-http_v2_module \ --with-http_stub_status_module --with-pcre ####--with-http_spdy_module 1.9之后没有了,--with-http_v2_module取而代之 make && make install
-
查看防火墙是否关闭(如果虚拟机可以访问Nginx,物理机不能访问Nginx)
sudo systemctl status firewalld 查看防火墙状态 sudo systemctl stop firewalld停止防火墙 systemctl disable firewalld.service 禁止开机启用防火墙 vim /etc/selinux/config 进入配置文件 设置:SELINUX=disabled(重启才生效) #或者防火墙开放80端口 firewall-cmd --zone=public --add-port=80/tcp --permanent
-
安装MysqL 5.7
wget http://dev.MysqL.com/get/MysqL57-community-release-el7-7.noarch.rpm yum localinstall MysqL57-community-release-el7-7.noarch.rpm yum repolist enabled | grep "MysqL.*-community.*" yum install MysqL-community-server service MysqLd start grep 'temporary password' /var/log/MysqLd.log #记录随机密码 oHr6jwY>Jeay MysqL_secure_installation #初始化 MysqL -u root -p
-
新建以及初始化数据库zabbix
create database zabbix; use zabbix; source /root/zabbix-3.4.3/database/MysqL/schema.sql; source /root/zabbix-3.4.3/database/MysqL/data.sql; source /root/zabbix-3.4.3/database/MysqL/images.sql;
-
安装@R_502_6278@ 5.6 稳定版本
yum -y groupinstall "Development Tools" yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel -y 编译需要的依赖包 wget http://@R_502[email protected]/get/@R_502[email protected]/from/this/mirror -O @R_502[email protected] cd @R_502[email protected] 安装ldap,如果报错无法解决去掉-with-ldap编译 yum -y install openldap openldap-devel cp -frp /usr/lib64/libldaP* /usr/lib/ ./configure -prefix=/usr/local/@R_502_6278@ -with-config-file-path=/usr/local/@R_502_6278@/etc -with-bz2 -with-curl -enable-ftp -enable-sockets -disable-ipv6 -with-gd -with-jpeg-dir=/usr/local -with-png-dir=/usr/local -with-freetype-dir=/usr/local -enable-gd-native-ttf -with-iconv-dir=/usr/local -enable-mbstring -enable-calendar -with-gettext -with-libxml-dir=/usr/local -with-zlib -with-pdo-MysqL=MysqLnd -with-MysqLi=MysqLnd -with-MysqL=MysqLnd -with-ldap -enable-dom -enable-xml -enable-fpm -with-libdir=lib64 -enable-bcmath make make install #配置@R_502_6278@ #编辑@R_502[email protected] #修改如下参数 max_execution_time = 300 memory_limit = 128M post_max_size = 16M upload_max_filesize = 2M max_input_time = 300 date.timezone PRC cp @R_502[email protected] /usr/local/@R_502_6278@/etc/@R_502[email protected] cp /usr/local/@R_502_6278@/etc/@R_502[email protected] /usr/local/@R_502_6278@/etc/@R_502[email protected] #启动@R_502_6278@-fpm,占用端口9000 /usr/local/@R_502_6278@/sbin/@R_502_6278@-fpm
-
安装zabbix
#下载zabbix wget #解压 tar xvf zabbix-3.4.3 cd zabbix-3.4.3 #创建zabbix用户(使用root启动时,会自动找zabbix启动) centos: groupadd --system zabbix useradd --system -g zabbix -d /usr/lib/zabbix -s /sbin/nologin -c "Zabbix Monitoring System" zabbix ubuntu: addgroup --system --quiet zabbix adduser --quiet --system --disabled-login --ingroup zabbix --home /var/lib/zabbix --no-create-home zabbix #编译 #找到MysqL_config_editor的位置 find / -name "MysqL_config*" #安装 yum install MysqL-devel -y yum install net-snmp-devel -y yum install libevent-devel -y #配置zabbix server和agent ./configure --enable-server --enable-agent --with-MysqL=/usr/bin/MysqL_config --with-net-snmp --with-libcurl --with-libxml2 make make install
-
配置server和agentd
#启动脚本在 /usr/local/sbin #配置文件在 /usr/local/etc vim /usr/local/etc/zabbix_server.conf dbname=zabbix DBUser=root DBPassword=123456 DBPort=3306 vim /usr/local/etc/zabbix_agentd.conf Server=127.0.0.1 ServerActive=127.0.0.1 Hostname=Zabbix server
-
配置Nginx zabbix
cp -r /root/zabbix-3.4.3/frontends/@R_502_6278@/* /data/zabbix-frontend sudo chmod -R 777 /data/zabbix-frontend # vim /usr/local/Nginx-1.12.2/conf/Nginx.conf server { listen 80; server_name localhost; #charset koi8-r; access_log /root/logs/zabbix.access.log main; #最上面的log_format注释要取消 index index.html index.@R_502_6278@ index.html; root /data/zabbix-frontend; location / { try_files $uri $uri/ /index.@R_502_6278@?$args; } location ~ ^(.+.@R_502_6278@)(.*)$ { #root /data/zabbix-frontend; fastcgi_split_path_info ^(.+.@R_502_6278@)(.*)$; include fastcgi.conf; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.@R_502_6278@; #fastcgi_param PATH_INFO $fastcgi_path_info; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #include fastcgi_params; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }
官方安装:https://www.zabbix.com/download?zabbix=3.0&os_distribution=centos&os_version=7&db=MysqL
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。