• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

CentOS 6系统Apache环境配置SSL证书教程

建站知识 Liam 1年前 (2019-04-28) 350次浏览 8个评论 扫描二维码
文章目录[隐藏]

简介

SSL证书用于加密计算机与指定服务器之间的数据,从而创建安全连接。SSL证书可以是自签名的,也可以由受信任的CA颁发。所有主要网站不使用自签名证书的原因是因为所有浏览器都会识别该站点正在使用自签名(和不可信)的证书,并显示一个警告页面,而当使用受信任的CA签名的证书时,在大多数情况下,浏览器会识别它,并允许您继续访问该网站。在本教程中,我们将使用自签名证书,因为他们可以自由发布/发布。

主机要求:CentOS 6系统或更高版本,装有Apache环境,内存,最低512MB。

配置SSL

1、安装Mod SSL

yum install mod_ssl 

2、创建目录,存放证书

mkdir /etc/httpd/ssl 

3、创建自签名证书

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/apache.key -out /etc/httpd/ssl/apache.crt 

4、设置SSL证书
打开SSL配置文件:

nano /etc/httpd/conf.d/ssl.conf 

找到以<VirtualHost _default_:443>开头的部分。取消注释DocumentRootServerName行,并将example.com替换为您的域名或服务器IP地址(如果您不想得到任何错误,则应与证书上的通用名称相同):

ServerName example.com:443 

您还应该找到以下三行,并确保它们匹配以下扩展名:

SSLEngine on SSLCertificateFile /etc/httpd/ssl/apache.crt SSLCertificateKeyFile /etc/httpd/ssl/apache.key 

5、重启Apache服务

/etc/init.d/httpd restart 

现在,就可以访问了。
原文地址:firstchoicehosting.co.uk


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:CentOS 6系统Apache环境配置SSL证书教程
喜欢 (0)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(8)个小伙伴在吐槽
  1. It is appropriate time to make some plans for the future and it's time to be happy. I have read this post and if I could I wish to suggest you few interesting things or tips. Perhaps you can write next articles referring to this article. I want to read more things about it!
    cheap flights2020-08-27 07:26 回复 Windows 7 | 360浏览器 SE
  2. May I simply say what a relief to discover someone that actually understands what they're talking about on the net. You actually realize how to bring an issue to light and make it important. A lot more people ought to look at this and understand this side of the story. I was surprised that you aren't more popular because you certainly have the gift.
    cheap flights2020-08-27 05:55 回复 Linux | Chrome 66.0.3359.170
  3. Hi! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no back up. Do you have any solutions to protect against hackers? cheap flights yynxznuh
    cheap flights2020-08-26 21:31 回复 Linux | Chrome 64.0.3282.167
  4. Hi there, after reading this remarkable piece of writing i am also glad to share my familiarity here with colleagues. 31muvXS cheap flights
    cheap flights2020-08-25 08:49 回复 Mac OS X | Chrome 66.0.3359.181
  5. This is really interesting, You are a very skilled blogger. I have joined your rss feed and look forward to seeking more of your fantastic post. Also, I've shared your web site in my social networks!
    cheap flights2020-08-24 14:56 回复 Linux | Chrome 66.0.3359.139
  6. Have you ever considered writing an ebook or guest authoring on other blogs? I have a blog centered on the same information you discuss and would love to have you share some stories/information. I know my subscribers would enjoy your work. If you're even remotely interested, feel free to send me an e mail.
    website hosting services2020-08-14 14:03 回复 Mac OS X | Chrome 52.0.2777.85
  7. whoah this blog is wonderful i really like studying your posts. Keep up the good work! You recognize, lots of individuals are hunting around for this info, you can help them greatly.
    web hosting providers2020-08-14 13:32 回复 Linux | Chrome 66.0.3359.139
  8. I've learn a few good stuff here. Definitely value bookmarking for revisiting. I surprise how so much attempt you put to make this sort of wonderful informative web site.
    website hosting services2020-08-10 15:39 回复 Linux | Firefox浏览器 52.9