|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!这里复杂演示一下Apache下基于加密的认证会见―-https加密体例会见。
1.DNS剖析这里不再赘述了哈,相见本次演示的dns剖析情形:[root@localhosthtml]#nslookupwww.abc.com
Server:192.168.2.115
Address:192.168.2.115#53
Name:www.abc.com
Address:192.168.2.115 2.装置ApacheSSL撑持模块:#yuminstall-ymod_ssl(默许yum装置httpd是没有装置该模块的,装置后主动临盆/etc/httpd/conf.d/ssl.conf文件)并天生证书。[root@localhostcerts]#pwd
/etc/pki/tls/certs
[root@localhostcerts]#ls
ca-bundle.crtindex.htmllocalhost.crtMakefile
ca-bundle.trust.crtlocalhost1.crtmake-dummy-cert
[root@localhostcerts]#opensslreq-utf8-new-key../private/localhost.key-x509-days3650-outabc_com.crt
Youareabouttobeaskedtoenterinformationthatwillbeincorporated
intoyourcertificaterequest.
WhatyouareabouttoenteriswhatiscalledaDistinguishedNameoraDN.
Therearequiteafewfieldsbutyoucanleavesomeblank
Forsomefieldstherewillbeadefaultvalue,
Ifyouenter‘.’,thefieldwillbeleftblank.
―C
CountryName(2lettercode)[XX]:CN
StateorProvinceName(fullname)[]:510510
LocalityName(eg,city)[DefaultCity]:GZ
OrganizationName(eg,company)[DefaultCompanyLtd]:ABC.COM
OrganizationalUnitName(eg,section)[]:Mr.Zhang
CommonName(eg,yournameoryourserver’shostname)[]:www.abc.com
EmailAddress[]:root@abc.com
[root@localhostcerts]# 3.设置Apache,基础设置这里未几说了,上面是设置www.abc.com站点http会见的情形。[root@localhosthtml]#tail-n8/etc/httpd/conf/httpd.conf
NameVirtualhost192.168.2.115:80
<VirtualHostwww.abc.com:80>
ServerAdminwebmaster@dummy-host.example.com
DocumentRoot/var/www/html
ServerNamewww.abc.com
ErrorLoglogs/dummy-host.example.com-error_log
CustomLoglogs/dummy-host.example.com-access_logcommon
</VirtualHost>
[root@localhosthtml]#tail/var/www/html/index.html
www.abc.com
[root@localhosthtml]# 4.设置Apache撑持https会见www.abc.com站点,编纂vim/etc/httpd/conf.d/ssl.conf文件,制订www.abc.com站点https会见时的相干信息。增加上面设置。<VirtualHostwww.abc.com:443>
DocumentRoot“/var/www/html/www.kuteatest.net”#//为了显现效果,这里的站点目次纷歧样,一样平常情形一个域名应当指向统一目次的。
ServerNamewww.abc.com:443
ErrorLoglogs/ssl_error_log
TransferLoglogs/ssl_access_log
LogLevelwarn
SSLEngineon
SSLProtocolall-SSLv2
SSLCipherSuiteALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile/etc/pki/tls/certs/abc_com.crt
SSLCertificateKeyFile/etc/pki/tls/private/localhost.key
<Files~“.(cgi|shtml|phtml|php3?)$”>
SSLOptions+StdEnvVars
</Files>
<Directory“/var/www/cgi-bin”>
SSLOptions+StdEnvVars
</Directory>
SetEnvIfUser-Agent“.*MSIE.*”
nokeepalivessl-unclean-shutdown
downgrade-1.0force-response-1.0
CustomLoglogs/ssl_request_log
“%t%h%{SSL_PROTOCOL}x%{SSL_CIPHER}x”%r”%b”
</VirtualHost> 4.重启Apache办事,测试会见。
测试http会见的了局
测试https会见的了局
检察证手札息和自建crt信息分歧
https会见的终极了局
欢迎大家来到仓酷云论坛! |
|