Virtual Name Based Hosts on Apache 2

From Andreida

Always check the apache configuration with:

 apache2ctl -S

In ports.conf:

 NameVirtualHost *:80
 NameVirtualHost <your_ip>:443
 Listen 80
 <IfModule mod_ssl.c>
    # SSL name based virtual hosts are not yet supported, therefore no
    # NameVirtualHost statement here
    Listen 443
 </IfModule>

In the default virtual host file in sites-available:

 <VirtualHost *:80>
    ServerName www.<your-domain>
    ServerAlias <your-domain>

Another host:

 <VirtualHost *:80>
     ServerName wiki.<your-domain>

An ssl host:

 <IfModule mod_ssl.c>
     <VirtualHost bugzilla.<your-domain>.de:443>

The last example is not 100% correct, but it works.