Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
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

1 Answer 1

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>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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