_default_ 포트 443에서 VirtualHost가 겹쳐지며 첫 번째가 우선합니다. +SSLv3 SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM </VirtualHost> <VirtualHost *:80> ServerName

SSL을 사용하여 동일한 서버 (ubuntu 10.04)에서 두 개의 Ruby on rails 3 응용 프로그램을 실행 중입니다.

내 아파치 설정 파일은 다음과 같습니다.

<VirtualHost *:80>
ServerName example1.com
DocumentRoot /home/me/example1/production/current/public
</VirtualHost>
<VirtualHost *:443>
ServerName example1.com
DocumentRoot /home/me/example1/production/current/public
SSLEngine on
SSLCertificateFile /home/me/example1/production/shared/example1.crt
SSLCertificateKeyFile /home/me/example1/production/shared/example1.key
SSLCertificateChainFile /home/me/example1/production/shared/gd_bundle.crt
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
</VirtualHost>


<VirtualHost *:80>
ServerName example2.com
DocumentRoot /home/me/example2/production/current/public
</VirtualHost>
<VirtualHost *:443>
ServerName example2.com
DocumentRoot /home/me/example2/production/current/public
SSLEngine on
SSLCertificateFile /home/me/example2/production/shared/iwanto.crt
SSLCertificateKeyFile /home/me/example2/production/shared/iwanto.key
SSLCertificateChainFile /home/me/example2/production/shared/gd_bundle.crt
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
</VirtualHost>

무슨 문제 :

서버를 다시 시작하면 다음과 같은 결과가 나옵니다.

 * Restarting web server apache2
 [Sun Jun 17 17:57:49 2012] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
 ... waiting [Sun Jun 17 17:57:50 2012] [warn] _default_ VirtualHost overlap on port 443, the first has precedence

왜이 문제가 오는 인터넷 검색에서 다음과 같은 것을 얻었습니다.

적절한 이름 기반 가상 호스트를 식별하는 HTTP 요청 전에 SSL 핸드 셰이크 (브라우저가 보안 웹 서버의 인증서를 승인 할 때)가 발생하므로 이름 기반 가상 호스트를 SSL과 함께 사용할 수 없습니다. 이름 기반 가상 호스트를 사용하려는 경우 비보안 웹 서버에서만 작동합니다.

그러나 동일한 서버에서 두 개의 SSL 응용 프로그램을 실행하는 방법을 알 수 없습니다.

아무도 나를 도울 수 있습니까?



답변

거의 다 왔어!

ports.conf 또는 http.conf에 이것을 추가하고 위의 설정을 유지하십시오.

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.

    # !important below!
    NameVirtualHost *:443
    Listen 443
</IfModule>

답변

“/ usr / sbin / apachectl -S”도 실행하는 데 도움이되었습니다. 이 명령 엑시트는 동일한 경로에있는 두 개의 “ssl.conf”파일을 표시합니다. 위반자 파일을 이동하거나 삭제하면 모든 것이 제대로 작동합니다.


답변

당신은 이것을 아파치 설정에 추가 할 수 있습니다 /etc/apache2/ports.conf:

<IfModule mod_ssl.c>
    Listen 443
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        NameVirtualHost *:443
    </IfModule>
</IfModule>

(이것은 아파치 2.2와 2.4에서 작동합니다)