歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> linux apache安裝https證書,apachehttps

linux apache安裝https證書,apachehttps

日期:2017/3/3 17:21:23   编辑:學習Linux

linux apache安裝https證書,apachehttps


熱度3 評論 201 www.BkJia.Com 網友分享於: 2017-03-02 04:03:31 浏覽數49351次

linux apache安裝https證書,apachehttps


1、首先查看是否安裝apache

命令:rpm -qa|grep httpd

如果存在,卸載命令:rpm -e XXXX

如果不存在,安裝命令:yum install httpd

安裝完apache之後還需要安裝ssl模塊,命令:yum install mod_ssl

2、配置ssl.conf

打開/etc/httpd/conf.d/ssl.conf

找到以下

SSLCertificateFile /etc/pki/tls/certs/localhost.crt

SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

#SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt

將其修改為您申請的https證書中相應的文件,並將第三行前的#號去掉。

在ssl.conf文件中找到以下信息:

#DocumentRoot "/var/www/html"
#ServerName www.example.com:443

將文檔根目錄及域名修改為您實際的域名。

以上信息修改保存之後,重啟httpd服務,命令:service httpd restart

然後在浏覽器中輸入https://域名,查看是否可以正常訪問。

若無法正常訪問,查看443端口是否通。

注:有些雲服務器端口需要自行開通。

http://www.bkjia.com/Linuxjc/1196641.htmlwww.bkjia.comtruehttp://www.bkjia.com/Linuxjc/1196641.html

Copyright © Linux教程網 All Rights Reserved