{"id":585,"date":"2018-06-20T02:14:11","date_gmt":"2018-06-20T07:14:11","guid":{"rendered":"https:\/\/linuxhostsupport.com\/blog\/?p=585"},"modified":"2018-06-25T01:54:26","modified_gmt":"2018-06-25T06:54:26","slug":"how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/","title":{"rendered":"How to set up Apache Virtual Hosts on Ubuntu 16.04"},"content":{"rendered":"<div id=\"linux-3762705634\" class=\"linux-before-1st-paragraph linux-entity-placement\" style=\"margin-top: 15px;margin-bottom: 15px;\"><a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting\/?mtm_campaign=blogs&#038;mtm_source=lhs&#038;mtm_medium=blog&#038;mtm_content=managed-vps&#038;mtm_cid=1339&#038;mtm_placement=inline\" aria-label=\"Untitled\"><img src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322.jpg\" alt=\"\"  srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322.jpg 728w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" width=\"728\" height=\"90\"  style=\"display: inline-block;\" \/><\/a><\/div><p>Apache is a free and open source web server, it is the most popular web server in the world, and is commonly used in Linux servers. It is developed and maintained by Apache Software Foundation, over half of all servers around the world are running this fast and secure web server. In this tutorial, we will show you how to set up Apache virtual hosts on Ubuntu 16.04, to host as many websites as you want, the limit is your server&#8217;s resources like RAM, disk space, etc.<\/p>\n<p><!--more--><\/p>\n<h2>What is virtual host?<\/h2>\n<p>Virtual host is used to host a number of websites on the same web server. The web server could be Apache, nginx, Litespeed, etc. Apache supports two types of virtual host:<\/p>\n<p>Name based virtual hosts<br \/>\nIP based virtual hosts<\/p>\n<p>The name based virtual host is commonly used to host multiple websites on the same server, whereas in IP based virtual host we can only configure one website on one IP address. In this tutorial, we will show you how to create name based virtual hosts. We will host domainone.com and domaintwo.com on a server, please replace them with your actual domain names.<\/p>\n<h2>How to create virtual host<\/h2>\n<p>Let&#8217;s SSH in to the server and proceed to the next step.<\/p>\n<pre>ssh root@Your_IP_Address -p7022<\/pre>\n<h2>Create directory for domains&#8217; webroot<\/h2>\n<pre>mkdir -p \/var\/www\/html\/{domainone.com,domaintwo.com}\/{public_html,logs}\r\n<img decoding=\"async\" class=\"size-full wp-image-587 alignnone\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\" alt=\"set up Apache Virtual Hosts on Ubuntu 16.04\" width=\"700\" height=\"81\" srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg 700w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04-300x35.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/pre>\n<p>The command above will create four directories, two of them will be our domains&#8217; document root, and the other tw will be used to store our apache log files:<\/p>\n<p>\/var\/www\/html\/domainone.com\/public_html<br \/>\n\/var\/www\/html\/domaintwo.com\/public_html<br \/>\n\/var\/www\/html\/domainone.com\/logs<br \/>\n\/var\/www\/html\/domaintwo.com\/logs<\/p>\n<h2>Create test pages<\/h2>\n<p>Now, let&#8217;s create a test page for domainone.com<\/p>\n<pre>nano \/var\/www\/html\/domainone.com\/public_html\/index.html<\/pre>\n<pre><code><\/code><\/pre>\n<p>&lt;html&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;center&gt;&lt;h1&gt;This is domainone.com!&lt;\/h1&gt;&lt;\/center&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>Save and exit nano with Ctrl + O then Ctrl + X<\/p>\n<p>Let&#8217;s copy the index test page to domaintwo.com<\/p>\n<pre>cp \/var\/www\/html\/domainone.com\/public_html\/index.html \/var\/www\/html\/domaintwo.com\/public_html\/<\/pre>\n<p>Okay, the index test page has been copied, but we need to edit the index page for domaintwo.com<\/p>\n<pre>sed -i 's\/domainone.com\/domaintwo.com\/g' \/var\/www\/html\/domaintwo.com\/public_html\/index.html<\/pre>\n<p>We have successfully created an index test page for both domain names. Let&#8217;s give permission to user www-data, the default user who runs the apache.<\/p>\n<pre>chown -R www-data: \/var\/www\/html\/\r\n<img decoding=\"async\" class=\"alignnone wp-image-588 size-full\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/Apache-Virtual-Hosts-on-Ubuntu-16.jpg\" alt=\"Apache Virtual Hosts on Ubuntu 16.04\" width=\"700\" height=\"56\" srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/Apache-Virtual-Hosts-on-Ubuntu-16.jpg 700w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/Apache-Virtual-Hosts-on-Ubuntu-16-300x24.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/pre>\n<h2>Create a virtual host<\/h2>\n<p>Now, let&#8217;s create a virtual host configuration file for domainone.com. The virtual host configuration file should be ended with .conf extension<\/p>\n<pre>nano \/etc\/apache2\/sites-available\/domainone.com.conf<\/pre>\n<pre>ServerAdmin admin@domainone.com\r\nServerName domainone.com\r\nServerAlias www.domainone.com\r\nDocumentRoot \/var\/www\/html\/domainone.com\/public_html\r\n\r\nErrorLog \/var\/www\/html\/domainone.com\/logs\/error.log\r\nCustomLog \/var\/www\/html\/domainone.com\/logs\/access.log combined\r\n\r\n<\/pre>\n<p>The virtual host configuration file for domainone.com has been created, now we only need to copy and edit it for domaintwo.com<\/p>\n<pre>cp \/etc\/apache2\/sites-available\/domainone.com.conf \/etc\/apache2\/sites-available\/domaintwo.com.conf<\/pre>\n<pre>sed -i 's\/domainone.com\/domaintwo.com\/g' \/etc\/apache2\/sites-available\/domaintwo.com.conf<\/pre>\n<p>We will give you a short explanation about the content of virtual host configuration file.<\/p>\n<p>&lt;VirtualHost *:80&gt;<br \/>\nThe virtual host is listening on port 80<\/p>\n<pre>ServerAdmin admin@domainone.com<\/pre>\n<p>The ServerAdmin sets the contact address that the server includes in any error messages it returns to the client. You can specify your email address here, or even remove the line.<\/p>\n<pre>ServerName domainone.com\r\nServerAlias www.domainone.com<\/pre>\n<p>This directive is needed, it tells Apache that Apache will process the domain request. Apache will search for virtual host files and process all request if domain\/subdomain match with the one configured on ServerName or ServerAlias directive.<\/p>\n<pre>DocumentRoot \/var\/www\/html\/domainone.com\/public_html<\/pre>\n<p>This directive is also important, we need to tell Apache where the document root of domaincone.com is. If we don&#8217;t specify it, apache will load the default document root, which is in \/var\/www\/html<\/p>\n<p>ErrorLog and CustomLog are the directives to save the log of a domain name hosted on the server.<\/p>\n<h2>Enable virtual host<\/h2>\n<p>In Ubuntu, we can simply issue the following commands to enable the virtual hosts<\/p>\n<pre>a2ensite domainone.com\r\na2ensite domaintwo.com<\/pre>\n<p><img decoding=\"async\" class=\"alignleft size-full wp-image-589\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/Setting-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\" alt=\"Setting up Apache Virtual Hosts on Ubuntu 16.04\" width=\"527\" height=\"145\" srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/Setting-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg 527w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/Setting-up-Apache-Virtual-Hosts-on-Ubuntu-16.04-300x83.jpg 300w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Those commands will enable the virtual hosts, but we also need to reload\/restart Apache after enabling\/disabling the virtual host. The command actually creates a symbolic link in \/etc\/apache2\/sites-enabled. You can also run the following commands instead of invoking the &#8216;a2ensite&#8217; command:<\/p>\n<pre>ln -s \/etc\/apache2\/sites-available\/domainone.com.conf \/etc\/apache2\/sites-enabled\/\r\nln -s \/etc\/apache2\/sites-available\/domaintwo.com.conf \/etc\/apache2\/sites-enabled\/<\/pre>\n<p>Now, restart apache to activate the new configuration.<\/p>\n<pre>systemctl restart apache2<\/pre>\n<p>That is all, we successfully created two Apache virtual hosts for the two domains. You can now open your web browser and navigate to the domain name of the newly created virtual hosts.<\/p>\n<p>http:\/\/domainone.com<\/p>\n<p><img decoding=\"async\" class=\"alignleft size-full wp-image-590\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\" alt=\"How to Setup Apache Virtual Hosts on Ubuntu 16.04\" width=\"700\" height=\"83\" srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg 700w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-Setup-Apache-Virtual-Hosts-on-Ubuntu-16.04-300x36.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/domaintwo.com<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-591 alignnone\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-do-I-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\" alt=\"How to do I set up Apache Virtual Hosts on Ubuntu 16.04\" width=\"700\" height=\"78\" srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-do-I-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg 700w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-do-I-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04-300x33.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><img decoding=\"async\" class=\"alignleft size-full wp-image-592\" src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-set-up-Apache-Virtual-Hosts-Ubuntu-16.04.jpg\" alt=\"How to set up Apache Virtual Hosts on Ubuntu 16.04\" width=\"200\" height=\"52\" \/>Of course, you don\u2019t need to\u00a0set up Apache Virtual Hosts on Ubuntu 16.04, if you use one of our <a href=\"https:\/\/linuxhostsupport.com\">Linux Server Management Services<\/a> \u2013 in which case, our technical support team will help you creating the virtual hosts immediately. They are available 24\/7, and can cater to any questions or requests.<\/p>\n<p><span style=\"color: #ff0000;\"><strong>PS<\/strong><\/span>. If you liked this post on How to set up Apache Virtual Hosts on Ubuntu 16.04, feel free to share it with your friends by using the social media share shortcuts below, or simply leave a comment. Thanks.<\/p><div id=\"linux-61308122\" class=\"linux-after-8th-paragraph linux-entity-placement\" style=\"margin-top: 15px;margin-bottom: 15px;\"><a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting\/?mtm_campaign=blogs&#038;mtm_source=lhs&#038;mtm_medium=blog&#038;mtm_content=managed-vps&#038;mtm_cid=1340&#038;mtm_placement=inline\" aria-label=\"Untitled\"><img src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622.jpg\" alt=\"\"  srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622.jpg 728w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" width=\"728\" height=\"90\"  style=\"display: inline-block;\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Apache is a free and open source web server, it is the most popular web server in the world, and is commonly used in Linux servers. It is developed and maintained by Apache Software Foundation, over half of all servers around the world are running this fast and secure web server. In this tutorial, we [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":586,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[67,20],"class_list":["post-585","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-apache","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to set up Apache Virtual Hosts on Ubuntu 16.04 | LinuxHostSupport<\/title>\n<meta name=\"description\" content=\"Apache is a free and open source web server, it is the most popular web server in the world, and is commonly used in Linux servers. It is developed and\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to set up Apache Virtual Hosts on Ubuntu 16.04 | LinuxHostSupport\" \/>\n<meta property=\"og:description\" content=\"Apache is a free and open source web server, it is the most popular web server in the world, and is commonly used in Linux servers. It is developed and\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxHostSupport\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/linuxhostsupport\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-20T07:14:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-06-25T06:54:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"410\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@lnxhostsupport\" \/>\n<meta name=\"twitter:site\" content=\"@lnxhostsupport\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\"},\"headline\":\"How to set up Apache Virtual Hosts on Ubuntu 16.04\",\"datePublished\":\"2018-06-20T07:14:11+00:00\",\"dateModified\":\"2018-06-25T06:54:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/\"},\"wordCount\":795,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\",\"keywords\":[\"apache\",\"ubuntu\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/\",\"name\":\"How to set up Apache Virtual Hosts on Ubuntu 16.04 | LinuxHostSupport\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\",\"datePublished\":\"2018-06-20T07:14:11+00:00\",\"dateModified\":\"2018-06-25T06:54:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\"},\"description\":\"Apache is a free and open source web server, it is the most popular web server in the world, and is commonly used in Linux servers. It is developed and\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\",\"contentUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg\",\"width\":750,\"height\":410,\"caption\":\"How to set up Apache Virtual Hosts on Ubuntu 16.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to set up Apache Virtual Hosts on Ubuntu 16.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/\",\"name\":\"LinuxHostSupport\",\"description\":\"Linux Tutorials and Guides\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/author\\\/r0s3admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to set up Apache Virtual Hosts on Ubuntu 16.04 | LinuxHostSupport","description":"Apache is a free and open source web server, it is the most popular web server in the world, and is commonly used in Linux servers. It is developed and","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/","og_locale":"en_US","og_type":"article","og_title":"How to set up Apache Virtual Hosts on Ubuntu 16.04 | LinuxHostSupport","og_description":"Apache is a free and open source web server, it is the most popular web server in the world, and is commonly used in Linux servers. It is developed and","og_url":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/","og_site_name":"LinuxHostSupport","article_publisher":"https:\/\/www.facebook.com\/linuxhostsupport","article_published_time":"2018-06-20T07:14:11+00:00","article_modified_time":"2018-06-25T06:54:26+00:00","og_image":[{"width":750,"height":410,"url":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@lnxhostsupport","twitter_site":"@lnxhostsupport","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/#article","isPartOf":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/"},"author":{"name":"admin","@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb"},"headline":"How to set up Apache Virtual Hosts on Ubuntu 16.04","datePublished":"2018-06-20T07:14:11+00:00","dateModified":"2018-06-25T06:54:26+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/"},"wordCount":795,"commentCount":0,"image":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg","keywords":["apache","ubuntu"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/","url":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/","name":"How to set up Apache Virtual Hosts on Ubuntu 16.04 | LinuxHostSupport","isPartOf":{"@id":"https:\/\/linuxhostsupport.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/#primaryimage"},"image":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg","datePublished":"2018-06-20T07:14:11+00:00","dateModified":"2018-06-25T06:54:26+00:00","author":{"@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb"},"description":"Apache is a free and open source web server, it is the most popular web server in the world, and is commonly used in Linux servers. It is developed and","breadcrumb":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/#primaryimage","url":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg","contentUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2018\/06\/How-to-set-up-Apache-Virtual-Hosts-on-Ubuntu-16.04.jpg","width":750,"height":410,"caption":"How to set up Apache Virtual Hosts on Ubuntu 16.04"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxhostsupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to set up Apache Virtual Hosts on Ubuntu 16.04"}]},{"@type":"WebSite","@id":"https:\/\/linuxhostsupport.com\/blog\/#website","url":"https:\/\/linuxhostsupport.com\/blog\/","name":"LinuxHostSupport","description":"Linux Tutorials and Guides","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxhostsupport.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/linuxhostsupport.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/comments?post=585"}],"version-history":[{"count":3,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/585\/revisions"}],"predecessor-version":[{"id":595,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/585\/revisions\/595"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/media\/586"}],"wp:attachment":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/media?parent=585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/categories?post=585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/tags?post=585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}