您好,欢迎来到思海网络,我们将竭诚为您提供优质的服务! 诚征网络推广 | 网站备案 | 帮助中心 | 软件下载 | 购买流程 | 付款方式 | 联系我们 [ 会员登录/注册 ]
促销推广
客服中心
业务咨询
有事点击这里…  531199185
有事点击这里…  61352289
点击这里给我发消息  81721488
有事点击这里…  376585780
有事点击这里…  872642803
有事点击这里…  459248018
有事点击这里…  61352288
有事点击这里…  380791050
技术支持
有事点击这里…  714236853
有事点击这里…  719304487
有事点击这里…  1208894568
有事点击这里…  61352289
在线客服
有事点击这里…  531199185
有事点击这里…  61352288
有事点击这里…  983054746
有事点击这里…  893984210
当前位置:首页 >> 技术文章 >> 文章浏览
技术文章

CentOS7自生成证书配置SSL WEB详解

添加时间:2017-11-16 9:14:22  添加: 思海网络 




# 安装Apache [root@server0 ~]# yum -y install httpd mod_ssl 
# 添加防火墙规则 [root@server0 ~]# firewall-cmd --permanent --add-server=80/tcp
[root@server0 ~]# firewall-cmd --permanent --add-server=443/tcp
[root@server0 ~]# firewall-cmd --permanent --add-server=8080/tcp;firewall-cmd --reload [root@server0 ~]# systemctl restart httpd;systemctl enable httpd



# 配置selinux安全上下文
[root@server0 ~]# semanaga port -a -t http_port_t {80,443,8080} [root@server0 ssl]# mkdir /etc/httpd/ssl;cd /etc/httpd/ssl

# 生成KEY

[root@server0 ssl]# openssl genrsa -des3 -out vqiu.cn.key 2048

# 去密码

[root@server0 ssl]# openssl rsa -in vqiu.cn.key -out vqiu.cn.key# 生成证书签发请求和证书密钥

[root@server0 ssl]# openssl req -new -nodes -key vqiu.cn.key -out vqiu.cn.csr

# 通过csr生成一个证书,以 vqiu.cn 为例

[root@server0 ssl]# openssl x509 -req -days 3650 -in vqiu.cn.csr -signkey vqiu.cn.key -out vqiu.cn.crt

#生成 crt 之后,csr 可以进行删除[可略过]

[root@server0 ssl]# rm vqiu.cn.csr -f

[root@server0 ssl]# cat /etc/httpd/conf.d/vqiu.cn.conf

<IfModule mod_ssl.c>

Listen 443 https

</IfModule>

<VirtualHost _default_:443>

ServerName server0.vqiu.cn

DocumentRoot /var/www/html

SSLEngine on

SSLProtocol all -SSLv2

SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5

SSLCertificateFile /etc/httpd/ssl/vqiu.cn.crt

SSLCertificateKeyFile /etc/httpd/ssl/vqiu.cn.key

</VirtualHost>

# 生成一个测试页面

[root@server0 ssl]# echo "test">/var/www/html/index.html

# 重启httpd服务

[root@server0 ssl]# systemctl restart httpd 

 

关键字:CentOS7、证书、SSL WEB、防火墙规则

分享到:

顶部 】 【 关闭
版权所有:佛山思海电脑网络有限公司 ©1998-2024 All Rights Reserved.
联系电话:(0757)22630313、22633833
中华人民共和国增值电信业务经营许可证: 粤B1.B2-20030321 备案号:粤B2-20030321-1
网站公安备案编号:44060602000007 交互式栏目专项备案编号:200303DD003  
察察 工商 网安 举报有奖  警警  手机打开网站