小编Jim*_*Jim的帖子

在apache上托管多个SSL证书

我希望有人能帮助我.我有2个IP可用于执行此操作,需要在同一个Apache服务器上托管2个不同的安全(SSL)域.我已经读过Apache 2.2的内容,可以使用单个IP,使用某种加载项,但我希望尽可能简单,并且愿意使用这两个IP来完成这项任务.我已经拥有2个域名签名证书.

我在这里发布的这个设置有效,但我遇到的问题是,当我去domain2.net时,我收到一个浏览器警告告诉我证书与域名不匹配但匹配domain1.com

我正在使用CentOS 5和Apache 2.2.3.CentOS有一个ssl.conf文件,这些行是我认为给我带来的麻烦:

SSLCertificateFile /etc/pki/tls/certs/domain1.com.crt
SSLCertificateKeyFile /etc/pki/tls/private/domain1.com.key
Run Code Online (Sandbox Code Playgroud)

我的印象是我可以在虚拟主机容器中覆盖这些值并引用我需要的键,但它不会出现这种情况.当我在ssl.conf文件中注释掉这两行时,Apache将不会重启.ssl_log暗示:SSLCertificateKeyFile

这些是我的虚拟容器:

<VirtualHost 2.2.2.2:443>
   SSLEngine on
   SSLCertificateFile /etc/pki/tls/certs/domain2.net.crt
   SSLCertificateKeyFile /etc/pki/tls/private/domain2.net.key

  DocumentRoot "/var/www/domain2"
   ServerName domain2.net
   ServerAlias domain2.net
   DirectoryIndex "index.php"

   <Directory /var/www/html/domain2>
     Options -Indexes FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>
</VirtualHost>


<VirtualHost 1.1.1.1:444>
   SSLEngine on
   SSLCertificateFile /etc/pki/tls/certs/domain1.com.crt
   SSLCertificateKeyFile /etc/pki/tls/private/domain1.com.key

  DocumentRoot "/var/www/html"
   ServerName domain1.com
   ServerAlias domain1.com
   DirectoryIndex "index.php"

   <Directory /var/www/html>
     Options -Indexes FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
   </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

如何使用SSL使这两个域工作?我也试过为不同的IP使用相同的端口,但同样,Apache不会重启.

我真的迷失了,所以如果有人能伸出援助之手,我真的很感激.

ssl apache2

14
推荐指数
1
解决办法
2万
查看次数

标签 统计

apache2 ×1

ssl ×1