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

公司网站如何维护wordpress去掉title前空格及keywords最后的逗号

公司网站如何维护,wordpress去掉title前空格及keywords最后的逗号,响应式网站pad尺寸,百度应用商店官网nginx-下载功能-状态统计-访问控制一、利用nginx做网站提供下载功能1. 进入nginx存放配置文件目录2. 编辑nginx.conf文件,开启下载功能3. 检查nginx.conf主配置文件是否正确4. 重启nginx服务5. 修改首页文件index.html6. 访问首页7. 去网页根目录下新建download目录…

nginx-下载功能-状态统计-访问控制

  • 一、利用nginx做网站提供下载功能
    • 1. 进入nginx存放配置文件目录
    • 2. 编辑nginx.conf文件,开启下载功能
    • 3. 检查nginx.conf主配置文件是否正确
    • 4. 重启nginx服务
    • 5. 修改首页文件index.html
    • 6. 访问首页
    • 7. 去网页根目录下新建download目录
    • 8. 访问download页面
  • 二、状态统计
    • 1. 添加路由配置
    • 2. 重启nginx服务
    • 3. 访问nginx
  • 三、访问控制
    • 1. 基于ip地址
    • 2. 基于用户认证


一、利用nginx做网站提供下载功能

1. 进入nginx存放配置文件目录

[root@web-2 logs]# cd /usr/local/nginx1/conf/
[root@web-2 conf]# ls
fastcgi.conf fastcgi_params koi-utf mime.types nginx.conf scgi_params uwsgi_params win-utf
fastcgi.conf.default fastcgi_params.default koi-win mime.types.default nginx.conf.default scgi_params.default uwsgi_params.default


2. 编辑nginx.conf文件,开启下载功能

[root@web-2 conf]# vim nginx.confserver {listen       80;server_name  www.feng.com;access_log  logs/feng.com.access.log  main;error_log  logs/feng.com.error.log;location / {root   html/feng.com;index  index.html index.htm;autoindex on;  #添加配置可以提供下载功能的指令}

3. 检查nginx.conf主配置文件是否正确

[root@web-2 conf]# nginx -t
nginx: the configuration file /usr/local/nginx1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx1/conf/nginx.conf test is successful

4. 重启nginx服务

[root@web-2 conf]# nginx -s reload


5. 修改首页文件index.html

[root@web-2 conf]# cd /usr/local/nginx1/html/feng.com/
[root@web-2 feng.com]# vim index.html 
<html><head><title>sanchuang</title></head><body><p><h1>welcome to sanchuang</h1></p><p><a href="http://www.feng.com/download">http://www.feng.com/download</a></p></body>
</html>

修改网页,不需要去刷新nginx服务,只要刷新浏览器


6. 访问首页

  1. 在浏览器里去访问http://www.feng.com首页文件

浏览器中访问

  1. linux中访问 -> curl
[root@web-2 feng.com]# curl  http://www.feng.com
<html><head><title>sanchuang</title></head><body><p><h1>welcome to sanchuang</h1></p><p><a href="http://www.feng.com/download">http://www.feng.com/download</a></p></body>
</html>

7. 去网页根目录下新建download目录

[root@web-2 feng.com]# cd /usr/local/nginx1/html/feng.com/
[root@web-2 feng.com]# mkdir download
[root@web-2 feng.com]# ls
404.html download index.html

在download目录下新建文件,提供下载测试使用

建议download目录下不要出现index.html,如果有的话,会自动显示index.html页面的内容

[root@web-2 feng.com]# cd download/
[root@web-2 download]# cp /boot . -r
[root@web-2 download]# touch feng.txt
[root@web-2 download]# touch zhang.txt
[root@web-2 download]# cp /etc/hosts .
[root@web-2 download]# ls
boot feng.txt hosts index.html.back index.html.back2 passwd zhang.txt


8. 访问download页面

点击即可下载
在这里插入图片描述


二、状态统计

状态统计功能,默认是没有开启的,需要在编译安装的时候,指定参数开启
--with-http_stub_status_module

1. 添加路由配置

[root@web-2 nginx1]# cd /usr/local/nginx1/conf/
[root@nginx-1 conf]# vim nginx.confserver {listen       80;server_name  localhost;location / {root   html;index  index.html index.htm;}#添加下面的路由配置location = /status {stub_status;}

2. 重启nginx服务

[root@nginx-1 conf]# nginx -t
nginx: the configuration file /usr/local/nginx1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx1/conf/nginx.conf test is successful
[root@nginx-1 conf]# nginx -s reload


3. 访问nginx

可以使用ip地址或者域名,接上/status
http://192.168.100.157/status

得到如下状态信息

Active connections: 2 
server accepts handled requests9 9 15 
Reading: 0 Writing: 1 Waiting: 1 
  • Active connections
    当前活动的客户端连接数,包括Waiting连接数。
  • accepts
    接受的客户端连接总数。
  • handled
    已处理的连接总数。通常,参数值与accepts 除非达到某些资源限制(例如, worker_connections限制)相同。
  • requests
    客户端请求总数。
  • Reading
    nginx正在读取请求标头的当前连接数。 --》读取请求报文
  • Writing
    nginx正在将响应写回到客户端的当前连接数。 --》返回响应报文
  • Waiting
    当前等待请求的空闲客户端连接数 --》占着茅坑不拉屎的人的数量

三、访问控制

1. 基于ip地址

allow和deny指令将按其定义的顺序应用

deny

[root@nginx-1 conf]# vim nginx.conflocation = /status {stub_status;deny 192.168.100.1;}[root@nginx-1 conf]# nginx -t
nginx: the configuration file /usr/local/nginx1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx1/conf/nginx.conf test is successful
[root@nginx-1 conf]# nginx  -s reload

allow

[root@nginx-1 conf]# vim nginx.conflocation = /status {stub_status;allow 192.168.100.1;deny all;}[root@nginx-1 conf]# nginx  -t
nginx: the configuration file /usr/local/nginx1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx1/conf/nginx.conf test is successful
[root@nginx-1 conf]# nginx  -s reload

2. 基于用户认证

编辑配置文件,重启nginx服务

[root@nginx-1 conf]# vim nginx.conflocation = /status {stub_status;auth_basic "status auth";  #添加的配置auth_basic_user_file  htpasswd;  #添加的配置allow 192.168.100.1;deny all;}
[root@nginx-1 conf]# nginx  -t
nginx: the configuration file /usr/local/nginx1/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx1/conf/nginx.conf test is successful
[root@nginx-1 conf]# nginx  -s reload

新建htpasswd文件

[root@nginx-1 conf]# yum install httpd-tools -y
[root@nginx-1 conf]# htpasswd -c /usr/local/nginx1/conf/htpasswd cali
New password: 
Re-type new password: 
Adding password for user cali
# 查看生成的用户名和密码文件内容
[root@nginx-1 conf]# cat htpasswd  
cali:$apr1$6yRM3Suq$wf5MfqAMtRKFE9oxIPSsz/

访问验证是否生效,支持用户名和密码认证
使用浏览器去访问

在这里插入图片描述

http://www.dtcms.com/a/449807.html

相关文章:

  • 仙居谁认识做网站的广告投放平台代理
  • 智慧餐厅管理系统qq群排名优化软件官网
  • InnoDB核心限制与应对策略
  • 贵州建设厅监理协会网站前后端分离实现网站开发
  • QNX 开发环境搭建
  • Java技术栈 —— 使用MinIO进行大文件分片上传与下载
  • `modprobe`命令 与 `KVM`模块 笔记251006
  • 山东省建设监理协会网站打不开赣州招聘网最新招聘
  • 贵阳网站建设设计个人网页设计作品集分析
  • 音乐介绍网站怎么做做暧暧小视频网站
  • 公网带宽1m能建设电商网站吗wordpress新建数据库
  • C57-断言函数assert
  • 网站的制作建站人汽车业务网站开发公司
  • 详解指针2
  • 第一章 :感知机(上)
  • 做网站都要会些什么设计网站建设合同书6
  • 网站开发工程师 能做什么响应式布局的概念
  • 反激开关电源
  • 长沙网站建设外贸0基础做电商从何下手
  • vs2015做网站做民宿需要和多家网站合作吗
  • 集团型网站建设室内设计平面图简单
  • 比利时网站后缀用php做的网站前后台模板
  • 视频网站如何做微信营销长春火车站和高铁站是一个站吗
  • steamdeck 龙神Ryujinx模拟器输入控制器无效
  • 彩票网站网站建设路由器上建网站
  • 网站建设如何推广业务如何备份wordpress网页
  • linux学习笔记(16)进程间通信——管道
  • 巩义网站建设定制电子商城系统开发
  • AI编程开发系统020-基于Vue+SpringBoot的景云手机维修管理网站系统(源码+部署说明+演示视频+源码介绍+lw)
  • 【算法】【优选算法】BFS 解决拓扑排序