<?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 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/virtual-host/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 28 Sep 2020 22:34:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to install Hyper-V on Windows Server 2019</title>
		<link>https://www.osradar.com/how-to-install-hyper-v-on-windows-server-2019/</link>
					<comments>https://www.osradar.com/how-to-install-hyper-v-on-windows-server-2019/#respond</comments>
		
		<dc:creator><![CDATA[roger]]></dc:creator>
		<pubDate>Sat, 03 Oct 2020 21:33:00 +0000</pubDate>
				<category><![CDATA[Servers]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[hyper v]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Windows server]]></category>
		<category><![CDATA[Windows server 2019]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=24007</guid>

					<description><![CDATA[<p>Virtualization is a widely used technology today. Indeed, it is possible to test operating systems and applications without mounting them in a productive environment. In this way, any error or failure does not harm the host system. Well, Windows Server has its own virtualization manager. This service is known as Hyper V. As a result, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-hyper-v-on-windows-server-2019/">How to install Hyper-V on Windows Server 2019</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Virtualization is a widely used technology today. Indeed, it is possible to test operating systems and applications without mounting them in a productive environment. In this way, any error or failure does not harm the host system. Well, Windows Server has its own virtualization manager. This service is known as <a href="https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/" target="_blank" rel="noreferrer noopener">Hyper V.</a> As a result, this role allows multiple machines to run on one. Therefore, it is possible to evaluate operating systems and applications without additional costs. So in this post we will see how to install Hyper-V on Windows Server 2019.</p>



<h2>How to install Hyper-V Windows Server 2019 from Server Manager.</h2>



<p><a href="https://www.osradar.com/how-to-enable-and-use-hyper-v-on-windows-10/" target="_blank" rel="noreferrer noopener">Hyper-V</a> is developed as a virtualization technology which is based on hypervisor. Consequently, it uses the Windows hypervisor, which in turn requires a physical processor. It is essential that this processor has the virtualization technology. To activate and install it, from the <strong>Server Manager</strong> click on <strong>Add Roles and Features</strong>.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="787" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper-1024x787.png" alt="Adding Roles and Features" class="wp-image-24009" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper-1024x787.png 1024w, https://www.osradar.com/wp-content/uploads/2020/09/hyper-300x231.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper-768x590.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper-696x535.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper-1068x821.png 1068w, https://www.osradar.com/wp-content/uploads/2020/09/hyper-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2020/09/hyper.png 1280w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Adding Roles and Features</figcaption></figure>



<p>Press Next to continue.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper2.png" alt="" class="wp-image-24011" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper2.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper2-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper2-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper2-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper2-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /></figure>



<p>On the next screen, select the <strong>Role-based or feature-bases installation</strong>:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper3.png" alt="" class="wp-image-24013" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper3.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper3-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper3-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper3-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper3-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /></figure>



<p>Now it is time to select the server where the role will be installed:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper4.png" alt="Select the server" class="wp-image-24014" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper4.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper4-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper4-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper4-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper4-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /><figcaption>Select the server</figcaption></figure>



<p>Then select <strong>Hyper-V</strong>:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper5.png" alt="Select Hyper V" class="wp-image-24016" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper5.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper5-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper5-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper5-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper5-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /><figcaption>Select Hyper V</figcaption></figure>



<p>Then, a confirmation window is shown below with the features that will be added.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="416" height="416" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper6.png" alt="Adding the features related to Hyper V" class="wp-image-24017" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper6.png 416w, https://www.osradar.com/wp-content/uploads/2020/09/hyper6-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper6-150x150.png 150w" sizes="(max-width: 416px) 100vw, 416px" /><figcaption>Adding the features related to Hyper V</figcaption></figure>



<p>Press Next to continue:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper7.png" alt="Please press Next to continue" class="wp-image-24019" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper7.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper7-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper7-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper7-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper7-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /><figcaption>Please press Next to continue</figcaption></figure>



<p>The following window is about installation based on features. Consequently, press Next to continue.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper8.png" alt="" class="wp-image-24022" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper8.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper8-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper8-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper8-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper8-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /></figure>



<p>The wizard then displays a brief overview of Hyper-V. Additionally, it is necessary to know the network device that will be used as a virtual switch.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper9.png" alt="" class="wp-image-24024" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper9.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper9-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper9-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper9-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper9-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /></figure>



<p>It is then possible to select the network adapter as a network switch. Therefore, it is necessary to mark one to guarantee the connectivity of the virtual machine.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper10.png" alt="Creating a virtual network switch" class="wp-image-24025" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper10.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper10-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper10-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper10-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper10-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /><figcaption>Creating a virtual network switch</figcaption></figure>



<p>In the following screen it is possible to configure Hyper-V to support live migration of virtual machines. That is, without having to shut down the server.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper11.png" alt="" class="wp-image-24027" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper11.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper11-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper11-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper11-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper11-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /></figure>



<p>Now it&#8217;s time to set the default Hyper-V routes. It is also possible to modify them according to the administrator&#8217;s taste.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper12.png" alt="" class="wp-image-24028" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper12.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper12-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper12-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper12-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper12-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /><figcaption>Selecting locations for Hyper-V</figcaption></figure>



<p>Now the wizard shows a summary of the role that will be installed. Press Install to begin the task:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper13.png" alt="Brief summary of Hyper-V installation" class="wp-image-24030" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper13.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper13-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper13-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper13-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper13-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /><figcaption>Brief summary of Hyper-V installation</figcaption></figure>



<p>The installation process will begin immediately:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper14.png" alt="Hyper-V Installation Process" class="wp-image-24031" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper14.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper14-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper14-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper14-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper14-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /><figcaption>Hyper-V Installation Process</figcaption></figure>



<p>Finally, it is necessary to restart the server to save the changes.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="786" height="560" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper17.png" alt="" class="wp-image-24040" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper17.png 786w, https://www.osradar.com/wp-content/uploads/2020/09/hyper17-300x214.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper17-768x547.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper17-696x496.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper17-100x70.png 100w" sizes="(max-width: 786px) 100vw, 786px" /><figcaption>Please restart t set the changes</figcaption></figure>



<p>After restarting the server, you will see the Hyper-V manager available from the start menu.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="657" height="686" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper18.png" alt="Hyper-V Manager available from the start menu" class="wp-image-24043" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper18.png 657w, https://www.osradar.com/wp-content/uploads/2020/09/hyper18-287x300.png 287w" sizes="(max-width: 657px) 100vw, 657px" /><figcaption>Hyper-V Manager available from the start menu</figcaption></figure>



<p>Clicking on it will display the administration console:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="787" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper19-1024x787.png" alt="Hyper-V Manager" class="wp-image-24045" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper19-1024x787.png 1024w, https://www.osradar.com/wp-content/uploads/2020/09/hyper19-300x231.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper19-768x590.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper19-696x535.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper19-1068x821.png 1068w, https://www.osradar.com/wp-content/uploads/2020/09/hyper19-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2020/09/hyper19.png 1280w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Hyper-V Manager</figcaption></figure>



<h2>How to install Hyper-V  in Windows Server 2019 from PowerShell</h2>



<p>On the other hand, it is possible to install this role on the server using PowerShell. With this intention, open a PowerShell with administrator privileges and run the following command:</p>



<pre class="wp-block-preformatted">Install-WindowsFeature -Name Hyper-V -IncludeManagementTools</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="787" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper15-1024x787.png" alt="Installing Hyper-V with PowerShell" class="wp-image-24033" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper15-1024x787.png 1024w, https://www.osradar.com/wp-content/uploads/2020/09/hyper15-300x231.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper15-768x590.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper15-696x535.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper15-1068x821.png 1068w, https://www.osradar.com/wp-content/uploads/2020/09/hyper15-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2020/09/hyper15.png 1280w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Installing Hyper-V with PowerShell</figcaption></figure>



<h2>Installing Hyper-V using DISM</h2>



<p>Deployment Image Servicing and Management is a tool integrated into the server with which we manage the system images. It also allows, to install Hyper-V. To use this method, you need to open a PowerShell as an administrator and run the following command:</p>



<pre class="wp-block-preformatted">dism /Online /Enable-Feature /FeatureName:Microsoft-Hyper-V /All</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="787" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/09/hyper16-1024x787.png" alt="Installing Hyper-V using DISM" class="wp-image-24034" srcset="https://www.osradar.com/wp-content/uploads/2020/09/hyper16-1024x787.png 1024w, https://www.osradar.com/wp-content/uploads/2020/09/hyper16-300x231.png 300w, https://www.osradar.com/wp-content/uploads/2020/09/hyper16-768x590.png 768w, https://www.osradar.com/wp-content/uploads/2020/09/hyper16-696x535.png 696w, https://www.osradar.com/wp-content/uploads/2020/09/hyper16-1068x821.png 1068w, https://www.osradar.com/wp-content/uploads/2020/09/hyper16-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2020/09/hyper16.png 1280w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Installing Hyper-V using DISM</figcaption></figure>



<p>In any case, you have to restart the server to see the established changes. Ultimately we have seen how to install Hyper-V on Windows Server. In addition, we studied the graphic mode and through PowerShell. All right, that&#8217;s it for now. Bye!</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-hyper-v-on-windows-server-2019/">How to install Hyper-V on Windows Server 2019</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-hyper-v-on-windows-server-2019/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to configure Nginx Server Blocks on Ubuntu 18.04?</title>
		<link>https://www.osradar.com/how-to-configure-nginx-server-blocks-on-ubuntu-18-04/</link>
					<comments>https://www.osradar.com/how-to-configure-nginx-server-blocks-on-ubuntu-18-04/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 13 Sep 2018 09:08:59 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[web hosting]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=5733</guid>

					<description><![CDATA[<p>Recently I explained to you about Virtual hosts and how to configure them in the Apache web server. However, you should know that Apache has a quite popular, efficient and also free alternative. I&#8217;m talking about ngnix. In addition, it has Server blocks that are quite similar to the Virtual hosts of apache. Ngnix is a high-performance [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-nginx-server-blocks-on-ubuntu-18-04/">How to configure Nginx Server Blocks on Ubuntu 18.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently I explained to you about Virtual hosts and how to configure them in the Apache web server. However, you should know that Apache has a quite popular, efficient and also free alternative. I&#8217;m talking about <a href="https://www.nginx.com/">ngnix</a>. In addition, it has Server blocks that are quite similar to the Virtual hosts of apache.</p>
<p>Ngnix is a high-performance lightweight inverse web/proxy server and proxy for email protocols. It is free and open source software, licensed under the Simplified BSD License. At the same time, ngnix <strong>has a paid version</strong>, dedicated to high-performance companies and projects that require commercial support.</p>
<p>with this in mind, I will teach you how to configure Nginx server blocks using Ubuntu 18.04 LTS.</p>
<h2>0. Requirements</h2>
<p>In order to perform this tutorial satisfactorily, you should keep this in mind:</p>
<ul>
<li>You need to be logged in with a user with <code>sudo</code> enabled.</li>
<li>It is recommended that you have a basic understanding of the use of the terminal.</li>
<li>And obviously, need a computer with Ubuntu 18.04.</li>
</ul>
<p>Note: The steps I will describe must also work on Linux Mint 19.</p>
<h2>1.- Install Nginx</h2>
<p>In the first place, you need to update the entire operating system. It&#8217;s always good to do this because it ensures you have the latest security patches installed. Open a terminal, and run:</p>
<pre class="">:~$ sudo apt &amp;&amp; sudo apt upgrade</pre>
<p><figure id="attachment_5736" aria-describedby="caption-attachment-5736" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5736" src="https://www.osradar.com/wp-content/uploads/2018/09/1-7.png" alt="1.- Upgrading the system" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/1-7.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/1-7-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/1-7-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/1-7-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/1-7-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/1-7-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/1-7-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5736" class="wp-caption-text">1.- Upgrading the system</figcaption></figure></p>
<p>After you enter your password, you will have the system updated.</p>
<p>Now, you can install ngnix. In order to reduce the time spent, install it from the package that comes in the official Ubuntu repositories. Type:</p>
<pre class="">:~$ sudo apt install ngnix</pre>
<p><figure id="attachment_5737" aria-describedby="caption-attachment-5737" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5737" src="https://www.osradar.com/wp-content/uploads/2018/09/2-6.png" alt="2.- Installing nginx from official repositories" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/2-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/2-6-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/2-6-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/2-6-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/2-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/2-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/2-6-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5737" class="wp-caption-text">2.- Installing Nginx from official repositories</figcaption></figure></p>
<p>Next, verify that the firewall is configured to allow nginx to operate.</p>
<pre class="">:~$ sudo ufw app list</pre>
<p><figure id="attachment_5738" aria-describedby="caption-attachment-5738" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5738" src="https://www.osradar.com/wp-content/uploads/2018/09/3-6.png" alt="3.- Listing the application configurations that ufw knows" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/3-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/3-6-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/3-6-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/3-6-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/3-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/3-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/3-6-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5738" class="wp-caption-text">3.- Listing the application configurations that ufw knows</figcaption></figure></p>
<p>As a result, you can see the applications that are in profile in the firewall. If you see <code>Nginx Full</code>, <code>Nginx HTTP</code> and <code>Nginx HTTPS</code>, you are doing well.</p>
<p>Check the status of the service.</p>
<pre class="">:~$ sudo systemctl status nginx</pre>
<p><figure id="attachment_5739" aria-describedby="caption-attachment-5739" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5739" src="https://www.osradar.com/wp-content/uploads/2018/09/5-6.png" alt="5.- Nginx status" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/5-6.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/5-6-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/5-6-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/5-6-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/5-6-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/5-6-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/5-6-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5739" class="wp-caption-text">5.- Nginx status</figcaption></figure></p>
<p>Go to your browser and access with the IP address of the server.</p>
<p><code>http://IP_SERVER</code></p>
<p><figure id="attachment_5740" aria-describedby="caption-attachment-5740" style="width: 1229px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5740" src="https://www.osradar.com/wp-content/uploads/2018/09/6-6.png" alt="6.- Nginx welcome screen on web browser" width="1229" height="347" srcset="https://www.osradar.com/wp-content/uploads/2018/09/6-6.png 1229w, https://www.osradar.com/wp-content/uploads/2018/09/6-6-300x85.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/6-6-768x217.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/6-6-1024x289.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/6-6-696x197.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/6-6-1068x302.png 1068w" sizes="(max-width: 1229px) 100vw, 1229px" /><figcaption id="caption-attachment-5740" class="wp-caption-text">6.- Nginx welcome screen on the web browser</figcaption></figure></p>
<p>As can be seen, Nginx has been correctly installed.</p>
<h2>2. Create folders for each host</h2>
<p>For this tutorial, I will create two server blocks and consequently, a separate folder must be created for each host. Virtual hosts will be named &#8220;osradar1.test&#8221; and &#8220;osradar2.test&#8221;. Run:</p>
<pre class="">:~$ sudo mkdir -p /var/www/html/osradar1.test/public_html
:~$ sudo mkdir -p /var/www/html/osradar2.test/public_html</pre>
<p><figure id="attachment_5741" aria-describedby="caption-attachment-5741" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5741" src="https://www.osradar.com/wp-content/uploads/2018/09/7-7.png" alt="7.- Creating the folders for the two virtual hosts" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/7-7.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/7-7-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/7-7-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/7-7-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/7-7-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/7-7-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/7-7-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5741" class="wp-caption-text">7.- Creating the folders for the two virtual hosts</figcaption></figure></p>
<p>As a result, the newly created folders belong to root. This will have negative consequences on their use. You must change the owner to your user. Type:</p>
<pre class="">:~$ sudo chown -R $USER:$USER /var/www/html/osradar1.test/public_html/
:~$ sudo chown -R $USER:$USER /var/www/html/osradar2.test/public_html/</pre>
<p><figure id="attachment_5743" aria-describedby="caption-attachment-5743" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5743" src="https://www.osradar.com/wp-content/uploads/2018/09/8-5.png" alt="8.- Changing the owner of the folders" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/8-5.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/8-5-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/8-5-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/8-5-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/8-5-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/8-5-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/8-5-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5743" class="wp-caption-text">8.- Changing the owner of the folders</figcaption></figure></p>
<p>Finally, you must change the folder permissions.</p>
<h2>3. Create an index.html file for each host</h2>
<p>It&#8217;s time to create a test file for each host. Run:</p>
<pre class="">:~$ sudo nano /var/www/html/osradar1.test/public_html/index.html</pre>
<p>Add the following:</p>
<p><figure id="attachment_5744" aria-describedby="caption-attachment-5744" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5744" src="https://www.osradar.com/wp-content/uploads/2018/09/9-4.png" alt="9.- Creating the index.html file for the virtual hosts" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/9-4.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/9-4-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/9-4-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/9-4-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/9-4-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/9-4-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/9-4-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5744" class="wp-caption-text">9.- Creating the index.html file for the virtual hosts</figcaption></figure></p>
<p>Now do it with the other one.</p>
<pre class="">:~$ sudo nano /var/www/html/osradar2.test/public_html/index.html</pre>
<p><figure id="attachment_5745" aria-describedby="caption-attachment-5745" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5745" src="https://www.osradar.com/wp-content/uploads/2018/09/10-4.png" alt="10.- Creating the second index.html for the other virtual host" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/10-4.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/10-4-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/10-4-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/10-4-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/10-4-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/10-4-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/10-4-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5745" class="wp-caption-text">10.- Creating the second index.html for the other virtual host</figcaption></figure></p>
<p>It&#8217;s done.</p>
<h2>4. Create the configuration file for each host</h2>
<p>Then, you must create the configuration files for each Virtual hosts (block servers). In the first place, copy the Block server file by default, it will serve as a guide. Type:</p>
<pre class="">:~$ sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/osradar1.test.conf
:~$ sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/osradar2.test.conf</pre>
<p><figure id="attachment_5746" aria-describedby="caption-attachment-5746" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5746" src="https://www.osradar.com/wp-content/uploads/2018/09/11-3.png" alt="11.- Copying the default block server configuration file" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/11-3.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/11-3-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/11-3-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/11-3-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/11-3-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/11-3-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/11-3-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5746" class="wp-caption-text">11.- Copying the default block server configuration file</figcaption></figure></p>
<p>Now proceed to edit them. You need to change two things: server name and root directives.</p>
<pre class="">:~$  sudo nano /etc/nginx/sites-available/osradar1.test.conf</pre>
<p><figure id="attachment_5747" aria-describedby="caption-attachment-5747" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5747" src="https://www.osradar.com/wp-content/uploads/2018/09/12-3.png" alt="12.- Editing first configuration file" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/12-3.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/12-3-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/12-3-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/12-3-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/12-3-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/12-3-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/12-3-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5747" class="wp-caption-text">12.- Editing first configuration file</figcaption></figure></p>
<p>Now do the same for the other file. However, add a # on both &#8220;listen&#8221; lines.</p>
<p><figure id="attachment_5751" aria-describedby="caption-attachment-5751" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5751" src="https://www.osradar.com/wp-content/uploads/2018/09/13-1-1.png" alt="13.- Editing the second file configuration" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/13-1-1.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/13-1-1-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/13-1-1-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/13-1-1-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/13-1-1-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/13-1-1-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/13-1-1-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5751" class="wp-caption-text">13.- Editing the second file configuration</figcaption></figure></p>
<pre class="">:~$ sudo nano /etc/nginx/sites-available/osradar2.test.conf</pre>
<p>That&#8217;s it. Now activate the Server Blocks.</p>
<h2>5. Enable Nginx server blocks</h2>
<p>Now, you can enable the new newly created server blocks. To do this, first, disable the default one:</p>
<pre class="">:~$ sudo rm /etc/nginx/sites-enabled/default
:~$ sudo ln -s /etc/nginx/sites-available/osradar1.test.conf /etc/nginx/sites-enabled/
:~$ sudo ln -s /etc/nginx/sites-available/osradar2.test.conf /etc/nginx/sites-enabled/</pre>
<p><figure id="attachment_5750" aria-describedby="caption-attachment-5750" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5750" src="https://www.osradar.com/wp-content/uploads/2018/09/14.png" alt="14.- Enabling the new server blocks" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/14.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/14-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/14-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/14-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/14-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/14-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/14-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5750" class="wp-caption-text">14.- Enabling the new server blocks</figcaption></figure></p>
<p>You need to reboot the nginx service. For this reason, type.</p>
<pre class="">:~ sudo systemctl restart nginx</pre>
<h2>6. Test the new server block</h2>
<p>Now it&#8217;s time to verify that everything is correct. Edit your <code>/etc/hosts</code> file and add your IP and virtual hosts.</p>
<pre class="">:~$ sudo nano /etc/hosts</pre>
<p><figure id="attachment_5752" aria-describedby="caption-attachment-5752" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5752" src="https://www.osradar.com/wp-content/uploads/2018/09/15.png" alt="15.- Editing the hosts files" width="1366" height="767" srcset="https://www.osradar.com/wp-content/uploads/2018/09/15.png 1366w, https://www.osradar.com/wp-content/uploads/2018/09/15-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/15-768x431.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/15-1024x575.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/15-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/15-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/09/15-748x420.png 748w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-5752" class="wp-caption-text">15.- Editing the hosts files</figcaption></figure></p>
<p>Now go to your web browser and enter the address of the server block (virtual host) and test.</p>
<p><figure id="attachment_5753" aria-describedby="caption-attachment-5753" style="width: 1173px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5753" src="https://www.osradar.com/wp-content/uploads/2018/09/16.png" alt="16.- Showing results for osradar2.test" width="1173" height="175" srcset="https://www.osradar.com/wp-content/uploads/2018/09/16.png 1173w, https://www.osradar.com/wp-content/uploads/2018/09/16-300x45.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/16-768x115.png 768w, https://www.osradar.com/wp-content/uploads/2018/09/16-1024x153.png 1024w, https://www.osradar.com/wp-content/uploads/2018/09/16-696x104.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/16-1068x159.png 1068w" sizes="(max-width: 1173px) 100vw, 1173px" /><figcaption id="caption-attachment-5753" class="wp-caption-text">16.- Showing results for osradar2.test</figcaption></figure></p>
<p><figure id="attachment_5754" aria-describedby="caption-attachment-5754" style="width: 742px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-5754" src="https://www.osradar.com/wp-content/uploads/2018/09/17.png" alt="16.- Showing results for osradar1.test" width="742" height="148" srcset="https://www.osradar.com/wp-content/uploads/2018/09/17.png 742w, https://www.osradar.com/wp-content/uploads/2018/09/17-300x60.png 300w, https://www.osradar.com/wp-content/uploads/2018/09/17-696x139.png 696w, https://www.osradar.com/wp-content/uploads/2018/09/17-741x148.png 741w" sizes="(max-width: 742px) 100vw, 742px" /><figcaption id="caption-attachment-5754" class="wp-caption-text">16.- Showing results for osradar1.test</figcaption></figure></p>
<p>In the final analysis, I can say that nginx is a valid alternative to Apache. The way virtual hosts are created is very simple and within the reach of many.</p>
<p>We want to hear from you and your experience with nginx, tell us how it went?</p>
<p>Please spread this article through your social networks.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-nginx-server-blocks-on-ubuntu-18-04/">How to configure Nginx Server Blocks on Ubuntu 18.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-configure-nginx-server-blocks-on-ubuntu-18-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
