Pregunta:
Tengo dos aplicaciones ruby on rails 3 ejecutándose en el mismo servidor (ubuntu 10.04), ambas con SSL.
Aquí está mi archivo de configuración de apache:
<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>
Cual es el problema:
Al reiniciar mi servidor, me da un resultado como este:
* 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
Al buscar en Google por qué viene este problema, obtuve algo como esto:
No puede utilizar hosts virtuales basados en nombres con SSL porque el protocolo de enlace SSL (cuando el navegador acepta el certificado del servidor web seguro) se produce antes de la solicitud HTTP, que identifica el host virtual basado en el nombre apropiado. Si planea utilizar hosts virtuales basados en nombres, recuerde que solo funcionan con su servidor web no seguro.
Pero no puedo averiguar cómo ejecutar dos aplicaciones ssl en el mismo servidor.
¿Alguien puede ayudarme?
Respuesta:
¡Casi llegamos!
Agregue esto a ports.conf o http.conf y mantenga su configuración anterior.
<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>