Apache Virtual Host : Details and Guide to to Set Up Virtual Host


Apache Virtual Host is quite to set up. Here is an article on Apache Virtual Host with theoretical and practical 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 types of virtual hosting to of -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 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. the setup of Apache Virtual Host, it is not possible to point to the right of a same server.

 

Apache Virtual Host


 

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

Listen 80

# This is how Apache Virtual Host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/example
ServerName www.example.com

# We are another website using Apache Virtual Host
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/example1
ServerName www.example1.com

# You can add other directives after this line
</VirtualHost>

 

Configuration with both name-based and IP-based  Apache Virtual Host directive :

 

Listen 80

NameVirtualHost 176.70.60.50

<VirtualHost 176.70.60.50 >
DocumentRoot /www/example
ServerName www.example.com
</VirtualHost>

<VirtualHost  176.70.60.50 >
DocumentRoot /www/example1
ServerName www.example1.com
</VirtualHost>

 

Signature


0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave Lame Behind - Get Engaged

Here’s what we’ve got for you:

Contact Us Today for Smarter Marketing of Knowledge

See each of the premium resources below:

For Publishers and Content Owners

Do you want to optimize your available content?

Do you want to increase the visibility of your content?

Do you want to increase your reliability as an Author?

Do you want your next or existing project to be technically planned?

If your answer to any of these is YES contact us with your approximate budget.

Contact Us Today

For the Media Companies and Advertisers

You must be seeking a publisher website like ours with real content to give an exposure to your client's business?

We provide Industry's Standard opportunities for advertisement.

Do you want some promotion that comes with proper invoicing, SLA on per annum basis?

If your answer is YES contact us today for a quote.

Contact Us Today for Quote

Mentions

  1. Apache Virtual Host : Details and Guide to to Set Up Virtual Host « Windows 8 Tricks says:

    [...] Apache Virtual Host : Details and Guide to to Set Up Virtual Host Share this:TwitterFacebookLike this:LikeBe the first to like this post. [...]

  2. Revisiones twitteras (5) :: Servidor Apache | e-Formación says:

    [...] dirección IP. Una aplicación sería tener dos nombres de dominio en un mismo servidor. “Apache Virtual Host: Details and Guide to Set UP Virtual Host“, en la web de “The Customize [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>