<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>virtual host &#8211; Best DevOps</title>
	<atom:link href="https://www.bestdevops.com/tag/virtual-host/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.bestdevops.com</link>
	<description>Lets Learn, Do it &#38; Share! Thats a Best DevOps!!!</description>
	<lastBuildDate>Fri, 20 Aug 2021 10:23:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>
	<item>
		<title>Configuring Virtual Hosting in Apache</title>
		<link>https://www.bestdevops.com/configuring-virtual-hosting-in-apache/</link>
		
		<dc:creator><![CDATA[pradeep]]></dc:creator>
		<pubDate>Fri, 20 Aug 2021 10:23:22 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[Virtual machines]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=19505</guid>

					<description><![CDATA[&#8220;Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>&#8220;Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers).&#8221;</p><cite>Wikipedia</cite></blockquote>



<h2 class="wp-block-heading">How Does Apache Know Which Site to Serve?</h2>



<p class="wp-block-paragraph"><br>The short answer to your specific case: apache will serve the FIRST overlapping virtual host. Since 000-default is before fc.localhost in the alphabet the first virtualhost is loaded and served.</p>



<p class="wp-block-paragraph">To answer what i assume is the follow up question: You can host many sites on the same IP:PORT using named VirtualHosts</p>



<p class="wp-block-paragraph">T<strong>he host field in the http request header identifies which site (virtual<br>host) to serve:</strong></p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-110.png" alt="" class="wp-image-19506" width="571" height="66" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-110.png 742w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-110-300x35.png 300w" sizes="(max-width: 571px) 100vw, 571px" /></figure>



<p class="wp-block-paragraph"><strong>Matched against the containers in the configuration file</strong></p>



<figure class="wp-block-image size-full is-resized"><img fetchpriority="high" decoding="async" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-111.png" alt="" class="wp-image-19507" width="651" height="413" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-111.png 920w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-111-300x191.png 300w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-111-768x488.png 768w" sizes="(max-width: 651px) 100vw, 651px" /></figure>



<h2 class="wp-block-heading">A More Complete Virtual Host Definition</h2>



<p class="wp-block-paragraph">You can put (almost) any directive inside a virtual host container For example, it&#8217;s common to write separate logs for each site</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-113.png" alt="" class="wp-image-19509" width="608" height="166" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-113.png 735w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-113-300x82.png 300w" sizes="(max-width: 608px) 100vw, 608px" /></figure>



<h2 class="wp-block-heading">Name Resolution</h2>



<ol class="wp-block-list"><li><strong>In the &#8220;real world&#8221; our East and West sites would each have an entry in DNS (Domain Name Service)</strong></li><li><strong>Our demonstration system uses only /etc/hosts for name resolution:</strong></li></ol>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.bestdevops.com/wp-content/uploads/2021/08/image-114.png" alt="" class="wp-image-19510" width="426" height="91" srcset="https://www.bestdevops.com/wp-content/uploads/2021/08/image-114.png 579w, https://www.bestdevops.com/wp-content/uploads/2021/08/image-114-300x64.png 300w" sizes="auto, (max-width: 426px) 100vw, 426px" /></figure>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
