{"id":3274,"date":"2017-09-14T13:35:54","date_gmt":"2017-09-14T17:35:54","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=3274"},"modified":"2017-09-14T13:35:54","modified_gmt":"2017-09-14T17:35:54","slug":"apache-virtual-hosts-u14","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/","title":{"rendered":"How To Set Up Apache Virtual Hosts on Ubuntu 14"},"content":{"rendered":"<div align=\"center\"><img decoding=\"async\" alt=\"The Apache Foundation\" src=\"https:\/\/projects.apache.org\/images\/asf_logo.png\" style=\"width: 50%; height: 50%;\"\/><\/div>\n<h1>How To Set Up Apache Virtual Hosts on Ubuntu 14<\/h1>\n<p>One of the great strengths of <a href=\"https:\/\/httpd.apache.org\" rel=\"nofollow\">Apache<\/a> is the ability to create multiple hosts on the same server. As long as the hardware can support it, you can run multiple websites on one server through virtual hosts. This article will describe the setup process for Ubuntu 14.04 LTS.<\/p>\n<p><strong>Getting Started<\/strong><br \/>\nTo complete this walkthrough successfully the following are required:<br \/>\n\u2022 A node (<a href=\"https:\/\/www.globo.tech\/dedicated-server-hosting\" rel=\"nofollow\">Dedicated<\/a> or <a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" rel=\"nofollow\">Cloud Server<\/a>) running Ubuntu 14.04 LTS<br \/>\n\u2022 All commands must be entered as root<br \/>\n\u2022 A full <a href=\"https:\/\/www.globo.tech\/learning-center\/setup-lamp-ubuntu-14\/\">LAMP stack implementation<\/a><\/p>\n<p><strong>Tutorial<\/strong><br \/>\nLet&#8217;s start by copying the default virtual host configuration on your server. The file name is called 000-default.conf located in the \/etc\/apache2\/sites-available directory.<br \/>\n<code>cd \/etc\/apache2\/sites-available\/<br \/>\ncp 000-default.conf globo.tech.conf<\/code><\/p>\n<p>Once the globo.tech.conf file has been created, open that file with any editor you feel comfortable using. We are going to make sure that we have valid entries for the server port, admin email, server name and server alias. We also need to make sure that the DocumentRoot points to the location where we will store the globo.tech html files.<br \/>\n<code>nano \/etc\/apache2\/sites-available\/globo.tech.conf<\/code><\/p>\n<p><code class=\"gris\">&lt;VirtualHost *:80&gt;<br \/>\n        # The ServerName directive sets the request scheme, hostname and port that<br \/>\n        # the server uses to identify itself. This is used when creating<br \/>\n        # redirection URLs. In the context of virtual hosts, the ServerName<br \/>\n        # specifies what hostname must appear in the request's Host: header to<br \/>\n        # match this virtual host. For the default virtual host (this file) this<br \/>\n        # value is not decisive as it is used as a last resort host regardless.<br \/>\n        # However, you must set it for any further virtual host explicitly.<br \/>\n        #ServerName www.example.com<br \/>\n        ServerAdmin webmaster@globo.tech<br \/>\n        DocumentRoot \/var\/www\/globo.tech\/public_html<br \/>\n        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,<br \/>\n        # error, crit, alert, emerg.<br \/>\n        # It is also possible to configure the loglevel for particular<br \/>\n        # modules, e.g.<br \/>\n        #LogLevel info ssl:warn<br \/>\n        ErrorLog ${APACHE_LOG_DIR}\/error.log<br \/>\n        CustomLog ${APACHE_LOG_DIR}\/access.log combined<br \/>\n        # For most configuration files from conf-available\/, which are<br \/>\n        # enabled or disabled at a global level, it is possible to<br \/>\n        # include a line for only one particular virtual host. For example the<br \/>\n        # following line enables the CGI configuration for this host only<br \/>\n        # after it has been globally disabled with \"a2disconf\".<br \/>\n        #Include conf-available\/serve-cgi-bin.conf<br \/>\n&lt;\/VirtualHost&gt;<\/code><\/p>\n<p>Now that we&#8217;ve entered those values, save and close the file. Navigate to the \/var\/www directory. This is where we will create the globo.tech directory structure to store its web pages. Then we will make sure that Apache has permissions to the directory structure.<br \/>\n<code>mkdir -p \/var\/www\/globo.tech\/public_html<br \/>\nchmod 755 \/var\/www\/globo.tech\/public_html\/<br \/>\nchown www-data \/var\/www\/globo.tech\/public_html\/<\/code><\/p>\n<p>The final step in this process is to enable the new virtual host and restart Apache.<\/p>\n<p><code>a2ensite globo.tech<br \/>\nservice apache2 reload<\/code><\/p>\n<p>You can test the virtual host by opening up your browser and navigating to http:\/\/localhost\/globo.tech. You can copy the steps above and create another website on the same machine as long as you use a different name for the domain.<\/p>\n<p><strong>Conclusion<\/strong><br \/>\nVirtualization on Apache is a very powerful tool for creating multiple websites on the same server. Using the instructions we&#8217;ve provided, you can create and test multiple websites before deploying them on the internet. The number of websites contained in one machine is only limited by the ability of the hardware to support them. If you&#8217;ve enjoyed this KB, please consider sharing with your friends. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How To Set Up Apache Virtual Hosts on Ubuntu 14 One of the great strengths of Apache is the ability to create multiple hosts on the same server. As long as the hardware can support it, you can run multiple websites on one server through virtual hosts. This article will describe the setup process for<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-3274","post","type-post","status-publish","format-standard","hentry","category-web-hosting","operating_system-ubuntu-14-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Set Up Apache Virtual Hosts on Ubuntu 14 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"One of the great strengths of Apache is the ability to create multiple hosts on the same server. This article will describe the setup process for Ubuntu 14.\" \/>\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.globo.tech\/learning-center\/apache-virtual-hosts-u14\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Set Up Apache Virtual Hosts on Ubuntu 14 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"One of the great strengths of Apache is the ability to create multiple hosts on the same server. This article will describe the setup process for Ubuntu 14.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-14T17:35:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/projects.apache.org\/images\/asf_logo.png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/\"},\"author\":{\"name\":\"GloboTech Communications\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"headline\":\"How To Set Up Apache Virtual Hosts on Ubuntu 14\",\"datePublished\":\"2017-09-14T17:35:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/\"},\"wordCount\":362,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/projects.apache.org\\\/images\\\/asf_logo.png\",\"articleSection\":[\"Web Hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/\",\"name\":\"How To Set Up Apache Virtual Hosts on Ubuntu 14 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/projects.apache.org\\\/images\\\/asf_logo.png\",\"datePublished\":\"2017-09-14T17:35:54+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"One of the great strengths of Apache is the ability to create multiple hosts on the same server. This article will describe the setup process for Ubuntu 14.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/#primaryimage\",\"url\":\"https:\\\/\\\/projects.apache.org\\\/images\\\/asf_logo.png\",\"contentUrl\":\"https:\\\/\\\/projects.apache.org\\\/images\\\/asf_logo.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/apache-virtual-hosts-u14\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Set Up Apache Virtual Hosts on Ubuntu 14\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\\\/\\\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Set Up Apache Virtual Hosts on Ubuntu 14 - Globo.Tech","description":"One of the great strengths of Apache is the ability to create multiple hosts on the same server. This article will describe the setup process for Ubuntu 14.","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.globo.tech\/learning-center\/apache-virtual-hosts-u14\/","og_locale":"en_US","og_type":"article","og_title":"How To Set Up Apache Virtual Hosts on Ubuntu 14 - Globo.Tech","og_description":"One of the great strengths of Apache is the ability to create multiple hosts on the same server. This article will describe the setup process for Ubuntu 14.","og_url":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/","og_site_name":"Globo.Tech","article_published_time":"2017-09-14T17:35:54+00:00","og_image":[{"url":"https:\/\/projects.apache.org\/images\/asf_logo.png","type":"","width":"","height":""}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/#article","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/"},"author":{"name":"GloboTech Communications","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"headline":"How To Set Up Apache Virtual Hosts on Ubuntu 14","datePublished":"2017-09-14T17:35:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/"},"wordCount":362,"commentCount":0,"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/#primaryimage"},"thumbnailUrl":"https:\/\/projects.apache.org\/images\/asf_logo.png","articleSection":["Web Hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/","url":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/","name":"How To Set Up Apache Virtual Hosts on Ubuntu 14 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/#primaryimage"},"thumbnailUrl":"https:\/\/projects.apache.org\/images\/asf_logo.png","datePublished":"2017-09-14T17:35:54+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"One of the great strengths of Apache is the ability to create multiple hosts on the same server. This article will describe the setup process for Ubuntu 14.","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/#primaryimage","url":"https:\/\/projects.apache.org\/images\/asf_logo.png","contentUrl":"https:\/\/projects.apache.org\/images\/asf_logo.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/apache-virtual-hosts-u14\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How To Set Up Apache Virtual Hosts on Ubuntu 14"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=3274"}],"version-history":[{"count":16,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3274\/revisions"}],"predecessor-version":[{"id":3409,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/3274\/revisions\/3409"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=3274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=3274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=3274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}