Virtual Name Based Hosts on Apache 2

From Andreida
Revision as of 11:26, 16 February 2016 by Andreas (talk | contribs) (Created page with "Always check the apache configuration with: apache2ctl -S In ports.conf: NameVirtualHost *:80 NameVirtualHost <your_ip>:443 Listen 80 <IfModule mod_ssl.c> # S...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.