首页 技术 正文
技术 2022年11月11日
0 收藏 603 点赞 3,784 浏览 866 个字

[root@liubin-pc ~]# yum install -y httpd

客户机地址限制

通过配置Order、Deny from、Allow from 来限制客户机

allow、deny :先”允许”后”拒绝” ,默认拒绝所有为明确的客户机地址。

deny、allow:先”拒绝”后”允许”,默认允许所有为明确的客户机地址

用户授权限制

httpd服务器支持使用摘要认证(Digest)和基本认证(Basic)两种方式。使用摘要认证需要在编译httpd之前添加”–enable-auth-digest”选项、但并不是所有的浏览器都支持摘要认证、基本认证不需要预先配置。

[root@liubin-pc ~]# vim /etc/httpd/conf/httpd.conf

<Directory “/var/www/html/”>     #设置权限的页面路径
AllowOverride None  #是否允许覆盖访问控制

[Options Indexes FollowSymLinks ]
Order allow,deny
Allow from all
AuthName “Jfedu Access”         #定义受保护领域的名称 
AuthType Basic      #设置认证类型,Basic表示基本认证
AuthUserFile /etc/httpd/conf/htpasswd.users     #设置用于用户账号,密码的认证文件路径
Require valid-user     #要求认证文件存在的用户才能访问
</Directory

重启服务

/etc/inint.d/httpd restart

[root@liubin-pc ~]# htpasswd -c /etc/httpd/conf/htpasswd.users bxy   #创建认证用户

[root@liubin-pc ~]# cat /etc/httpd/conf/htpasswd.users 

bxy:0PsCdMzno5PiY
admin:pe7Zf54sJJPA2

省略-c选择、表示用户数据文件已经存在、添加新用户或修改现有用户的密码、则不需要指定-c选项

验证访问控制

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,024
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,514
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,362
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,143
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,776
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,854