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

北京网站建站系统平台巩义网络推广

北京网站建站系统平台,巩义网络推广,ui设计岗位职责,南昌做网站源码下载地址: Download Zabbix sources nginx: download 防火墙和selinux都需要关闭 1、部署监控服务器 1)安装LNMP环境 Zabbix监控管理控制台需要通过Web页面展示出来,并且还需要使用MySQL来存储数据,因此需要先为Zabbix准备基础…

源码下载地址:

Download Zabbix sources

nginx: download

防火墙和selinux都需要关闭

1、部署监控服务器

1)安装LNMP环境

Zabbix监控管理控制台需要通过Web页面展示出来,并且还需要使用MySQL来存储数据,因此需要先为Zabbix准备基础LNMP环境。

[root@zabbixserver ~]# yum -y install gcc pcre-devel  openssl-devel

[root@zabbixserver ~]# tar -xf nginx-1.12.2.tar.gz

[root@zabbixserver ~]# cd nginx-1.12.2

[root@zabbixserver nginx-1.12.2]# ./configure --with-http_ssl_module

[root@zabbixserver nginx-1.12.2]# make &&make install

[root@zabbixserver ~]# yum -y  install  php  php-mysql  php-fpm(注意,在centos8stream里没有php-mysql,需要安装php-mysqlnd

[root@zabbixserver ~]# yum -y  install  mariadb  mariadb-devel  mariadb-server

2)修改Nginx配置文件

配置Nginx支持PHP动态网站,因为有大量PHP脚本需要执行,因此还需要开启Nginx的各种fastcgi缓存,加速PHP脚本的执行速度。

[root@zabbixserver ~]# vim /usr/local/nginx/conf/nginx.conf

… …

http{

… …

    fastcgi_buffers 816k;              #缓存php生成的页面内容,8个16k

    fastcgi_buffer_size 32k;              #缓存php生产的头部信息,32k

    fastcgi_connect_timeout 300;    #连接PHP的超时时间,300

    fastcgi_send_timeout 300;             #发送请求的超时时间,300

    fastcgi_read_timeout 300;            #读取请求的超时时间,300

location ~\.php$ {

     root           html;

     fastcgi_pass   127.0.0.1:9000;

     fastcgi_index  index.php;

     include        fastcgi.conf;#[注意这里别出错]

}

… …

3)启动服务

启动Nginx、PHP-FPM、MariaDB服务,关闭SELinux与防火墙。

[root@zabbixserver ~]# systemctl start  mariadb        #启动服务

[root@zabbixserver ~]# systemctl start  php-fpm        #启动服务

[root@zabbixserver ~]# systemctl enable  mariadb        #设置开机自启

[root@zabbixserver ~]# systemctl enable  php-fpm        #设置开机自启

[root@zabbixserver ~]# /usr/local/nginx/sbin/nginx        #启动服务

[root@zabbixserver ~]# echo /usr/local/nginx/sbin/nginx  >>/etc/rc.local

[root@zabbixserver ~]# chmod +x /etc/rc.local

#通过rc.local设置开机自启

[root@zabbixserver ~]# firewall-cmd --set-default-zone=trusted

[root@zabbixserver ~]# setenforce 0

[root@zabbixserver ~]# sed -i '/SELINUX/s/enforcing/permissive/'/etc/selinux/config

 注意:

在这里,需要验证一下php是否正常启动了:

ss -ntulp | grep php

如果没有输出,则需要修改php-fpm的配置:

[root@proxy etc]# vim /etc/php-fpm.d/www.conf

[www]

listen =127.0.0.1:9000            //PHP端口号

pm.max_children =32                //最大进程数量

pm.start_servers =15                //最小进程数量

2、部署监控服务器Zabbix Server

1)源码安装Zabbix Server

多数源码包都是需要依赖包的,zabbix也一样,源码编译前需要先安装相关依赖包。

[root@zabbixserver ]# yum -y install  net-snmp-devel \

curl-devel autoconf libevent-devel

#安装相关依赖包

[root@zabbixserver]# tar -xf zabbix-3.4.4.tar.gz

[root@zabbixserver ]# cd zabbix-3.4.4/

[root@zabbixserver zabbix-3.4.4]# ./configure  --enable-server \

--enable-proxy --enable-agent --with-mysql=/usr/bin/mysql_config \

--with-net-snmp --with-libcurl

# --enable-server安装部署zabbix服务器端软件

# --enable-agent安装部署zabbix被监控端软件

# --enable-proxy安装部署zabbix代理相关软件

# --with-mysql指定mysql_config路径

# --with-net-snmp允许zabbix通过snmp协议监控其他设备(如交换机、路由器等)

# --with-libcurl安装相关curl库文件,这样zabbix就可以通过curl连接http等服务,测试被监控主机服务的状态

[root@zabbixserver zabbix-3.4.4]# make &&make install

2)创建并初始化数据库(root用户默认没有密码)

[root@zabbixserver ~]# mysql

mysql>create database zabbix character set utf8;

#创建数据库,数据库名称为zabbix,character set utf8是支持中文字符集

mysql>grant all on zabbix.*to zabbix@'localhost'identified by 'zabbix';

#创建可以访问数据库的账户与密码,用户名是zabbix,密码是zabbix

mysql>exit

#退出数据库

[root@zabbixserver ~]# cd zabbix-3.4.4/database/mysql/

[root@zabbixserver mysql]# mysql -uzabbix -pzabbix zabbix <schema.sql

[root@zabbixserver mysql]# mysql -uzabbix -pzabbix zabbix <images.sql

[root@zabbixserver mysql]# mysql -uzabbix -pzabbix zabbix <data.sql

#刚刚创建是空数据库,zabbix源码包目录下,有提前准备好的数据

#使用mysql导入这些数据即可(注意导入顺序)

如果导入有如下问题:

[root@zabbix mysql]# mysql -uzabbix -pzabbix zabbix < schema.sql ERROR 1118 (42000) at line 1244: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

修改my.cnf文件,添加或修改以下参数([root@zabbix mysql]# ls /etc/my.cnf):

innodb_file_per_table=1

innodb_file_format=Barracuda

innodb_strict_mode=0

 

#-u指定数据库用户名,-p指定数据库密码

如何测试?

[root@zabbixserver ~]# mysql -uzabbix -pzabbix -h localhost zabbix

#-u指定用户名,-p指定密码,-h指定服务器IP,最后的zabbix是数据库名称

#使用zabbix账户(密码为zabbix)连接localhost服务器上面的zabbix数据库

mysql>show tables;

#查看有没有数据表

mysql>exit

#退出数据库

 

3)修改zabbix_server配置并启动监控服务

修改Zabbix_server配置文件,设置数据库相关参数,启动Zabbix_server服务

[root@zabbixserver ~]# vim /usr/local/etc/zabbix_server.conf

DBHost=localhost

# 85行,定义哪台主机为数据库主机,localhost为本机

DBName=zabbix

#95行,设置数据库名称

DBUser=zabbix

#111行,设置数据库账户

DBPassword=zabbix

#119行,设置数据库密码

LogFile=/tmp/zabbix_server.log    

#38行,日志的位置,排错使用,该行仅查看即可

AllowUnsupportedDBVersions=1

 

[root@zabbixserver ~]# useradd -s /sbin/nologin zabbix

#服务不允许以root身份启动,不创建用户无法启动服务(用户不需要登录系统)

#创建zabbix用户才可以以zabbix用户的身份启动服务

#启动服务后可以通过ps aux查看进程是以什么用户的身份启动的

 

通过创建service文件管理zabbix服务。

[root@zabbixserver ~]# vim /usr/lib/systemd/system/zabbix_server.service

[Unit]

Description=zabbix server

After=network.target remote-fs.target nss-lookup.target

[Service]

Type=forking

PIDFile=/tmp/zabbix_server.pid

ExecStart=/usr/local/sbin/zabbix_server

ExecStop=/bin/kill $MAINPID

[Install]

WantedBy=multi-user.target

[root@zabbixserver ~]# systemctl  enable  zabbix_server  --now

[root@zabbixserver ~]# ss -ntulp |grep zabbix_server     #确认连接状态,端口10051

tcp LISTEN 0128*:10051*:*users:(("zabbix_server",pid=23275,fd=4),("zabbix_server",pid=23274,fd=4)

4) 修改Zabbix_agent配置文件,启动Zabbix_agent服务

[root@zabbixserver ~]# vim /usr/local/etc/zabbix_agentd.conf

Server=127.0.0.1,192.168.2.5            #93行,允许哪些主机监控本机

ServerActive=127.0.0.1,192.168.2.5        #134行,允许哪些主机通过主动模式监控本机

Hostname=zabbix_server                #145行,设置本机主机名(名称可以任意)

LogFile=/tmp/zabbix_agentd.log            #设置日志文件(不需要修改)

UnsafeUserParameters=1                #280行,是否允许自定义监控传参

编写zabbix_agentd的service文件,通过systemd管理服务。

[root@zabbixserver ~]#  vim /usr/lib/systemd/system/zabbix_agentd.service

[Unit]

Description=zabbix agent

After=network.target remote-fs.target nss-lookup.target

[Service]

Type=forking

PIDFile=/tmp/zabbix_agentd.pid

ExecStart=/usr/local/sbin/zabbix_agentd

ExecStop=/bin/kill $MAINPID

[Install]

WantedBy=multi-user.target

[root@zabbixserver ~]# systemctl enable  zabbix_agentd   --now

[root@zabbixserver ~]# ss -ntulp |grep zabbix_agentd   #查看端口信息为10050

tcp    LISTEN     0128*:10050*:*users:(("zabbix_agentd",pid=23505,fd=4),("zabbix_agentd",pid=23504,fd=4)

5)上线Zabbix的Web页面

[root@zabbixserver ~]# cd zabbix-3.4.4/frontends/php/

[root@zabbixserver php]# cp -r */usr/local/nginx/html/

[root@zabbixserver php]# chown -R  apache.apache /usr/local/nginx/html/

#这里修改所有者使用:或者.都可以。

#修改权限的原因如下:

#php-fpm的账户是apache,后面我们需要让php-fpm对网站目录具有读写操作,

#而/usr/local/nginx/html默认是root所有,仅root具有写权限,php-fpm无写权限

浏览器访问Zabbix_server服务器的Web页面

火狐浏览器访问【 firefox http://192.168.2.5/index.php

#第一次访问,初始化PHP页面会检查计算机环境是否满足要求,如果不满足会给出修改建议

#默认会提示PHP的配置不满足环境要求,需要修改PHP配置文件

根据错误提示,安装依赖、修改PHP配置文件,满足Zabbix_server的环境要求。

[root@zabbixserver ~]# yum -y install  php-gd  php-xml

[root@zabbixserver ~]# yum -y install  php-bcmath  php-mbstring

[root@zabbixserver ~]# vim /etc/php.ini

date.timezone =Asia/Shanghai                #878行,设置时区

max_execution_time =300                    #384行,最大执行时间,秒

post_max_size =32M                        #672行,POST数据最大容量

max_input_time =300                        #394行,服务器接收数据的时间限制

[root@zabbixserver ~]# systemctl restart php-fpm

3、部署被监控主机Zabbix Agent

1)源码安装Zabbix agent软件

在2.100和2.200做相同操作(以web1为例)。

[root@web1 ~]# useradd -s /sbin/nologin  zabbix

[root@web1 ~]# yum -y install gcc pcre-devel autoconf

[root@web1 ~]# tar -xf zabbix-3.4.4.tar.gz

[root@web1 ~]# cd zabbix-3.4.4/

[root@web1 zabbix-3.4.4]# ./configure --enable-agent

[root@web1 zabbix-3.4.4]# make &&make install

2)修改agent配置文件,启动Agent

[root@web1 ~]# vim /usr/local/etc/zabbix_agentd.conf

Server=127.0.0.1,192.168.2.5                #93行,谁可以监控本机(被动监控模式)

ServerActive=127.0.0.1,192.168.2.5            #134行,谁可以监控本机(主动监控模式)

Hostname=web1                                    #145行,被监控端自己的主机名

EnableRemoteCommands=1    

#69行,监控异常后,是否允许服务器远程过来执行命令,如重启某个服务

UnsafeUserParameters=1                    #280行,是否允许自定义key传参

[root@web1 ~]# firewall-cmd --set-default-zone=trusted

[root@web1 ~]# sed -'/SELINUX/s/enforcing/permissive/'/etc/selinux/config

[root@web1 ~]# setenforce 0

[root@web1 ~]# vim /usr/lib/systemd/system/zabbix_agentd.service

[Unit]

Description=zabbix agent

After=network.target remote-fs.target nss-lookup.target

[Service]

Type=forking

PIDFile=/tmp/zabbix_agentd.pid

ExecStart=/usr/local/sbin/zabbix_agentd

ExecStop=/bin/kill $MAINPID

[Install]

WantedBy=multi-user.target

[root@web1 ~]# systemctl enable  zabbix_agentd   --now

#启动服务器并设置开机自启动


文章转载自:
http://theia.yzkf.cn
http://tucket.yzkf.cn
http://chromaticity.yzkf.cn
http://gastropodous.yzkf.cn
http://linkwork.yzkf.cn
http://unsung.yzkf.cn
http://confirmative.yzkf.cn
http://endoblast.yzkf.cn
http://skerry.yzkf.cn
http://chronicles.yzkf.cn
http://locator.yzkf.cn
http://riverbed.yzkf.cn
http://harrovian.yzkf.cn
http://quantise.yzkf.cn
http://intitle.yzkf.cn
http://phylon.yzkf.cn
http://leaderless.yzkf.cn
http://hardtop.yzkf.cn
http://raised.yzkf.cn
http://actinouranium.yzkf.cn
http://restrainedly.yzkf.cn
http://inattentively.yzkf.cn
http://matchwood.yzkf.cn
http://euthanasia.yzkf.cn
http://spiritualise.yzkf.cn
http://store.yzkf.cn
http://satirise.yzkf.cn
http://wfdy.yzkf.cn
http://howdah.yzkf.cn
http://velarization.yzkf.cn
http://manners.yzkf.cn
http://ordure.yzkf.cn
http://nonprofit.yzkf.cn
http://crownpiece.yzkf.cn
http://phototube.yzkf.cn
http://headforemost.yzkf.cn
http://kismet.yzkf.cn
http://vegetably.yzkf.cn
http://average.yzkf.cn
http://inexact.yzkf.cn
http://psychical.yzkf.cn
http://articular.yzkf.cn
http://cytoecology.yzkf.cn
http://rector.yzkf.cn
http://hinduize.yzkf.cn
http://searching.yzkf.cn
http://leatherwood.yzkf.cn
http://plunderous.yzkf.cn
http://striolate.yzkf.cn
http://kingwana.yzkf.cn
http://idahoan.yzkf.cn
http://anchorless.yzkf.cn
http://uma.yzkf.cn
http://apennine.yzkf.cn
http://theodosia.yzkf.cn
http://expansionist.yzkf.cn
http://kennelly.yzkf.cn
http://incan.yzkf.cn
http://holophotal.yzkf.cn
http://dhole.yzkf.cn
http://protohistory.yzkf.cn
http://hametz.yzkf.cn
http://epizooty.yzkf.cn
http://streetwalker.yzkf.cn
http://dulosis.yzkf.cn
http://cranked.yzkf.cn
http://concentrical.yzkf.cn
http://fiche.yzkf.cn
http://whoof.yzkf.cn
http://cynosure.yzkf.cn
http://beech.yzkf.cn
http://salicylate.yzkf.cn
http://protract.yzkf.cn
http://extemporization.yzkf.cn
http://hydrodesulfurization.yzkf.cn
http://sylvestral.yzkf.cn
http://resorcinolphthalein.yzkf.cn
http://hematocrit.yzkf.cn
http://bubu.yzkf.cn
http://interneuron.yzkf.cn
http://patrolette.yzkf.cn
http://mit.yzkf.cn
http://rasher.yzkf.cn
http://monohull.yzkf.cn
http://tarada.yzkf.cn
http://masculinity.yzkf.cn
http://dugout.yzkf.cn
http://gyrostabilized.yzkf.cn
http://saturnic.yzkf.cn
http://untilled.yzkf.cn
http://enthrall.yzkf.cn
http://crepitation.yzkf.cn
http://singer.yzkf.cn
http://foco.yzkf.cn
http://unreason.yzkf.cn
http://bedmaker.yzkf.cn
http://stowage.yzkf.cn
http://bailie.yzkf.cn
http://fluxmeter.yzkf.cn
http://rice.yzkf.cn
http://www.15wanjia.com/news/100748.html

相关文章:

  • 建设部网站技术负责人业绩表郑州网站seo优化
  • 广州网站运营专业乐云seo百度视频下载
  • 国家建设部网站怎么联系百度人工服务
  • .net网站开发全过程怎么样优化网站seo
  • 免费连接wifi的软件优化设计单元测试卷
  • 群辉可以做网站服务器吗手机优化软件排行
  • 如何做网站答题领红包链接广西南宁做网站的公司
  • wordpress新手seo百度关键词排名
  • 8848网站盈利模式站长工具查询网站信息
  • 模板网站也需要服务器吗最新全国疫情消息
  • 成都家具企业网站建设徐州seo招聘
  • 长治做网站哪家好个人网页模板
  • 做网站沈阳百度推广销售话术
  • webform做网站 适应屏幕大小宁波seo排名外包
  • 公司简历模板范文填写电商seo优化
  • 高端网站建设 企业网站建站教育培训加盟
  • 开发系统 平台西安seo服务培训
  • 网站如何做图片自动切换今日小说排行榜
  • rob为翁美玲做的网站天天广告联盟
  • 深圳租房建设局网站链接提交入口
  • golang做网站怎么样推广手段和渠道有哪些
  • 做专利费减是哪个网站培训机构管理系统哪个好
  • 网站提交入口大全岳阳网站建设推广
  • 女网友叫我一起做优惠券网站window优化大师
  • 个人网站备案需要盖章吗在哪里推广比较好
  • 品牌网站制作流程图西安网站seo推广
  • 网站软文营销东莞网站seo推广
  • 做定制网站拓客软件哪个好用
  • 百度站长平台工具网站推广的基本方法有哪些
  • 用别的域名给网站做竞价百度手机点击排名工具