0

I want users to be able to navigate to https://cloud.xxx.de, which works totally fine with the following configuration file. But besides the working (and correct) url, every url points to /var/www/cloud. Shouldn't ServerName cloud.xxx.de tell Apache to only point requests with this specific server name to the directory?

    ServerName cloud.xxx.de
    DocumentRoot /var/www/cloud

    SSLEngine on
    SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

    <Directory /var/www/cloud>
            ...
    </Directory>

magic_al
  • 1,930
  • 1
  • 18
  • 26

1 Answers1

0

Alright, I found out myself. From the Apache2 documentation:

Unless a NameVirtualHost directive is used for the exact IP address and port pair in the VirtualHost directive, Apache selects the best match only on the basis of the IP address (or wildcard) and port number. If there are multiple identical best matches, the first VirtualHost appearing in the configuration file will be selected.

So basically I just had to put

NameVirtualHost *:443

in front of my first evaluated virtual host listening on port 443.

magic_al
  • 1,930
  • 1
  • 18
  • 26