{"id":254,"date":"2022-11-23T08:35:42","date_gmt":"2022-11-23T08:35:42","guid":{"rendered":"http:\/\/thekraftors.com\/blog\/?p=254"},"modified":"2022-11-23T08:44:52","modified_gmt":"2022-11-23T08:44:52","slug":"how-to-setup-a-virtual-host-on-ubuntu","status":"publish","type":"post","link":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/","title":{"rendered":"How To Setup A Virtual Host On Ubuntu"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">The term \u201c<strong>Virtual Hosting<\/strong>\u201d refers to the hosting of many domains on a single server. In Linux-based systems such as&nbsp;<strong>Ubuntu 22.04<\/strong>, a&nbsp;<strong>Virtual Host<\/strong>&nbsp;is a configuration directive in Apache that permits you to operate several websites on a single server.<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">&nbsp;<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is a virtual host?<\/h3>\n\n\n\n<p>A virtual host allows you to run more than one website on a single web server by using separate configuration files. This means you can configure each site with its own domain name, IP address, and other settings. You can also make changes to the same configuration file for multiple sites at once.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p>Before you begin this tutorial, you will need:<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"A\">\n<li>An Ubuntu 20.04 server with a non-root user with sudo privileges. You can use our&nbsp;Initial Server Setup with Ubuntu 20.04&nbsp;guide to set this up.<\/li>\n\n\n\n<li>Apache installed on the server. You can learn how by completing steps 1-3 on our&nbsp;How To Install the Apache Web Server on Ubuntu 20.04&nbsp;tutorial.<\/li>\n<\/ol>\n\n\n\n<p>The Apache HTTP server is a popular open-source web server that offers flexibility, power, and widespread support for developers. Apache server configuration does not take place in a single monolithic file, but instead happens through a modular design where new files can be added and modified as needed. Within this modular design, you can create an individual site or domain called a&nbsp;<em>virtual host<\/em>.<\/p>\n\n\n\n<p>Using virtual hosts, one Apache instance can serve multiple websites. Each domain or individual site that is configured using Apache will direct the visitor to a specific directory holding that site\u2019s information. This is done without indicating to the visitor that the same server is also responsible for other sites. This scheme is expandable without any software limit as long as your server can handle the load.<\/p>\n\n\n\n<p>In this guide, you will set up Apache virtual hosts on an Ubuntu 20.04 server. During this process, you\u2019ll learn how to serve different content to different visitors depending on which domains they are requesting by creating two virtual host sites.<\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#dbe3ea\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>If you are using DigitalOcean, you can learn how to set up domains by following our product documentation,&nbsp;How to Add Domains.<\/strong><\/p>\n\n\n\n<p><strong>In order to successfully complete this tutorial, you will need two domains with:<\/strong><\/p>\n\n\n\n<p><strong>An A record with your_domain pointing to your server\u2019s public IP address.<\/strong><\/p>\n\n\n\n<p><strong>An A record with www.your_domain pointing to your server\u2019s public IP address.<\/strong><strong>For other providers, please refer to their relevant product documentation<\/strong><\/p>\n<\/div><\/div>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f5c8d3\"><strong>Note:<\/strong><strong>&nbsp;If you do&nbsp;<\/strong><strong>not<\/strong><strong>&nbsp;have domains available at this time, you can use test values locally on your computer. Step 6 of this tutorial will show you how to test and configure your test values. This will allow you to validate your configuration even though your content won\u2019t be available to other visitors through the domain name.<\/strong><strong><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 \u2014 Creating the Directory Structure<\/h2>\n\n\n\n<p>The first step is to create a directory structure that will hold the site data that you will be serving to visitors.<\/p>\n\n\n\n<p>Your document root, the top-level directory that Apache looks at to find content to serve, will be set to individual directories under the \/var\/www directory. You will create a directory here for each of the virtual hosts.<\/p>\n\n\n\n<p>Within each of these directories, you will create a public_html directory. The public_html directory contains the content that will be served to your visitors. The parent directories, named here as your_domain_1 and your_domain_2, will hold the scripts and application code to support the web content.<\/p>\n\n\n\n<p>Use these commands, with your own domain names, to create your directories:<\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#d6dde4\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>sudo mkdir -p \/var\/www\/your_domain_1\/public_html<\/strong><strong><\/strong><\/p>\n\n\n\n<p><strong>sudo mkdir -p \/var\/www\/your_domain_2\/public_html<\/strong><strong><\/strong><\/p>\n<\/div><\/div>\n\n\n\n<p>Be sure to replace your_domain_1 and your_domain_2 with your own respective domains. For example, if one of your domains was example.com you would create this directory structure:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#d3dae1\"><strong>\/var\/www\/example.com\/public_html.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 \u2014 Granting Permissions<\/h2>\n\n\n\n<p>You\u2019ve created the directory structure for your files, but they are owned by the&nbsp;<strong>root<\/strong>&nbsp;user. If you want your regular user to be able to modify files in these web directories, you can change the ownership with these commands:<\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#d2d7db\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>sudo chown -R $USER:$USER \/var\/www\/your_domain_1\/public_html<\/strong><\/p>\n\n\n\n<p><strong>sudo chown -R $USER:$USER \/var\/www\/your_domain_2\/public_html<\/strong><strong><\/strong><\/p>\n<\/div><\/div>\n\n\n\n<p>The $USER variable will take the value of the user you are currently logged in as when you press ENTER. By doing this, the regular user now owns the public_html subdirectories where you will be storing your content.<\/p>\n\n\n\n<p>You should also modify your permissions to ensure that read access is permitted to the general web directory and all of the files and folders it contains so that the pages can be served correctly:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#ced3d7\"><strong>$ sudo chmod -R 755 \/var\/www<\/strong><strong><\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Your web server now has the permissions it needs to serve content, and your user should be able to create content within the necessary folders. The next step is to create content for your virtual host sites.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 \u2014 Creating Default Pages for Each Virtual Host<\/h2>\n\n\n\n<p>We\u2019ll also create an index.html file inside the domain document root directory that will be shown when you visit the domain in your browser<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#cbd0d5\"><strong>:\/var\/www\/domain1.com\/public_html\/index.html<\/strong><strong><\/strong><\/p>\n\n\n\n<p>Since the commands above are executed as a sudo user, the newly created files and directories are owned by root. To avoid any permission issues change the ownership of the domain document root directory and all files within the directory to the apache user (www-data) :<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 \u2014 Creating a Virtual Hosts<\/h2>\n\n\n\n<p>On Ubuntu systems, Apache Virtual Hosts configuration files are located in&nbsp;\/etc\/apache2\/sites-available&nbsp;directory. They can be enabled by creating symbolic links to the&nbsp;\/etc\/apache2\/sites-enabled&nbsp;directory, which Apache read during the startup.<\/p>\n\n\n\n<p>On Ubuntu systems, Apache Virtual Hosts configuration files are located in&nbsp;\/etc\/apache2\/sites-available&nbsp;directory. They can be enabled by creating symbolic links to the&nbsp;\/etc\/apache2\/sites-enabled&nbsp;directory, which Apache read during the startup.<\/p>\n\n\n\n<p>Open your&nbsp;text editor&nbsp;of choice and create the following basic Virtual Host configuration file:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#dcdfe2\"><strong>\/etc\/apache2\/sites-available\/domain1.com.conf<\/strong><\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#dee3e8\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>&lt;VirtualHost *:80&gt;<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp; ServerName domain1.com<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp; ServerAlias www.domain1.com<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp; ServerAdmin webmaster@domain1.com<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp; DocumentRoot \/var\/www\/domain1.com\/public_html<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp; &lt;Directory \/var\/www\/domain1.com\/public_html&gt;<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;Options -Indexes +FollowSymLinks<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AllowOverride All<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp; &lt;\/Directory&gt;<\/strong><strong><\/strong><\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; <strong>ErrorLog ${APACHE_LOG_DIR}\/domain1.com-error.log<\/strong><\/p>\n\n\n\n<p><strong>&nbsp;&nbsp;&nbsp; CustomLog ${<\/strong><strong><\/strong><\/p>\n<\/div><\/div>\n\n\n\n<p>ServerName: The domain that should match for this virtual host configuration. This should be your domain name.<\/p>\n\n\n\n<p>ServerAlias: All other domains or subdomains that should match for this virtual host such as the www subdomain.<\/p>\n\n\n\n<p>DocumentRoot: The directory from which Apache will serve the domain files.<\/p>\n\n\n\n<p>Options: This directive controls which server features are available in a specific directory.<\/p>\n\n\n\n<p>-Indexes: Prevents directory listings.<\/p>\n\n\n\n<p>FollowSymLinks: When this option is enabled, Apache will follow the symbolic links.<\/p>\n\n\n\n<p>AllowOverride: Specifies which directives declared in the .htaccess file can override the configuration directives.<\/p>\n\n\n\n<p>ErrorLog, CustomLog: Specifies the location for log files.<\/p>\n\n\n\n<p>You can name the configuration file as you like, but the best practice is to use the domain name as the name of the virtual host configuration file. To enable the new virtual host file, use the a2ensite helper script which creates a symbolic link from the virtual host file to the sites-enabled directory:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#dee0e3\"><strong>sudo a2ensite domain1.com<\/strong><\/p>\n\n\n\n<p>Once done, test the configuration for any syntax errors with:<\/p>\n\n\n\n<p>sudo apachectl configtest<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#dcdee0\"><code><strong>Step 6 \u2014 (Optional) Setting Up Local Hosts File<\/strong><\/code><\/p>\n\n\n\n<p>If you haven\u2019t been using actual domain names that you own to test this procedure, and have been using example domains instead, you can still test the functionality of your virtual host sites by temporarily modifying the&nbsp;<code>hosts<\/code>&nbsp;file on your local computer. This will intercept any requests for the domains that you configured and point them to your Virtual Private Server (VPS), just as the DNS system would do if you were using registered domains. This will only work from your local computer and is only for testing purposes.<\/p>\n\n\n\n<p>Make sure you are operating on your local computer for these steps and not your VPS server. You will need to know the computer\u2019s administrative password or otherwise be a member of the administrative group.<\/p>\n\n\n\n<p>If you are on a Mac or Linux computer, edit your local file with administrative privileges by typing:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#dce0e4\"><strong>sudo nano \/etc\/hosts<\/strong><strong><\/strong><\/p>\n\n\n\n<p>If you are on a Windows machine, open the Command Prompt and type:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#dee2e5\"><strong>notepad %windir%\\system32\\drivers\\etc\\hosts<\/strong><strong><\/strong><\/p>\n\n\n\n<p>The details that you need to add are the public IP address of your server, followed by the domain you want to use to reach that server. Using the domains used in this guide, and replacing your server IP for the your_server_IP text, your file should look like this:<\/p>\n\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#d3d7d9\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h4 class=\"wp-block-heading\">127.0.0.1&nbsp;&nbsp; localhost<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">127.0.1.1&nbsp;&nbsp; guest-desktop<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">your_server_IP your_domain_1<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">your_server_IP your_domain_2<\/h4>\n<\/div><\/div>\n\n\n\n<p>This will direct any requests for your two domains on your computer and send them to your server at the designated IP address.<\/p>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<p>If there are no errors, you will see the following output:<\/p>\n\n\n\n<p><strong>Syntax OK<\/strong><strong><\/strong><\/p>\n\n\n\n<p>Restart the Apache service for the changes to take effect:<\/p>\n\n\n\n<p>sudo systemctl restart apache2<\/p>\n\n\n\n<p>Finally to verify that everything is working as expected, open http:\/\/domain1.com in your browser, and you will see the content of the index.html page:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" src=\"http:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8-1024x121.png\" alt=\"\" class=\"wp-image-255\" width=\"946\" height=\"112\" srcset=\"https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8-1024x121.png 1024w, https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8-300x35.png 300w, https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8-768x91.png 768w, https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8.png 1204w\" sizes=\"(max-width: 946px) 100vw, 946px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>You have learned how to create an apache virtual host configuration to host multiple domains on a single Ubuntu server.<\/p>\n\n\n\n<p>Repeat the steps we outlined above to create additional virtual hosts for all your domains.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"21\" src=\"http:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-9-1024x21.png\" alt=\"\" class=\"wp-image-256\" srcset=\"https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-9-1024x21.png 1024w, https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-9-300x6.png 300w, https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-9-768x16.png 768w, https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-9.png 1118w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The term \u201cVirtual Hosting\u201d refers to the hosting of many domains on a single server. In Linux-based systems such as&nbsp;Ubuntu 22.04, a&nbsp;Virtual Host&nbsp;is a configuration directive in Apache that permits&hellip;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-254","post","type-post","status-publish","format-standard","hentry","category-devops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Setup A Virtual Host On Ubuntu - The Kraftors<\/title>\n<meta name=\"description\" content=\"Check out the latest news and trending articles on the latest technologies, such as AI, AR\/VR, and e-commerce. Mobile application and more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Setup A Virtual Host On Ubuntu - The Kraftors\" \/>\n<meta property=\"og:description\" content=\"Check out the latest news and trending articles on the latest technologies, such as AI, AR\/VR, and e-commerce. Mobile application and more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"The Kraftors\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/thekraftors\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-23T08:35:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-23T08:44:52+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8-1024x121.png\" \/>\n<meta name=\"author\" content=\"Ajeet Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@the_kraftors\" \/>\n<meta name=\"twitter:site\" content=\"@the_kraftors\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajeet Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/\",\"url\":\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/\",\"name\":\"How To Setup A Virtual Host On Ubuntu - The Kraftors\",\"isPartOf\":{\"@id\":\"https:\/\/thekraftors.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8-1024x121.png\",\"datePublished\":\"2022-11-23T08:35:42+00:00\",\"dateModified\":\"2022-11-23T08:44:52+00:00\",\"author\":{\"@id\":\"https:\/\/thekraftors.com\/blog\/#\/schema\/person\/45d29e37a8abbe89d690103dbed36899\"},\"description\":\"Check out the latest news and trending articles on the latest technologies, such as AI, AR\/VR, and e-commerce. Mobile application and more.\",\"breadcrumb\":{\"@id\":\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#primaryimage\",\"url\":\"https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8.png\",\"contentUrl\":\"https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8.png\",\"width\":1204,\"height\":142},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/thekraftors.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Setup A Virtual Host On Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/thekraftors.com\/blog\/#website\",\"url\":\"https:\/\/thekraftors.com\/blog\/\",\"name\":\"The Kraftors\",\"description\":\"AI | AR | eCommerce | Devops | Magento | Flutter\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/thekraftors.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/thekraftors.com\/blog\/#\/schema\/person\/45d29e37a8abbe89d690103dbed36899\",\"name\":\"Ajeet Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/thekraftors.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f2d799a03ab24318174556b39ac9de67784b8a874a308e3a5fd374fe2199a51d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f2d799a03ab24318174556b39ac9de67784b8a874a308e3a5fd374fe2199a51d?s=96&d=mm&r=g\",\"caption\":\"Ajeet Kumar\"},\"url\":\"https:\/\/thekraftors.com\/blog\/author\/ajeet\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Setup A Virtual Host On Ubuntu - The Kraftors","description":"Check out the latest news and trending articles on the latest technologies, such as AI, AR\/VR, and e-commerce. Mobile application and more.","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:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How To Setup A Virtual Host On Ubuntu - The Kraftors","og_description":"Check out the latest news and trending articles on the latest technologies, such as AI, AR\/VR, and e-commerce. Mobile application and more.","og_url":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/","og_site_name":"The Kraftors","article_publisher":"https:\/\/www.facebook.com\/thekraftors\/","article_published_time":"2022-11-23T08:35:42+00:00","article_modified_time":"2022-11-23T08:44:52+00:00","og_image":[{"url":"http:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8-1024x121.png"}],"author":"Ajeet Kumar","twitter_card":"summary_large_image","twitter_creator":"@the_kraftors","twitter_site":"@the_kraftors","twitter_misc":{"Written by":"Ajeet Kumar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/","url":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/","name":"How To Setup A Virtual Host On Ubuntu - The Kraftors","isPartOf":{"@id":"https:\/\/thekraftors.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#primaryimage"},"thumbnailUrl":"http:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8-1024x121.png","datePublished":"2022-11-23T08:35:42+00:00","dateModified":"2022-11-23T08:44:52+00:00","author":{"@id":"https:\/\/thekraftors.com\/blog\/#\/schema\/person\/45d29e37a8abbe89d690103dbed36899"},"description":"Check out the latest news and trending articles on the latest technologies, such as AI, AR\/VR, and e-commerce. Mobile application and more.","breadcrumb":{"@id":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#primaryimage","url":"https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8.png","contentUrl":"https:\/\/thekraftors.com\/blog\/wp-content\/uploads\/2022\/11\/image-8.png","width":1204,"height":142},{"@type":"BreadcrumbList","@id":"https:\/\/thekraftors.com\/blog\/how-to-setup-a-virtual-host-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thekraftors.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Setup A Virtual Host On Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/thekraftors.com\/blog\/#website","url":"https:\/\/thekraftors.com\/blog\/","name":"The Kraftors","description":"AI | AR | eCommerce | Devops | Magento | Flutter","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thekraftors.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thekraftors.com\/blog\/#\/schema\/person\/45d29e37a8abbe89d690103dbed36899","name":"Ajeet Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thekraftors.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f2d799a03ab24318174556b39ac9de67784b8a874a308e3a5fd374fe2199a51d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f2d799a03ab24318174556b39ac9de67784b8a874a308e3a5fd374fe2199a51d?s=96&d=mm&r=g","caption":"Ajeet Kumar"},"url":"https:\/\/thekraftors.com\/blog\/author\/ajeet\/"}]}},"_links":{"self":[{"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/posts\/254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":2,"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/posts\/254\/revisions"}],"predecessor-version":[{"id":259,"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/posts\/254\/revisions\/259"}],"wp:attachment":[{"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/categories?post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thekraftors.com\/blog\/wp-json\/wp\/v2\/tags?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}