i'm setting up an apache2 server based on debian squeeze. I want to serve multiple websites using multiple IPs. Some of them need a certificate (one certificate for every website).
Well, my server has 3 IPs (let's say 0.0.0.0, 1.1.1.1 and 2.2.2.2)
i've already set up multiple vhosts for the 0.0.0.0 and 1.1.1.1 IPs, one of them uses the ssl certificate
now, i use the following scenario. One of the folders being served is /home/apache/SITES. What i want is when a user hits http://2.2.2.2/mysite to be redirected to https://2.2.2.2/mysite (that serves /home/apache/SITES/one) and when he hits http://2.2.2.2/my2site to be redirected to https://2.2.2.2/my2site (that serves /home/apache/SITES/two)
So far i use this 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>
but it doesn't seem to work. Firefox returns
The connection was reset
The connection to the server was reset while the page was loading.
any ideas?
Thanks
It seems that your server might not be listening on port 443. Do you also have virtual hosts configured for HTTPS? E.g.