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

十大免费建站程序wordpress长春网站优化哪家好

十大免费建站程序wordpress,长春网站优化哪家好,有后台的网站如何建设,自己做的网站怎么接入数据库一、判断当前磁盘剩余空间是否有20G,如果小于20G,则将报警邮件发送给管理员,每天检查一次磁盘剩余空间。 二、判断web服务是否运行 三、使用curl命令访问第二题的web服务,看能否正常访问,如果能正常访问,…

一、判断当前磁盘剩余空间是否有20G,如果小于20G,则将报警邮件发送给管理员,每天检查一次磁盘剩余空间。

二、判断web服务是否运行

三、使用curl命令访问第二题的web服务,看能否正常访问,如果能正常访问,则返回web server is running;如果不能正常访问,返回12状态码。


一、判断当前磁盘剩余空间是否有20G,如果小于20G,则将报警邮件发送给管理员,每天检查一次磁盘剩余空间。

        1.服务端和客户端安装mailx和postfix

[root@A ~]# yum install postfix -y
[root@A ~]# systemctl enable postfix --now[root@B ~]# yum install sendmail -y

        2.编写脚本

set from=2151208022@qq.com             
set smtp=smtp.qq.com                   
set smtp-quth-user=2151208022@qq.com   
set smtp-auth-password=QMSWZJIRXHTVILLU
set smtp-auth=login  

         3.判断当前磁盘剩余空间是否由20G

a=`df -m | grep -w /boot | tr -s " " " "|cut -d " " -f 4`
b=`df -m | grep -w / | tr -s " " " "|cut -d " " -f 4`
c=$((a+b))
free=$((c/1024))
if [ $free -lt 20 ]
thenecho 空间不足!| mail -s "内存报警!" redhat
fi

       4.设置任务计划 

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root# For details see man 4 crontabs# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
0 0 * * * root /root/mail.sh

二、判断web服务是否运行

        1.下载httpd包

[root@A~]# yum install httpd -y

        2.编写脚本

ps_httpd=`ps -ef | grep httpd | grep -v grep | wc -l`
if [[ $ps_httpd > 0 ]];thenecho "httpd.server is runing"
elsesystemctl start httpdsystemctl stop firewalld
fi                                      

        3.测试

[root@A ~]# bash httpd.sh 
httpd.server is runing

三、使用curl命令访问第二题的web服务,看能否正常访问,如果能正常访问,则返回web server is running;如果不能正常访问,返回12状态码。

        1.编写脚本

curl -s 192.168.90.132 > /dev/null
if [[ $? = 0 ]];thenecho "web server is runing"
elseexit 10
fi

        2.测试

[root@A ~]# systemctl restart httpd
[root@A ~]# systemctl status httpd
● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; ven>Active: active (running) since Sun 2023-05-28 12:40:28 CST; 8s agoDocs: man:httpd.service(8)Main PID: 5895 (httpd)Status: "Started, listening on: port 80"Tasks: 213 (limit: 10756)Memory: 47.9MCPU: 82msCGroup: /system.slice/httpd.service├─5895 /usr/sbin/httpd -DFOREGROUND├─5896 /usr/sbin/httpd -DFOREGROUND├─5897 /usr/sbin/httpd -DFOREGROUND├─5898 /usr/sbin/httpd -DFOREGROUND└─5899 /usr/sbin/httpd -DFOREGROUND5月 28 12:40:28 server.hostname.com systemd[1]: Starting The Apache HTTP >
[root@server ~]# bash web.sh 
web server is runing
[root@server ~]# systemctl stop httpd
[root@server ~]# bash web.sh 
[root@server ~]# echo $?
10
http://www.hkea.cn/news/657801/

相关文章:

  • 西安的网站设计与制作首页微信视频号怎么推广引流
  • 顺义公司建站多少钱pc端百度
  • wordpress收费资源下载关键词优化的策略
  • 广州做网站建设的公司网站公司
  • 做网络平台的网站有哪些广州网站维护
  • 网页 代码怎么做网站东莞市民最新疫情
  • 电子商务网站设计中影响客户体验的元素有搜索引擎有哪些种类
  • 网站建设难点优化关键词技巧
  • 免费行情网站链接百度知道合伙人官网
  • 餐饮公司网站建设的特点大数据智能营销
  • 济南快速排名刷关键词排名seo软件
  • 系统做网站的地方百度推广登录后台登录入口
  • 集约化网站建设情况广告公司网站制作
  • 网站制作发票字节跳动广告代理商加盟
  • 义乌做网站武汉seo推广优化公司
  • 济宁哪家网站建设公司正规谷歌浏览器 免费下载
  • 有没有女的做任务的网站广东省新闻
  • seo长尾关键词优化如何做网站推广优化
  • 网站搭建服务合同seo排名赚
  • 东莞有什么比较好的网站公司苏州关键词排名系统
  • 做中国供应商免费网站有作用吗浙江网站推广运营
  • mysql8 wordpress百度推广优化是什么意思
  • 做装修广告网站好seo推广公司招商
  • 城市模拟建设游戏网站今天最新的新闻头条新闻
  • 手机网站自适应代码品牌网络营销策划方案
  • 个人网站建设在哪里百度资源搜索平台
  • 云空间免费空间北京网站优化校学费
  • 个人网站做导航网站项目推广平台有哪些
  • 威海住房建设局网站培训学校资质办理条件
  • 做趣味图形的网站免费线上培训平台