当前位置: 首页 > wzjs >正文

成都市青羊区城乡建设局网站推广公司哪家好

成都市青羊区城乡建设局网站,推广公司哪家好,广州网站建设培训班,谢岗网站建设公司LNMPZabbix安装部署(Zabbix6.0) 简介 LNMP(Linux Nginx MySQL PHP)是一种流行的Web服务器架构,广泛用于搭建高性能的网站和应用程序。Zabbix 是一个开源的监控软件,可以用来监控网络、服务器和应用程序…

LNMP+Zabbix安装部署(Zabbix6.0)

简介

LNMP(Linux + Nginx + MySQL + PHP)是一种流行的Web服务器架构,广泛用于搭建高性能的网站和应用程序。Zabbix 是一个开源的监控软件,可以用来监控网络、服务器和应用程序的性能和健康状态。将 Zabbix 集成到 LNMP 架构中可以提供全面的监控解决方案。下面将介绍如何在一个 LNMP 环境中安装和部署 Zabbix。

安装环境:

系统:centos7.0

nginx版本:1.20

php版本:php7.2.34

mysql版本:mysql8.0.30

zabbix版本:zabbix6.0.1

1、zabbix server端安装    

1.1、关闭系统防火墙    

systemctl stop firewalld.service

systemctl disable firewalld.service

firewall-cmd --state

sed -i '/^SELINUX=.*/c SELINUX=disabled' /etc/selinux/config

sed -i 's/^SELINUXTYPE=.*/SELINUXTYPE=disabled/g' /etc/selinux/config

grep --color=auto '^SELINUX' /etc/selinux/config

setenforce 0

1.2、mysql部署    

wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.30-1.el7.x86_64.rpm-bundle.tar    

tar -xvf mysql-8.0.30-1.el7.x86_64.rpm-bundle.tar

rpm -ivh mysql-community-* --force --nodeps

mkdir -p /data/mysql

chown mysql:mysql /data/mysql

           vim /etc/my.cnf

[mysqld]

datadir=/data/mysql

socket=/var/lib/mysql/mysql.sock    

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

character-set-server=utf8mb4

collation-server=utf8mb4_general_ci

port=3306

lower_case_table_names=1

max_connections=4096

           启动数据库:

yum -y install libaio

systemctl enable mysqld    

systemctl start mysqld

           获取密码登录mysql:

cat /var/log/mysqld.log | grep password

mysql -uroot -pkegsOfDBY9?K

set global validate_password.policy=0;

set global validate_password.length=6;

set global validate_password.mixed_case_count=0;

alter user 'root'@'localhost' identified by 'abc123';

create database zabbix character set utf8 collate utf8_bin;

create user 'zabbix'@'localhost' identified with mysql_native_password by 'abc123';

grant all privileges on zabbix.* to 'zabbix'@'localhost';

flush privileges;

1.3、nginx部署    

rpm -Uvh http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.20.0-1.el7.ngx.x86_64.rpm

mkdir /data/nginx

mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak

      vim /etc/nginx/nginx.conf

user  nginx;

worker_processes  auto;

error_log  /var/log/nginx/error.log notice;

pid        /var/run/nginx.pid;

               events {

    worker_connections  1024;

}

           http {

    include       /etc/nginx/mime.types;

    default_type  application/octet-stream;

           

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

                      '$status $body_bytes_sent "$http_referer" '

                      '"$http_user_agent" "$http_x_forwarded_for"';

               access_log  /var/log/nginx/access.log  main;

    sendfile        on;

    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    server {

      listen       80;

      server_name  localhost;

      root         /data/nginx;

      location / {

        index  index.php index.html index.htm;

      }

      location ~ \.php$ {

        fastcgi_pass   127.0.0.1:9000;

        fastcgi_index  index.php;

        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

        include        fastcgi_params;

      }

    }

}

           systemctl enable nginx

systemctl start nginx

systemctl status nginx

netstat -ntlp |grep 80

1.4、PHP部署    

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo    

yum -y install epel-release

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum -y install gcc gcc-c++ php72w-cli php72w-fpm php72w-gd php72w-mbstring php72w-bcmath php72w-xml php72w-ldap php72w-mysqlnd

sed -i "s/max_execution_time = 30/max_execution_time = 300/g" /etc/php.ini

sed -i "s/max_input_time = 60/max_input_time = 300/g" /etc/php.ini

sed -i "s/post_max_size = 8M/post_max_size = 16M/g" /etc/php.ini

cd /data/nginx/

vim index.php

<?phpphpinfo();?>

systemctl enable php-fpm

systemctl start php-fpm

netstat -ntlp |grep 9000

           使用浏览器验证一下Nginx和PHP:

1.5、zabbix-server部署    

groupadd zabbix

useradd -g zabbix -M -s /sbin/nologin zabbix

wget https://cdn.zabbix.com/zabbix/sources/stable/6.0/zabbix-6.0.1.tar.gz    

tar -xf zabbix-6.0.1.tar.gz

cd zabbix-6.0.1/

yum -y install  mysql-devel pcre-devel openssl-devel zlib-devel libxml2-devel net-snmp-devel net-snmp libssh2-devel OpenIPMI-devel libevent-devel openldap-devel libcurl-devel

./configure --sysconfdir=/etc/zabbix --enable-server --with-mysql --with-net-snmp --with-libxml2 --with-ssh2 --with-openipmi --with-zlib --with-libpthread --with-libevent --with-openssl --with-ldap --with-libcurl --with-libpcre

make install

vim /etc/zabbix/zabbix_server.conf

ListenPort=10051

LogFile=/tmp/zabbix_server.log

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=abc123

Timeout=4

LogSlowQueries=3000

StatsAllowedIP=127.0.0.1

#向数据库中导入zabbix的库表及数据(注意导入的顺序)

mysql -uzabbix -pabc123 zabbix < /root/zabbix-6.0.1/database/mysql/schema.sql

mysql -uzabbix -pabc123 zabbix < /root/zabbix-6.0.1/database/mysql/images.sql

mysql -uzabbix -pabc123 zabbix < /root/zabbix-6.0.1/database/mysql/data.sql

           #移动zabbix前端页面到网站根目录

cp -rf /root/zabbix-6.0.1/ui/* /data/nginx/

vim /usr/lib/systemd/system/zabbix-server.service

[Unit]

Description=Zabbix Server with MySQL DB

After=syslog.target network.target mysqld.service    

[Service]

Type=simple

ExecStart=/usr/local/sbin/zabbix_server -f

User=zabbix

[Install]

WantedBy=multi-user.target

           #重新加载system文件

systemctl daemon-reload

systemctl enable zabbix-server

systemctl start zabbix-server

1.6、Web端初始化    

1)、输入IP直接跳转至zabbix网页端

2)、这里已经调整过PHP的配置文件,如果还有问题的可以编辑/etc/php.ini ,调整对应字段的值即可    

3)、配置DB连接

4)、这里自定义Zabbix主机名称即可    

5)、安装

cp /data/nginx/conf/zabbix.conf.php.example /data/nginx/conf/zabbix.conf.php

chown zabbix:zabbix /data/nginx/conf/zabbix.conf.php    

vim /data/nginx/conf/zabbix.conf.php

#只修改PASSWORD的密码

$DB['PASSWORD']                 = 'abc123';

默认账号密码:Admin zabbix

1.7、解决zabbix 6.0 中文乱码问题    

将window的C:\Windows\Fonts路径下将楷体的ttf文件复制到linux的 /data/web/assets/fonts 目录下

#替换配置文件中的默认字体

sed -i 's/DejaVuSans/simkai/g' /data/nginx/include/defines.inc.php

zabbix不支持主机名中存在中文字符的,要让zabbix主机名支持中文,需要修改zabbix的php配置文件

vim /data/nginx/include/defines.inc.php

#将下面的字段(大概在1198 行)

define('ZBX_PREG_INTERNAL_NAMES', '([0-9a-zA-Z_\. \-]+)');

改成

define('ZBX_PREG_INTERNAL_NAMES', '([0-9a-zA-Z_\. \-\x{80}-\x{ff}]+)');

重启zabbix-server:

systemctl restart zabbix-server

2、zabbix agent端安装    

rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/6.0/rhel/7/x86_64/zabbix-agent-6.0.1-1.el7.x86_64.rpm?spm=a2c6h.25603864.0.0.4a7e7a10tEvrPp --nodeps

rpm -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/pcre2-10.23-2.el7.x86_64.rpm

vim /etc/zabbix/zabbix_agentd.conf

PidFile=/var/run/zabbix/zabbix_agentd.pid    

LogFile=/var/log/zabbix/zabbix_agentd.log

LogFileSize=0

Server=192.168.52.20

ServerActive=127.0.0.1

Hostname=Zabbix server

Include=/etc/zabbix/zabbix_agentd.d/*.conf

启动Zabbix-agent服务:

systemctl start zabbix-agent

systemctl status zabbix-agent       

http://www.dtcms.com/wzjs/98231.html

相关文章:

  • 开发动态网站价格网络营销的特点举例说明
  • 做系统后之前网站怎么找回打开百度网页版
  • 做网站公司哪家比较好哪里有竞价推广托管
  • dw中怎样做网站二级页面潍坊网站定制模板建站
  • 上海哪家公司做网站比较好网络广告推广方法
  • 品牌建设公司网站专门制作小程序的公司
  • 手机p2p网站开发营业推广促销方式有哪些
  • 太原做网站设计百度快照查询
  • 网站备案网站简介肇庆网站制作软件
  • 深圳公司注册材料商丘seo公司
  • 靖江建设行业协会网站重庆百度seo整站优化
  • 做网站收费标准点击量杭州网站关键词排名
  • 新手搭建网站长沙互联网推广公司
  • 沈阳网站建设培训短视频营销的特点
  • 深圳前十设计公司关键词搜索优化公司
  • wordpress投稿插件 submit posts免费的seo网站下载
  • 做外贸的网站主要有哪些营销软文范文200字
  • 一级a做爰片免费网站短视频播放国外搜索引擎排名
  • 淄博高端网站建设网络推广策划方案怎么写
  • 武汉做网站及logo的公司广州seo优化
  • 怎么做网站或APP珠海seo快速排名
  • wordpress微信管理seo网络推广是什么意思
  • 浙江建设职业技术学院塘栖校区网站优化新十条
  • 个人微博网站设计每日新闻播报
  • 武汉做网站报价软文案例
  • 杭州市公共资源交易中心百度推广优化
  • 台州做网站的电话成都网站维护
  • 排版设计素材宁波seo费用
  • 免费网站设计神器厦门seo关键词优化培训
  • 今日头条wordpress主题google seo怎么做