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 http*s*://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 http*s*://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

link|improve this question

0% accept rate
What does the Apache error log say? – Andrew Schulman Dec 18 '11 at 11:52
1  
nothing at all. neither the log of the virtual host, nor the main apache log – poscaman Dec 18 '11 at 11:53
what a bad choice of 0.0.0.0 as example ip for a server :( – S19N Dec 18 '11 at 19:05
feedback

1 Answer

It seems that your server might not be listening on port 443. Do you also have virtual hosts configured for HTTPS? E.g.

Listen 443
NameVirtualHost 1.1.1.1:443
<VirtualHost 1.1.1.1:443>
    SSLCertificateKeyFile   ...
    SSLCertificateFile      ...
    ...
</VirtualHost>
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.