{"id":20732,"date":"2016-11-16T07:47:44","date_gmt":"2016-11-16T13:47:44","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=20732"},"modified":"2022-12-07T10:07:13","modified_gmt":"2022-12-07T16:07:13","slug":"apache-virtual-hosts-on-centos","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/","title":{"rendered":"How to set up Apache Virtual Hosts on CentOS 7"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"alignnone wp-image-24330 size-full\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png\" alt=\"How to set up Apache Virtual Hosts on CentOS 7\" width=\"1200\" height=\"600\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png 1200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-150x75.png 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-300x150.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-768x384.png 768w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-1024x512.png 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-860x430.png 860w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-680x340.png 680w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-500x250.png 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-400x200.png 400w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-200x100.png 200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7-50x25.png 50w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>Today we will show you How to setup Apache Virtual Hosts on CentOS 7. Apache is an open source web server developed for modern operating systems including UNIX and Windows. It is a secure, efficient and extensible server that provides HTTP services synchronized with the current HTTP standards.<\/p>\n<p>Many people use it to host their websites and apps. In fact, according to the latest statistics, Apache is the most used web server in the world, with Windows IIS following in second and in third the Russian machinery that is <a href=\"https:\/\/www.rosehosting.com\/nginx-hosting.html\">Nginx<\/a>. To setup Apache Virtual Hosts on CentOS 7 just follow our step by step tutorial below.<!--more--><\/p>\n<p>Apache&#8217;s functionality is great and one can find lots of good features for his website or application. In this tutorial, we will provide you with info about Apache Virtual Host through configuration examples on a <a href=\"https:\/\/www.rosehosting.com\/centos-hosting.html\" target=\"_blank\" rel=\"noopener noreferrer\">CentOS 7 VPS<\/a>.<\/p>\n<p>A virtual host is, in fact, a unit that describes an individual domain in the grand scheme of the Apache web server. It enables you to host multiple websites using one server which is very useful for people that have more than one website.<\/p>\n<p>Every domain that is configured with a virtual host directive inside Apache&#8217;s config will direct the visitor to a specific directory where that very website is hosted on the server. For example, you might have your WordPress site installed in <strong>\/var\/www\/wordpress\/<\/strong> so when creating the virtual host directive, the document root for the site will be set to <strong>\/var\/www\/wordpress<\/strong>\/ which will enable the web server to pull the website data from the respective configured directory.<\/p>\n<p>So let&#8217;s focus on our task at hand now.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 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-6a14f0440f88b\" 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-6a14f0440f88b\"  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\/apache-virtual-hosts-on-centos\/#1-Requirements\" >1. Requirements<\/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\/apache-virtual-hosts-on-centos\/#2-Update-the-system\" >2. Update the system<\/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\/apache-virtual-hosts-on-centos\/#3-Apache-Configuration-Settings\" >3. Apache Configuration Settings<\/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\/apache-virtual-hosts-on-centos\/#4-Configure-a-virtual-host-directive-for-your-domain\" >4.\u00a0Configure a virtual host directive for your domain.<\/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\/apache-virtual-hosts-on-centos\/#5-Settings-explanation\" >5. Settings explanation<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1-Requirements\"><\/span>1. Requirements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We will be using our SSD 1 Linux VPS hosting plan for this tutorial.<\/p>\n<p>Log in to your server via SSH:<\/p>\n<pre># ssh root@server_ip<\/pre>\n<p>Before starting, enter the command below to check whether you have the proper version of CentOS installed on your machine:<\/p>\n<pre># cat \/etc\/redhat-release<\/pre>\n<p>which should give you the underneath output:<\/p>\n<pre>CentOS Linux release 7.2.1511 (Core)<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"2-Update-the-system\"><\/span>2. Update the system<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Make sure your server is fully up to date:<\/p>\n<pre># yum update<\/pre>\n<p>On our CentOS 7 servers, Apache is installed by default. However, if you don&#8217;t have Apache installed on your server you can do that with a fairly simple command:<\/p>\n<pre># yum install httpd<\/pre>\n<p>Engage Apache and enable it to start on boot:<\/p>\n<pre># systemctl start httpd.service\r\n\r\n# systemctl enable httpd.service<\/pre>\n<p>Most webmasters today use WordPress as a platform to host their website. A <a href=\"https:\/\/www.rosehosting.com\/wordpress-hosting.html\">WordPress<\/a> site runs with a database so if you plan to use this article to create virtual hosts for a WordPress website\/s (or any platform that needs a database for that matter), you will need to install MySQL and PHP on your server which complete a so-called LAMP (Linux Apache, MariaDB &amp; PHP) stack. For more information, you can check our article on <a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/\" target=\"_blank\" rel=\"noopener noreferrer\">how to install LAMP on CentOS 7<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3-Apache-Configuration-Settings\"><\/span>3. Apache Configuration Settings<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Apache has a global configuration file where all the default settings are stored and applied to the server. The virtual host directive can be stored in that same default <strong>httpd.conf<\/strong> file or another one which will be respective to the configured website\/domain.<\/p>\n<p>That global Apache configuration file in CentOS 7 is <strong>\/etc\/httpd\/conf\/httpd.conf<\/strong>. You may use a text editor of your choice and check the content of that file so you get some insight on how Apache is configured.<\/p>\n<p>The config file has commented lines before every setting that explain their use. So for example, the <strong>ServerRoot<\/strong> setting is the top of the directory tree under which lie the Apache configuration files.<\/p>\n<p>The <strong>Listen<\/strong> directive binds Apache to a specific IP address and port. Apache&#8217;s default listening port is 80.<\/p>\n<p>The user\/group values are names of the user\/group that HTTPD (apache) runs as. In CentOS the user and group are <strong>apache\/apache<\/strong> and in Ubuntu\/Debian the values are <strong>www-data\/www-data<\/strong>.<\/p>\n<p>Another important setting is <strong>DocumentRoot<\/strong> which is the directory out of which the data will be served to the visitor. Usually, in most distros the default document root for Apache is set to <strong>\/var\/www\/html\/<\/strong> so if you put data in <strong>\/var\/www\/html\/<\/strong> you will be able to access that same data via a web browser using your server IP address.<\/p>\n<p>We&#8217;ve covered just a glimpse of what Apache offers to its user, so now let&#8217;s create our first virtual host directive in Apache. You can create a virtual host inside the main apache config file, however, for a cleaner and more organized setup we will create a new separate file in which the configuration lines will be stored. There is a setting (<strong>IncludeOptional<\/strong>) in Apache&#8217;s global config whose included directory stores separate config files. For example, in CentOS 7 and Apache 2.4 (the latest Apache version as of writing this tutorial) the <strong>IncludeOptional<\/strong> setting is set to the <strong>\/etc\/httpd\/conf.d\/<\/strong> which means that every <strong>*.conf<\/strong> file created in <strong>\/etc\/httpd\/conf.d\/<\/strong> will be used by the web server to handle the data.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4-Configure-a-virtual-host-directive-for-your-domain\"><\/span>4.\u00a0Configure a virtual host directive for your domain.<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Therefore, let&#8217;s create a <strong>your_domain.conf<\/strong> file where we will configure a virtual host directive for your domain. Once you are logged into your server enter the following command:<\/p>\n<pre># nano \/etc\/httpd\/conf.d\/your_domain.conf<\/pre>\n<p>Paste the below content into the file:<\/p>\n<pre>&lt;VirtualHost *:80&gt;\r\nServerAdmin webmaster@your_domain.com\r\nDocumentRoot \"\/var\/www\/html\/your_domain\/\"\r\nServerName your_domain.com\r\nServerAlias www.your_domain.com\r\nErrorLog \"\/var\/log\/httpd\/your_domain.com-error_log\"\r\nCustomLog \"\/var\/log\/httpd\/your_domain.com-access_log\" combined\r\n\r\n&lt;Directory \"\/var\/www\/html\/your_domain\/\"&gt;\r\nDirectoryIndex index.html index.php\r\nOptions FollowSymLinks\r\nAllowOverride All\r\nRequire all granted\r\n&lt;\/Directory&gt;\r\n&lt;\/VirtualHost&gt;<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"5-Settings-explanation\"><\/span>5. Settings explanation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Let&#8217;s explain the settings one by one.<\/p>\n<ul>\n<li>\u00a0<strong>&lt;VirtualHost *:80&gt;<\/strong> &#8211; this means that this virtual host directive binds to any IP address on the server and on port 80.<\/li>\n<li>\u00a0<strong>ServerAdmin<\/strong> &#8211; this is the email address where problems with the web server will be emailed to.<\/li>\n<li>\u00a0<strong>DocumentRoot<\/strong> &#8211; the directory where the website data will be stored which in the above case will be \/var\/www\/html\/your_domain\/. Of course, you can replace the your_domain value with anything you find it suitable.<\/li>\n<li>\u00a0<strong>ServerName<\/strong> &#8211; this value gives the name that the server uses to identify the website. Here you can enter your actual domain.<\/li>\n<li>\u00a0<strong>ServerAlias<\/strong> &#8211; The ServerAlias directive sets the alternate names for a host, for example: www.your_domain.com. It can also include wildcards if needed.<\/li>\n<li>\u00a0<strong>&lt;Directory&gt; and &lt;\/Directory&gt;<\/strong> and are used to enclose a group of directives that will apply only to the named directory, sub-directories of that directory, and the files within the respective directories. Any directive that is allowed in a directory context may be used. Directory-path is either the full path to a directory or a wild-card string using Unix shell-style matching. In our case we are enabling the <strong>FollowSymLinks<\/strong> option which will follow symbolic links in the <strong>\/var\/www\/html\/your_domain\/<\/strong> directory. We also set the <strong>AllowOverride<\/strong> directive to <strong>All<\/strong> which means that any directive which has the <strong>.htaccess<\/strong> context is allowed in <strong>.htaccess<\/strong> files. The <strong>Require<\/strong> directive selects which authenticated users can access a resource.<\/li>\n<\/ul>\n<p>[ecko_alert color=&#8221;blue&#8221;]Stuck somewhere? <a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting.html\">Get a VPS<\/a> from us and we&#8217;ll do all of this for you, free of charge![\/ecko_alert]<\/p>\n<p>This kind of config can be applied to most of the platforms out there. However, sometimes a specific WordPress site config such as the one above may not be enough for other kinds of apps. For example, a <a href=\"https:\/\/www.rosehosting.com\/odoo-hosting.html\">Magento<\/a> site will need more features enabled or an <a href=\"https:\/\/www.rosehosting.com\/magento-hosting.html\">Odoo<\/a> site will need a reverse proxy configured.<\/p>\n<p>One thing that is worth mentioning (even though most users know it) is that all the above configuration settings need to be properly setup before or after the Apache config file creation. For example, the <strong>DocumentRoot<\/strong> needs to be created and data hosted in it.<\/p>\n<p>To create a directory use:<\/p>\n<pre># mkdir \/var\/www\/html\/your_domain\/<\/pre>\n<p>Then upload the data you want to host inside that directory.<\/p>\n<p>Permissions and file ownership is another important task for webmasters. In most cases in servers without a control panel, the file and directory ownership should belong to the user and group under which Apache operates. In CentOS 7 Apache runs under <strong>apache<\/strong> as user and <strong>apache<\/strong> as group. So you will need to recursively assign that values to the files and directories in the document root. The below command does exactly that:<\/p>\n<pre># chown apache:apache -R \/var\/www\/html\/your_domain\/<\/pre>\n<p>This command will assign <strong>apache:apache<\/strong> to every file and directory\/subdirectory inside <strong>\/var\/www\/html\/your_domain\/<\/strong>.<\/p>\n<p>With this article, we&#8217;ve just peeked into Apache and virtual host configurations. For more information, you should visit Apache&#8217;s official <a href=\"https:\/\/httpd.apache.org\/docs\/\" target=\"_blank\" rel=\"noopener noreferrer\">documentation<\/a>.<\/p>\n<hr \/>\n<p>Of course, if you use one of our <a href=\"https:\/\/www.rosehosting.com\/apache-hosting.html\">Apache VPS Hosting<\/a> services you can always contact and ask our expert Linux admins to\u00a0to setup Apache Virtual Hosts on CentOS 7, They are available 24\u00d77 and you can contact them via chat or email at <strong>support@rosehosting.com<\/strong><\/p>\n<p><span style=\"color: #ff0000;\">PS.<\/span> If you liked this post on how to setup Apache Virtual Hosts on CentOS 7 please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we will show you How to setup Apache Virtual Hosts on CentOS 7. Apache is an open source web &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to set up Apache Virtual Hosts on CentOS 7\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#more-20732\" aria-label=\"Read more about How to set up Apache Virtual Hosts on CentOS 7\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":24330,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1699,13,1707],"tags":[37,34,1604],"class_list":["post-20732","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-tutorials","category-web-servers","tag-apache","tag-centos","tag-virtual-host","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.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to set up Apache Virtual Hosts on CentOS 7<\/title>\n<meta name=\"description\" content=\"How to set up Apache Virtual Hosts on CentOS 7, in few and easy steps. To set up Apache Virtual Hosts on CentOS 7 with easy, just follow our awesome tutorial.\" \/>\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\/apache-virtual-hosts-on-centos\/\" \/>\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 CentOS 7\" \/>\n<meta property=\"og:description\" content=\"How to set up Apache Virtual Hosts on CentOS 7 | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/\" \/>\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=\"2016-11-16T13:47:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-07T16:07:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to set up Apache Virtual Hosts on CentOS 7\",\"datePublished\":\"2016-11-16T13:47:44+00:00\",\"dateModified\":\"2022-12-07T16:07:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/\"},\"wordCount\":1462,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png\",\"keywords\":[\"apache\",\"centos\",\"virtual host\"],\"articleSection\":[\"CentOS\",\"Tutorials\",\"Web Servers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/\",\"name\":\"How to set up Apache Virtual Hosts on CentOS 7\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png\",\"datePublished\":\"2016-11-16T13:47:44+00:00\",\"dateModified\":\"2022-12-07T16:07:13+00:00\",\"description\":\"How to set up Apache Virtual Hosts on CentOS 7, in few and easy steps. To set up Apache Virtual Hosts on CentOS 7 with easy, just follow our awesome tutorial.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png\",\"width\":1200,\"height\":600,\"caption\":\"How to set up Apache Virtual Hosts on CentOS 7\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/apache-virtual-hosts-on-centos\\\/#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 CentOS 7\"}]},{\"@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 CentOS 7","description":"How to set up Apache Virtual Hosts on CentOS 7, in few and easy steps. To set up Apache Virtual Hosts on CentOS 7 with easy, just follow our awesome tutorial.","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\/apache-virtual-hosts-on-centos\/","og_locale":"en_US","og_type":"article","og_title":"How to set up Apache Virtual Hosts on CentOS 7","og_description":"How to set up Apache Virtual Hosts on CentOS 7 | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2016-11-16T13:47:44+00:00","article_modified_time":"2022-12-07T16:07:13+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png","type":"image\/png"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to set up Apache Virtual Hosts on CentOS 7","datePublished":"2016-11-16T13:47:44+00:00","dateModified":"2022-12-07T16:07:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/"},"wordCount":1462,"commentCount":5,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png","keywords":["apache","centos","virtual host"],"articleSection":["CentOS","Tutorials","Web Servers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/","url":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/","name":"How to set up Apache Virtual Hosts on CentOS 7","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png","datePublished":"2016-11-16T13:47:44+00:00","dateModified":"2022-12-07T16:07:13+00:00","description":"How to set up Apache Virtual Hosts on CentOS 7, in few and easy steps. To set up Apache Virtual Hosts on CentOS 7 with easy, just follow our awesome tutorial.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2016\/11\/How-to-set-up-Apache-Virtual-Hosts-on-CentOS-7.png","width":1200,"height":600,"caption":"How to set up Apache Virtual Hosts on CentOS 7"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/apache-virtual-hosts-on-centos\/#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 CentOS 7"}]},{"@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\/20732","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=20732"}],"version-history":[{"count":4,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/20732\/revisions"}],"predecessor-version":[{"id":43767,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/20732\/revisions\/43767"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/24330"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=20732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=20732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=20732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}