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

企业oa系统搭建潍坊关键词优化排名

企业oa系统搭建,潍坊关键词优化排名,蔡家坡网站开发,天天联盟广告网站如何做参考我的博客文章《Centos安装nginx》,先来安装下nginx。我按照该文档操作了一遍,还是很快就能安装好nginx的。 确认可以安装成功: [rootvm1 sbin]# netstat -atunlp |grep 80 tcp 0 0 0.0.0.0:80 0.0.0.0:* …

参考我的博客文章《Centos安装nginx》,先来安装下nginx。我按照该文档操作了一遍,还是很快就能安装好nginx的。

确认可以安装成功:

[root@vm1 sbin]# netstat -atunlp |grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      21573/nginx: master[root@vm1 html]# echo changchunhua > index.html
[root@vm1 html]#
[root@vm1 html]# curl http://localhost
changchunhua

1、端口

本地:netstat ss lsof

[root@vm1 scripts]# netstat -atunlp |grep -w 80 |wc -l
1
[root@vm1 scripts]# netstat -lntup |grep nginx | wc -l
1[root@vm1 scripts]# ss -atunlp |grep -w 80 | wc -l
1
[root@vm1 scripts]# ss -atunlp |grep nginx | wc -l
1[root@vm1 scripts]# lsof -i tcp:80 | wc -l
3

远程:telnet nmap nc

[root@vm1 scripts]# nmap localhost -p 80Starting Nmap 6.40 ( http://nmap.org ) at 2023-08-02 00:17 CST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000040s latency).
Other addresses for localhost (not scanned): 127.0.0.1
PORT   STATE SERVICE
80/tcp open  httpNmap done: 1 IP address (1 host up) scanned in 0.23 seconds
[root@vm1 scripts]# nmap 127.0.0.1 -p 80 |grep open | wc -l
1
[root@vm1 scripts]# echo -e "\n" | telnet 127.0.0.1 80 2>/dev/null
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
[root@vm1 scripts]# echo -e "\n" | telnet 127.0.0.1 80 2>/dev/null |grep Connected | wc -l
1
[root@vm1 scripts]# nc -z -v 127.0.0.1 80
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 127.0.0.1:80.
Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.[root@vm1 scripts]# nc -z -v 127.0.0.1 80 &>/dev/null
[root@vm1 scripts]# echo $?
0

2、本地进程数:

[root@vm1 scripts]# ps -ef |grep nginx |grep -v grep
root      21573      1  0 00:01 ?        00:00:00 nginx: master process ./nginx
nobody    21574  21573  0 00:01 ?        00:00:00 nginx: worker process
[root@vm1 scripts]# ps -ef |grep nginx |grep -v grep | wc -l
2

3、header(http code) curl -I

4、URL(wget curl)

客户端模拟用户访问的监控方式,先通过wget和curl命令进行测试,执行wget和curl命令之后,再看返回值$?,为0,则为成功。

[root@vm1 scripts]# wget --spider --timeout=10 --tries=2 http://127.0.0.1 &>/dev/null
[root@vm1 scripts]# echo $?
0

获取字符串的方式:

[root@vm1 scripts]# curl http://127.0.0.1
changchunhua

根据HTTP响应header的结果进行判断:

[root@vm1 scripts]# curl -I -s -w "%{http_code}\n" -o /dev/null http://127.0.0.1
200

然后我们可以写出脚本:

示例1:

[root@vm1 scripts]# cat nginx_monitor1.sh
#!/bin/bash
#if [ `netstat -auntlp |grep nginx | wc -l` -gt 0 ]thenecho "nginx is running."
elseecho "Nginx is stopped."/usr/local/nginx/sbin/nginx
fi
[root@vm1 scripts]# sh nginx_monitor1.sh
nginx is running.
[root@vm1 scripts]# /usr/local/nginx/sbin/nginx -s stop
[root@vm1 scripts]# sh nginx_monitor1.sh
Nginx is stopped.
[root@vm1 scripts]# sh nginx_monitor1.sh
nginx is running.
[root@vm1 scripts]#

示例2:

[root@vm1 scripts]# cat nginx_monitor2.sh
#!/bin/bash
#if [ `lsof -i:80 | wc -l` -gt 0 ]thenecho "nginx is running."
elseecho "Nginx is stopped."/usr/local/nginx/sbin/nginx
fi[root@vm1 scripts]# sh nginx_monitor2.sh
nginx is running.
[root@vm1 scripts]# /usr/local/nginx/sbin/nginx -s stop
[root@vm1 scripts]# sh nginx_monitor2.sh
Nginx is stopped.
[root@vm1 scripts]# sh nginx_monitor2.sh
nginx is running.
[root@vm1 scripts]# lsof -i:80
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx   21771   root    6u  IPv4  37072      0t0  TCP *:http (LISTEN)
nginx   21772 nobody    6u  IPv4  37072      0t0  TCP *:http (LISTEN)

示例3:

[root@vm1 scripts]# cat nginx_monitor3.sh
#!/bin/bash
#if [ `ps -ef |grep nginx | grep -v grep | wc -l` -gt 2 ]thenecho "nginx is running."
elseecho "Nginx is stopped."/usr/local/nginx/sbin/nginx
fi

说明:

1)为什么要进程数要大于2呢?

在调试的过程中只有改成-gt 2才能启动nginx。过滤进程方式,排除自身。

http://www.dt0577.cn/news/35613.html

相关文章:

  • 做企业网站建设深圳企业黄页网
  • 大气婚纱影楼网站织梦模板微信营销推广公司
  • 网站的链接结构怎么做企业seo顾问服务阿亮
  • php网站语言切换功能如何做班级优化大师功能介绍
  • dw可以做wordpress淘宝seo软件
  • 免费空间做自己的网站网络营销推广的总结
  • 怎么自己做网站游戏智慧软文发稿平台官网
  • 网站数字证书怎么做互联网推广方式有哪些
  • 外贸营销型网站建设平台seo排名赚官网
  • 领动建站2024会爆发什么病毒
  • ps软件下载电脑版免费破解版天津seo网络
  • 河北网站开发哪家好怎么做seo信息优化
  • 建筑人才招聘哪个网站最好大连百度关键词优化
  • 网站建设投票主题seo营销推广平台
  • wordpress 做下载网武汉seo工厂
  • wordpress 4.9 php快速网站seo效果
  • wordpress 轻博客主题seo优化网站源码
  • 免费做那个的视频网站好百度seo软件
  • 奎屯网站制作谷歌海外广告投放
  • 会员中心网站模板腾讯企点app下载安装
  • 高青外贸公司网站建设怎么做自己的网站
  • 专业集团门户网站建设服务商上海推广外包
  • 东昌网站建设深圳google推广
  • 商业网站是怎么做的福州网seo
  • 廊坊网络营销北京seo公司有哪些
  • 怎样做企业手机网站建设合肥今日头条最新消息
  • java和PHP做网站哪个好6百度平台商家客服
  • 将网站打造成360免费做网站
  • 河南省住房城乡建设厅网站首页百度点击工具
  • 上海企业一户式查询网站seo优化技巧