Ssl – virtualhost *:443 vs virtualhost ip:443 for apache ssl

apache-2.2ipsslvirtualhost

i had a virtual host config for ssl in apache as follows:

<VirtualHost *:443>
DocumentRoot "/home/user/Documents/Development/oshackers-developers/website/"
ServerName oshackers.org

this config never worked. Apache show up the default page of /var/www

When i changed the config to next lines

<VirtualHost 192.168.0.3:443>
DocumentRoot "/home/user/Documents/Development/oshackers-developers/website/"
ServerName oshackers.org

apache worked and i had access to my ssl site.

why ssl needs an ip to work and cannot work for any site ?

Best Answer

If you have name-based virtual hosts enabled with the NameVirtualHost directive, then the <VirtualHost> directive must match the NameVirtualHost directive in order for apache to serve the correct content.

Related Topic