2014-11-24 4 views
0

사용자가 내 구성에서 두 번째 도메인을 탐색 할 때 올바른 apache 서버를 가져 오는 데 문제가 있습니다. 다음은 현재 내 구성이 어떻게되어 있는지 보여주는 예입니다. 이 구성은 "서버 인증서가 URL과 일치하지 않습니다."클라이언트에 다음 오류를 제공합니다. 도움에 미리 감사드립니다.하나의 IP에서 실행되는 SSL을 사용하는 두 사이트

<VirtualHost *:80> 
    ServerName www.domain1.com 
    Redirect/https://www.domain1.com/ 
</VirtualHost> 


<VirtualHost *:443> 
      ServerAdmin [email protected] 
      ServerName www.domain1.com 
      SSLEngine on 
      SSLCertificateFile /location/ofcerts/www_domain1_com.crt 
      SSLCertificateKeyFile /domain1/www_domain1_com.key 
      SSLCertificateChainFile /location/ofcerts/COMODORSAAddTrustCA.crt 
      SSLCertificateChainFIle /location/ofcerts/domain1.ca-bundle 
      SSLProtocol all -SSLv2 -SSLv3 
      SSLHonorCipherOrder on 
      SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4" 
     <Location /> 
      SetEnv no-gzip 
     </Location> 

     DocumentRoot /var/www/ 
     <Directory /> 
       Options FollowSymLinks 
       AllowOverride None 
     </Directory> 
     <Directory /var/www/> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride None 
       Order allow,deny 
       allow from all 
     </Directory> 
     <Directory /var/www/sub> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride All 
       Order allow,deny 
       allow from all 
     </Directory> 

     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
     <Directory "/usr/lib/cgi-bin"> 
       AllowOverride None 
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
       Order allow,deny 
       Allow from all 
     </Directory> 

     ErrorLog ${APACHE_LOG_DIR}/error.log 

     # Possible values include: debug, info, notice, warn, error, crit, 
     # alert, emerg. 
     LogLevel warn 

     CustomLog ${APACHE_LOG_DIR}/access.log combined 

    Alias /doc/ "/usr/share/doc/" 
    <Directory "/usr/share/doc/"> 
     Options Indexes MultiViews FollowSymLinks 
     AllowOverride None 
     Order deny,allow 
     Deny from all 
     Allow from 127.0.0.0/255.0.0.0 ::1/128 
    </Directory> 

</VirtualHost> 

<VirtualHost *:443> 
     ServerAdmin [email protected] 
     ServerName www.domain2.com 
     SSLEngine on 
     SSLCertificateFile /location/of/domain2certs/www_domain2_com.crt 
     SSLCertificateKeyFile /domain2/www_domain2_com.key 
     SSLCertificateChainFile /location/of/domain2certs/COMODORSAAddTrustCA.crt 
     SSLCertificateChainFIle /location/of/domain2certs/domain2.ca-bundle 
     SSLProtocol all -SSLv2 -SSLv3 
     SSLHonorCipherOrder on 


     DocumentRoot /var/www/domain2 
     <Directory /var/www/domain2> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride All 
       Order allow,deny 
       allow from all 
     </Directory> 
</VirtualHost> 
+1

'https'의 한계 중 하나는 IP 주소 하나당 하나의 URL 만 허용한다는 것입니다. –

+0

요청이 서버에 도착하면 호스트 헤더가 암호화되어 사용할 인증서를 결정할 방법이 없으므로 SNI를 사용하거나 다른 포트에서 dom2를 실행할 수 있습니다. –

+0

나는 SNI를 살펴볼 것이다. 잘하면 나는 그렇게 할 수있다. – leigon

답변

0

추가하여 설정의 상단에 다음과 같습니다.

# Listen for virtual host requests on all IP addresses 
NameVirtualHost *:443 

# Go ahead and accept connections for these vhosts 
# from non-SNI clients 
SSLStrictSNIVHostCheck off 
0

동일한 IP 주소 및 포트에서 이름이 지정된 SSL 가상 호스트 2 개를 호스팅 할 수 없다고 생각합니다. Apache는 항상 오류를 설명하는 첫 번째 나열된 호스트를 사용합니다.

링크 : https://wiki.apache.org/httpd/NameBasedSSLVHosts

+0

쓰레기 ... 그것은 여러 개의 NIC를 가지고 있지만 두 번째 내부 IP를 추가하는 것이 좋다고 생각하지 않습니다. 그 중 하나만 443을 전달할 수 있기 때문입니다. – leigon

+1

실제로 SNI를 사용하는 것이 가능합니다. 언급 된 페이지의 첫 번째 링크에서 언급했듯이. – Bruno

관련 문제