在apache2上安装SSL

时间:2016-05-08 11:40:26

标签: apache ssl configuration apache2 crt

我从Comodo获得了SSL证书。我尝试使用以下步骤在Apache服务器上安装它:

  1. 将这些文件上传到目录/home/perica

    bedbids_com.crt

    bedbids_com.key

    bedbids_com.ca-bundle

  2. 使用

    修改/etc/apache2/sites-available/default-ssl.conf
     SSLEngine on   
     SSLCertificateFile "/home/perica/bedbids_com.crt"    
     SSLCertificateKeyFile "/home/perica/bedbids.key"    
     SSLCertificateChainFile  "/home/perica/bedbids_com.ca-bundle"
    
  3. 但此时ssl仍未启用。我错过了什么?

1 个答案:

答案 0 :(得分:0)

检查ssl模块是否已启用:

sudo a2enmod ssl

(假设你使用基于debian的linux发行版)

然后你应该在配置文件中添加如下内容:

NameVirtualHost [your IP address]:443
< VirtualHost [your IP address]:443>
       ServerSignature On
       SSLCertificateFile    /path/to/the/certificate/from/your/certificate/company/apache.crt
       SSLCertificateKeyFile /path/to/the/file/created/in/step/1.key [can be a .pem file too I think]
       SSLCertificateChainFile /path/to/intermediate/cert.crt [optional, only if yout certificate compay provides you with one]
       SSLEngine On
</VirtualHost>

您可以在此处找到详细说明: http://wiki.vpslink.com/Enable_SSL_on_Apache2