系统运维
apache连接保持
apache连接保持相关参数
keepalive
是否打开连接保持,off关闭,on打开
keepalive\\\’ timeout
一次连接多次请求之间的最大间隔时间,两次请求超过该时间连接断开
maxkeepaliverequests
一次连接能够 传输的最大请求数量
apache访问控制
作用
控制对网站资源的访问
为特定的网站目录添加访问授权
常用访问控制方式
客户机地址限制
用户授权限制
基于客户端地址的访问控制
使用require配置项实现访问控制,按先后顺序限制
可用于<location>、<directory>、<files>、 <limit>配置段中
require配置项的常见语法
require all grantedrequire all deniedrequire localrequire [not] host <主机名或域名列表>//使用not禁止访问时要将其置于<requireall> </requireall>容器中并在容器中指定相应的限制策略require [not] ip <ip地址或网段列表>配置实例
在linux系统中安装dns、http服务,并设置dns服务。
[root@localhost ~]# yum install bind httpd -y //安装服务已加载插件:fastestmirror, langpacksloading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com...//省略部分内容...已安装: bind.x86_64 32:9.11.4-9.p2.el7 httpd.x86_64 0:2.4.6-90.el7.centos ...//省略部分内容... 完毕![root@localhost conf]# vim /etc/named.conf //编辑dns配置文件...//省略部分内容...options { listen-on port 53 { any; }; //更改ip地址为any listen-on-v6 port 53 { ::1; }; directory /var/named; dump-file /var/named/data/cache_dump.db; statistics-file /var/named/data/named_stats.txt; memstatistics-file /var/named/data/named_mem_stats.txt; recursing-file /var/named/data/named.recursing; secroots-file /var/named/data/named.secroots; allow-query { any; }; //更改监听主机为any...//省略部分内容... :wq[root@localhost conf]# vim /etc/named.rfc1912.zones //编辑区域配置文件...//省略部分内容...zone kgc.com in { //更改域名 type master; file kgc.com.zone; //更改区域数据文件名 allow-update { none; };};...//省略部分内容...:wq[root@localhost conf]# cd /var/named/ //进入区域数据文件目录[root@localhost named]# ls //查看目录data dynamic named.ca named.empty named.localhost named.loopback slaves[root@localhost named]# cp -p named.localhost kgc.com.zone //复制区域数据文件[root@localhost named]# vim kgc.com.zone //进入编辑文件$ttl 1d @ in soa @ rname.invalid. ( 0 ; serial 1d ; refresh 1h ; retry 1w ; expire 3h ) ; minimum ns @ a 127.0.0.1www in a 192.168.144.133 //设置域名解析:wq //保存退出开启两台win 10客户机,并查看客户机ip地址
在linux系统中进入http服务站点目录,编辑主页内容,并开启dns、http服务,关闭防火墙及增强性安全功能
[root@localhost named]# cd /var/www/html/ //进入http服务站点目录[root@localhost html]# vim index.html //编辑默认主页<h2>this is kgc web</h2> //编辑内容:wq[root@localhost html]# ls //查看index.html [root@localhost html]# cat index.html //查看网页内容<h2>this is kgc web</h2>[root@localhost html]# systemctl start httpd.service //启动http服务[root@localhost html]# systemctl start named //启动dns服务[root@localhost html]# systemctl stop firewalld.service //关闭防火墙[root@localhost html]# setenforce 0 //关闭增强性安全功能使用两台win 10客户机分别访问往网站信息,看服务是否正常提供
在linux系统中配置http服务配置文件,设置客户机访问权限
[root@localhost html]# vim /etc/httpd/conf/httpd.conf //编辑主配置文件内容(现网中不建议直接修改主配置文件内容,可以重新添加子配置文件进行限制)...//省略部分内容...<directory /var/www/html> # # possible values for the options directive are none, all, # or any combination of: # indexes includes followsymlinks symlinksifownermatch execcgi multiviews # # note that multiviews must be named *explicitly* --- options all # doesn\\\'t give it to you. # # the options directive is both complicated and important. please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # options indexes fol
java云服务器安装.top什么类型域名?域名top使用人群多吗?云服务器免费买哪个好华为云服务器安装本地镜像我最初是在阿里云备案的这个网站阿里云服务器可放网站数量域名在我们生活中有什么作用?怎么查域名有没有被注册呢?网站在阿里云服务器上线教程