配置安全web服务

南楼画角 提交于 2020-03-11 09:12:20

为站点 http://system1.group8.example.com 配置TLS加密:

1、一个已签名证书从 http://server.group8.example.com/pub/tls/certs/system1.crt 获取

2、此证书的密钥从 http://server.group8.example.com/pub/tls/private/system1.key 获取

3、此证书的签名授权信息从 http://server.group8.example.com/pub/tls/certs/ssl-ca.crt 获取

答:

再system1上执行:

1、安装 ssl 模块

yum install mod_ssl -y

2、修改配置文件

vim /etc/httpd/conf.d/httd-vhosts.conf

<VirtualHost *:80>
    DocumentRoot "/var/www/html"
    ServerName system1.group8.example.com
    
    <Directory "/var/www/html">
        <RequireAll>
            Require all granted
            Require not host .my133t.org
        </RequireAll>
    </Directory>

    SSLEngine on
    SSLProtocol all -SSLv2 -SSLv3
    SSLCertificateKeyFile /etc/pki/tls/certs/system1.crt
    SSLCertificateKeyFile /etc/pki/tls/private/system1.key
    SSLCACertificateFile /etc/pki/tls/certs/ssl-ca.crt

</VirtualHost>

3、下载证书

# 下载证书到指定目录内
wget -O /etc/pki/tls/certs/system1.crt http://server.group8.example.com/pub/tls/certs/system1.crt
wget -O /etc/pki/tls/private/system1.key http://server.group8.example.com/pub/tls/private/system1.key
wget -O /etc/pki/tls/certs/ssl-ca.crt http://server.group8.example.com/pub/tls/certs/ssl-ca.crt

4、添加防火墙

firewall-cmd --permanent  --add-service=https
firewall-cmd --reload

5、重启web服务

systemctl restart httpd

验证:再system2上验证

curl -k https://system1.group8.example.com

 


更多详情:https://www.cnblogs.com/xiangsikai/p/9810290.html

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!