Apache Virtual Host is quite easy to set up. Here is an article on Apache Virtual Host with theoretical details and practical guide to set up. The useful resources related to this topic is an article on Apache HTTP Server, IP-Based and Name-Based Virtual Hosting and Virtual Private Server.Â In nutshell, from a network perspective, there are two basic types of virtual hosting to virtualization of Internet-based services. The difference lies in the method applied by the server when a request to determine which of the services provided by it has been asked for.
Basics of Â Apache Virtual Host
For running name-based web sites on a single IP address, keep in mind that one server has a single IP address.Â CNAMES areÂ multiple aliases. TheseÂ CNAMES point to this specific server in DNS. So our prime target to useÂ Apache Virtual Host to host for example two domain names on a single server. Without the setup ofÂ Apache Virtual Host, it is not possible to point to the right folder of a same server.
Setting up of Apache Virtual Host
Apache Virtual Host configuration for running several name-based websites with single IP :
Hash is comment (not counted as directive), the names in DNS must be resolving to your IP address, otherwise the websites will not be publicly viewable.
# This ensure that Apache Virtual HostÂ listens on port 80
# This is howÂ Apache Virtual Host requests on all IP addresses
# We are adding another website using Apache Virtual Host
# You can add other directives after this line
ConfigurationÂ with both name-based and IP-basedÂ Apache Virtual Host directiveÂ :
<VirtualHost 22.214.171.124 >
<VirtualHostÂ 126.96.36.199 >