Iis – the Apache equivalent of IIS site bindings

apache-2.2iisiis-7

With IIS it is very easy to setup bindings between a host name and a website.

If I have my DNS setup with the original registrar, all I need to do is update the A records to point to my IIS server and everything just works.

Domain Name -> IP Address -> (using the host header) -> Website

All good.

I have noticed with my Linux hosts that all of them require me to transfer my DNS to their name servers in order to get the 'bindings' to work. From what I can tell there is no way in cPanel to just tell it to associate a host name with a website.

How do I achieve the same things as IIS bindings in Apache/Linux? Is it even possible in cPanel?

Best Answer

This isn't a restriction of Apache at all; it doesn't care where your DNS is hosted. It sounds from Farseeker's answer like it's a restriction of your hosting provider and/or cPanel specifically (I used to use Dreamhost for example, and they didn't care if they held my DNS, but they have their own management interface)

A <VirtualHost> block inside of the apache configuration declares all the directives inside to apply to a virtual host, and the ServerName directive inside of that makes requests bearing that Host header use the block.

Refer to http://httpd.apache.org/docs/2.2/vhosts/name-based.html for details.