码迷,mamicode.com
首页 > 其他好文 > 详细

lamp----6 实现虚拟主机ssl安全

时间:2017-02-06 12:37:45      阅读:303      评论:0      收藏:0      [点我收藏+]

标签:tor   ice   rtu   rri   start   httpd   require   src   x86_64   

yum install mod_ssl.x86_64   #安装加密组件

cd /etc/pki/tls/certs/    #必须在此目录下make

make han.pem

chmod +x han.pem

vi /etc/httpd/conf.d/ssl.conf

SSLCertificateFile /etc/pki/tls/certs/han.pem

SSLCertificateKeyFile /etc/pki/tls/certs/han.pem

技术分享

 

vi /etc/httpd/conf/httpd.conf

SSLStrictSNIVHostCheck on
NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:443>
ServerName www.han.com
DocumentRoot /web/upload
SSLEngine on
SSLCertificateFile "/etc/pki/tls/certs/han.pem"
SSLCertificateKeyFile "/etc/pki/tls/certs/han.pem"
<Directory "/web/upload">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/log/httpd/142error.log
CustomLog /var/log/httpd/142access.log combined
</VirtualHost>

<VirtualHost 192.168.1.142:80>
ServerName www.lei.com
DocumentRoot /var/www/html/upload

<Directory "/var/www/html/upload">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/log/httpd/143error.log
CustomLog /var/log/httpd/143access.log combined
</VirtualHost>

技术分享

 

systemctl restart httpd.service

访问 https://www.han.com/    测试

技术分享

 

lamp----6 实现虚拟主机ssl安全

标签:tor   ice   rtu   rri   start   httpd   require   src   x86_64   

原文地址:http://www.cnblogs.com/han1094/p/6369532.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!