一. SSL认证
二.基于虚拟目录和用户控件
三、综合以上内容构建Web服务器(1)基于https://www.linuxprobe.com构建访问网站。 tom和jack可以访问该网站。 此页面的内容为welcome to linuxprobe,但rose无法访问此页面。
)2)基于此站点创建虚拟目录/mimi,访问此目录时显示的内容是this is linuxprobe mimi,同时只有rose可以访问此虚拟目录
具体操作:(实验环境redhat 7.2 ) )。
关闭防火墙和SELinux
[ root @ www/] # systemctlstopfirewalld
[root@www /]#setenforce 0
基本配置文件:
[ root @ www/] # VI/etc/httpd/conf.d/Linux probe.conf
目录/Linux probe /域
Authtype基本
authname “Please login:”
authuserfile/etc/httpd/my secret pwd
require user tom jack
监听器7777
虚拟主机192.168.253.128:777
文档根/Linux probe /域
servername www.linuxprobe.com
SSLEngine on
SSL协议全部- SSL v2
slciphersuitehigh :中介: aNULL: MD5: SEED: 国际货币基金组织
slcertificatefile/etc/PKI/TLS/certs/Linux probe.CRT
slcertificatekeyfile/etc/PKI/TLS/certs/Linux probe.key
目录'/Linux probe/mulu '
allowoverride none
Authtype基本
authname “Please login:”
authuserfile/etc/httpd/my secret pwd
require用户rose
listen 6666
虚拟主机192.168.253.12833606666
文档根/Linux probe/mulu
alias /mimi/linuxprobe/mulu
servername www.linuxprobe.com
SSLEngine on
SSL协议全部- SSL v2
slciphersuitehigh :中介: aNULL: MD5: SEED: 国际货币基金组织
slcertificatefile/etc/PKI/TLS/certs/Linux probe.CRT
slcertificatekeyfile/etc/PKI/TLS/certs/Linux probe.key
创建文件目录:
mkdirp/Linux probe/domain
echowelcometolinuxprobe/Linux probe/domain/index.html
mkdirp/Linux probe/mulu
echothisislinuxprobemimi/Linux probe/mulu/index.html
证书配置:/etc/pki/tls/certs
[ root @ www certs ] # makelinuxprobe.CRT
umask 77;
/usr/wld zxc/OpenSSL genrsa-AES 1282048 Linux probe1. key
Generating RSA private key,2048位长模块
.
eis65537(0x10001 ) )。
() ) ) )。
验证过程进度: (红色帽) ) )。
umask 77;
/usr/wld zxc/OpenSSL req-utf8-new-keylinuxprobe1. key-x509-days 365-outlinuxprobe1. CRT-set _ serial 0
企业级ssphraseforlinuxprobe1. key : (red hat ) )。
youareabouttobeaskedtoenterinformationthatwillbeincorporated
into your certificate request。
watyouareabouttoenteriswhatiscalledadistinguishednameoradn。
therearequiteafewfieldsbutyoucanleavesomeblank
forsomefieldstherewillbeadefaultvalue,
if you enter‘.’,the field will be left blank。
countryname(2lettercode ) [XX]:CN
stateorprovincename (完整名称) []:shaanxi
本地名称(eg,city ) [默认city ] : xian
组织名称(eg,公司) [ default companyltd ] : Linux probe
逻辑单元名称(eg,section ) []: linuxprobe
通用名称(eg,yournameoryourserver’s hostname ) []: linuxprobe
email address [ ] : Linux probe.com
添加用户:
hpasswdc/etc/httpd/mysecretpwdtom
hpasswd/etc/httpd/mysecretpwdjack
hpasswd/etc/httpd/mysecretpwdrose--------密码均为redhat
更改主机文件
[root@www /]#vim /etc/hosts
192.168.253.128 www.Linux probe.com
重新启动服务:
[ root @ wwwlinuxprobe ] # systemctlrestarthttpd.service
entersslpassphraseforwww.Linux probe.com :443 (RSA ) : ******
进行实际测试:
1.https://访问www.Linux probe.com :7777
汤姆杰克可以正常登录访问
rose登录失败。 无法访问
2.https://www.Linux probe.com :6666/Mimi /
汤姆杰克登录失败,无法访问
rose成功登录,可以实际访问/linuxprobe/mulu/index.html