{"id":27450,"date":"2018-07-09T04:35:31","date_gmt":"2018-07-09T09:35:31","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=27450"},"modified":"2022-06-03T03:34:50","modified_gmt":"2022-06-03T08:34:50","slug":"how-to-set-up-apache-virtual-hosts-on-debian-9","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/","title":{"rendered":"How to set up Apache Virtual Hosts on Debian 9"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"size-full wp-image-27456 alignnone\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg\" alt=\"How to set up Apache Virtual Hosts on Debian 9\" width=\"742\" height=\"371\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9-150x75.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9-300x150.jpg 300w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/p>\n<p>In this tutorial, we will show you how to set up Apache virtual hosts on Debian 9.\u00a0Apache is a free and open source web server. It is the most popular and widely used web server in the world, and it 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.<\/p>\n<p><!--more--><\/p>\n<p>Requirements<\/p>\n<p>&#8211; SSH access with root privileges to your Debian 9 server<br \/>\n&#8211; Properly installed and configured Apache web server<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a1efaa56b841\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a1efaa56b841\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#1-Login-to-your-server\" >1. Login to your server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#2-Check-for-Apache-installation\" >2. Check for Apache installation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#3-What-is-a-virtual-host\" >3. What is a virtual host?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#4-Create-the-webroot-directories\" >4. Create the webroot directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#5-Create-the-Virtual-Host-Files\" >5. Create the Virtual Host Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#6-Enabling-the-virtual-hosts\" >6. Enabling the virtual hosts<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1-Login-to-your-server\"><\/span>1. Login to your server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>First, let&#8217;s log in to your server via SSH:<\/p>\n<pre>ssh root@server_ip<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"2-Check-for-Apache-installation\"><\/span>2. Check for Apache installation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Check whether apache is already installed and running on your server. You can do this with the following command:<\/p>\n<pre>dpkg -l apache2<\/pre>\n<p>If apache is not installed, you can do this by running the following commands. First, make sure that the system repositories are up to date:<\/p>\n<pre>apt-get update<\/pre>\n<p>To install the Apache web server, execute the following:<\/p>\n<pre>apt-get install apache2<\/pre>\n<p>After the installation is complete, you should enable Apache to start automatically upon server reboot with:<\/p>\n<pre>systemctl enable apache2<\/pre>\n<p>You can also check the status of your Apache service with the following command:<\/p>\n<pre>systemctl status apache2<\/pre>\n<p>Now that we are sure that Apache is installed and running on our server we can continue with the next step and set up our first virtual host.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3-What-is-a-virtual-host\"><\/span>3. What is a virtual host?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Apache virtual hosts are set of configuration directives which allow you to host as many websites as you want, using a single web server.Apache web server tsupports two types of virtual hosts:<\/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, while in IP based virtual host we can only configure one website on one IP address. In this tutorial will show you how to create name-based virtual hosts. For this purpose, we will host two websites using the following domain names, <strong>domain1.com<\/strong> and <strong>domain2.com<\/strong>. You can also replace them with your actual domain names.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4-Create-the-webroot-directories\"><\/span>4. Create the webroot directories<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before setting up the virtual hosts, we will need to create the document root directories for our websites. Let&#8217;s create them in the <strong>\/var\/www\/<\/strong>html directory with the following commands:<\/p>\n<pre>mkdir -p \/var\/www\/html\/domain1.com\r\nmkdir -p \/var\/www\/html\/domain2.com<\/pre>\n<p>Let&#8217;s also create a test demo page for each of our domain, so we can later test our configuration.<br \/>\nNavigate to the <strong>domain1.com<\/strong> document root directory:<\/p>\n<pre>cd \/var\/www\/domain1.com<\/pre>\n<p>Create a new index.html page with:<\/p>\n<pre>nano index.html<\/pre>\n<p>And add the following content:<\/p>\n<pre>&lt;html&gt;\r\n &lt;body&gt;\r\n  &lt;center&gt;&lt;h1&gt;This is domain1.com!&lt;\/h1&gt;&lt;\/center&gt;\r\n &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Now lets, do the following for the <strong>domain2.com<\/strong> domain.<\/p>\n<pre>cd \/var\/www\/domain2.com\r\nnano index.html<\/pre>\n<p>And add the following content:<\/p>\n<pre>&lt;html&gt;\r\n &lt;body&gt;\r\n  &lt;center&gt;&lt;h1&gt;This is domain2.com!&lt;\/h1&gt;&lt;\/center&gt;\r\n &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>We have now successfully created the test pages for both domains. In order for our Apache webserver to be able to access these files, we also need to give them appropriate permissions and set the user and group to the <strong>www-data<\/strong>. We update the permissions to the whole <strong>\/var\/www\/<\/strong>html directory, with the following command.<\/p>\n<pre>chown -R www-data: \/var\/www\/html<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"5-Create-the-Virtual-Host-Files\"><\/span>5. Create the Virtual Host Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We can now create our virtual host files. The virtual host configuration files usually end with .conf extension.<br \/>\nRun the following command to create the virtual host configuration file for our first domain, <strong>domain1.com<\/strong>:<\/p>\n<pre>nano \/etc\/apache2\/sites-available\/domain1.com.conf<\/pre>\n<p>And add the following content to the file:<\/p>\n<pre>&lt;VirtualHost *:80&gt;\r\n\r\nServerAdmin admin@domain1.com\r\nServerName domain1.com\r\nServerAlias www.domain1.com\r\nDocumentRoot \/var\/www\/html\/domain1.com\r\n\r\nErrorLog ${APACHE_LOG_DIR}\/domain1.com_error.log\r\nCustomLog ${APACHE_LOG_DIR}\/domain2.com_access.log combined\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>Now, let&#8217;s do the same for our second domain name, <strong>domain2.com<\/strong>:<\/p>\n<pre>nano \/etc\/apache2\/sites-available\/domain2.com.conf<\/pre>\n<p>And add the following code:<\/p>\n<pre>&lt;VirtualHost *:80&gt;\r\n\r\nServerAdmin admin@domain2.com\r\nServerName domain2.com\r\nServerAlias www.domain2.com\r\nDocumentRoot \/var\/www\/html\/domain2.com\r\n\r\nErrorLog ${APACHE_LOG_DIR}\/domain2.com_error.log\r\nCustomLog ${APACHE_LOG_DIR}\/domain2.com_access.log combined\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>Here is a short explanation about each line in our virtual host files.<\/p>\n<p>The following lines shows that the virtual host is listening on port 80:<\/p>\n<pre>&lt;VirtualHost *:80&gt;<\/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>ServerAdmin admin@domain1.com<\/pre>\n<p>ServerName is the domain name and the ServerAlias defines additional names that should match as if they are the original domain names.<\/p>\n<pre>ServerName domain1.com\r\nServerAlias www.domain1.com<\/pre>\n<p>The DocumentRoot defines the location where Apache should look for when processing a request for the domain defined in ServerName or ServerAlias.<\/p>\n<pre>DocumentRoot \/var\/www\/html\/domain1.com<\/pre>\n<p>The last two lines, define the location of the log files:<\/p>\n<pre>ErrorLog ${APACHE_LOG_DIR}\/domain1.com_error.log\r\nCustomLog ${APACHE_LOG_DIR}\/domain1.com_access.log combined<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"6-Enabling-the-virtual-hosts\"><\/span>6. Enabling the virtual hosts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The next step would be to enable the virtual hosts we have just created. You can do this with the following commands:<\/p>\n<pre>a2ensite domain1.com.conf\r\na2ensite domain2.com.conf<\/pre>\n<p>Another alternative way to do this is by creating a symbolic link for each virtual host in \/etc\/apache2\/sites-enabled<\/p>\n<pre>ln -s \/etc\/apache2\/sites-available\/domain1.com.conf \/etc\/apache2\/sites-enabled\/\r\nln -s \/etc\/apache2\/sites-available\/domain2.com.conf \/etc\/apache2\/sites-enabled\/<\/pre>\n<p>Once you enable the virtual hosts, using either of above methods, you will need to restart the Apache web server:<\/p>\n<pre>systemctl restart apache2<\/pre>\n<p>That&#8217;s it. If you all the instructions properly you should now be able to open each of the domains in your web browser and get the following result.<\/p>\n<p>http:\/\/domain1.com<\/p>\n<p><img decoding=\"async\" class=\"alignleft size-full wp-image-27457\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/set-up-apache-virtual-hosts-debian-9.jpg\" alt=\"set up apache virtual hosts debian 9\" width=\"450\" height=\"227\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/set-up-apache-virtual-hosts-debian-9.jpg 450w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/set-up-apache-virtual-hosts-debian-9-150x76.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/set-up-apache-virtual-hosts-debian-9-300x151.jpg 300w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/domain2.com<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-27458 alignnone\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/apache-virtual-hosts-set-up-on-debian-9.jpg\" alt=\"apache virtual hosts set up on debian 9\" width=\"604\" height=\"268\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/apache-virtual-hosts-set-up-on-debian-9.jpg 604w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/apache-virtual-hosts-set-up-on-debian-9-150x67.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/apache-virtual-hosts-set-up-on-debian-9-300x133.jpg 300w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/p>\n<hr \/>\n<p>Of course, you don\u2019t need to set up Apache Virtual Hosts on Debian 9, if you use one of our <a href=\"https:\/\/www.rosehosting.com\/debian-hosting.html\">Debian VPS Hosting<\/a> services 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>PS. If you liked this post on How to set up Apache Virtual Hosts on Debian 9, feel free to share it with your friends by using the social media share shortcuts below, or simply leave a comment. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will show you how to set up Apache virtual hosts on Debian 9.\u00a0Apache is a free &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to set up Apache Virtual Hosts on Debian 9\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#more-27450\" aria-label=\"Read more about How to set up Apache Virtual Hosts on Debian 9\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":27456,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1700,1707],"tags":[37,48],"class_list":["post-27450","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","category-web-servers","tag-apache","tag-debian","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.7 (Yoast SEO v27.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to set up Apache Virtual Hosts on Debian 9 | RoseHosting<\/title>\n<meta name=\"description\" content=\"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/\" \/>\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 Debian 9\" \/>\n<meta property=\"og:description\" content=\"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-09T09:35:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T08:34:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"371\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to set up Apache Virtual Hosts on Debian 9\",\"datePublished\":\"2018-07-09T09:35:31+00:00\",\"dateModified\":\"2022-06-03T08:34:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/\"},\"wordCount\":865,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg\",\"keywords\":[\"apache\",\"debian\"],\"articleSection\":[\"Debian\",\"Web Servers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/\",\"name\":\"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg\",\"datePublished\":\"2018-07-09T09:35:31+00:00\",\"dateModified\":\"2022-06-03T08:34:50+00:00\",\"description\":\"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg\",\"width\":742,\"height\":371,\"caption\":\"How to set up Apache Virtual Hosts on Debian 9\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-apache-virtual-hosts-on-debian-9\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to set up Apache Virtual Hosts on Debian 9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting","description":"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting","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:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/","og_locale":"en_US","og_type":"article","og_title":"How to set up Apache Virtual Hosts on Debian 9","og_description":"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2018-07-09T09:35:31+00:00","article_modified_time":"2022-06-03T08:34:50+00:00","og_image":[{"width":742,"height":371,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to set up Apache Virtual Hosts on Debian 9","datePublished":"2018-07-09T09:35:31+00:00","dateModified":"2022-06-03T08:34:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/"},"wordCount":865,"commentCount":4,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg","keywords":["apache","debian"],"articleSection":["Debian","Web Servers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/","name":"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg","datePublished":"2018-07-09T09:35:31+00:00","dateModified":"2022-06-03T08:34:50+00:00","description":"How to set up Apache Virtual Hosts on Debian 9 | RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/07\/How-to-set-up-Apache-Virtual-Hosts-on-Debian-9.jpg","width":742,"height":371,"caption":"How to set up Apache Virtual Hosts on Debian 9"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-apache-virtual-hosts-on-debian-9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to set up Apache Virtual Hosts on Debian 9"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=27450"}],"version-history":[{"count":1,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27450\/revisions"}],"predecessor-version":[{"id":41786,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27450\/revisions\/41786"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/27456"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=27450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=27450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=27450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}