Apache2,多个IP,多个虚拟主机一个SSL

我正在build立一个基于debian squeeze的apache2服务器。 我想用多个IP来服务多个网站。 其中一些需要证书(每个网站一个证书)。

那么,我的服务器有3个IP(比方说0.0.0.0,1.1.1.1和2.2.2.2)

我已经为0.0.0.0和1.1.1.1 IP设置了多个虚拟主机,其中一个使用了ssl证书

现在,我使用以下scheme。 其中一个文件夹是/ home / apache / SITES。 我想要的是当用户点击http://2.2.2.2/mysite被redirect到http://2.2.2.2/mysite (服务/ home / apache / SITES / one),当他点击http:/ /2.2.2.2/my2site被redirect到http://2.2.2.2/my2site(服务于/ home / apache / SITES / 2)

到目前为止,我使用这种configuration。

<VirtualHost _default_ 2.2.2.2:80> DocumentRoot /home/apache/SITES/default/htdocs Alias /mysite /home/apache/SITES/one <IfModule mod_rewrite.c> <IfModule mod_ssl.c> <Location /mysite> RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/mysite [R] </Location> </IfModule> </IfModule> <Directory /home/apache/SITES/one> Options Indexes FollowSymLinks MultiViews AllowOverride All DirectoryIndex index.php </Directory> # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel error ErrorLog /home/apache/SITES/logs/error.log CustomLog /home/apache/SITES/logs/access.log combined </VirtualHost> 

但似乎并不奏效。 Firefox返回

 The connection was reset The connection to the server was reset while the page was loading. 

有任何想法吗?

谢谢

看起来您的服务器可能不在端口443上侦听。您是否还configuration了用于HTTPS的虚拟主机? 例如

 Listen 443 NameVirtualHost 1.1.1.1:443 <VirtualHost 1.1.1.1:443> SSLCertificateKeyFile ... SSLCertificateFile ... ... </VirtualHost>