{"id":18154,"date":"2024-07-22T12:11:07","date_gmt":"2024-07-22T06:41:07","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=18154"},"modified":"2024-07-22T12:43:56","modified_gmt":"2024-07-22T07:13:56","slug":"how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/","title":{"rendered":"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?"},"content":{"rendered":"\n<p>Apache is one of the most popular and widely-used web servers in the world. It is open-source, highly customizable, and can run on various operating systems, including Linux. This guide will walk you through the steps to install the Apache web server on Ubuntu 20.04, ensuring that your server is ready to host websites and web applications efficiently and securely.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step:1 &#8211; Installing Apache<\/h2>\n\n\n\n<p>Apache can be installed easily from Ubuntu\u2019s default software repositories using standard package management tools.<\/p>\n\n\n\n<p>First, update the local package index to ensure it reflects the latest changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li style=\"padding:10px 0\">Then, install the apache2 package:<\/li>\n<\/ul>\n\n\n\n<p><pre class=\"wp-block-code\"><code>sudo apt install apache2<\/code><\/pre><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After confirming the installation, apt will install Apache and all necessary dependencies.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step:2 &#8211; Adjusting the Firewall<\/h2>\n\n\n\n<p>Before testing Apache, you need to configure the firewall to allow external access to the default web ports. Assuming you have a UFW firewall set up as per the prerequisites, you can proceed with the following steps.<\/p>\n\n\n\n<p>During installation, Apache registers itself with UFW, providing several application profiles that can be used to enable or disable access through the firewall.<\/p>\n\n\n\n<p>To list the UFW application profiles, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw app list<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<p><li>You will see a list of available application profiles:<\/li><\/p>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\nAvailable applications:\n\u00a0\u00a0Apache\n\u00a0\u00a0Apache Full\n\u00a0\u00a0Apache Secure\n\u00a0\u00a0OpenSSH<\/code><\/pre>\n\n\n\n<p>These profiles serve different purposes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Apache:<\/strong> Opens only port 80 (normal, unencrypted web traffic)<\/li>\n\n\n\n<li><strong>Apache Full:<\/strong> Opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS\/SSL encrypted traffic)<\/li>\n\n\n\n<li><strong>Apache Secure:<\/strong> Opens only port 443 (TLS\/SSL encrypted traffic)<\/li>\n<\/ul>\n\n\n\n<p>It is best to enable the most restrictive profile that will still allow the necessary traffic. Since SSL is not configured in this guide, you only need to allow traffic on port 80:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow 'Apache'<\/code><\/pre>\n\n\n\n<p>To verify the change, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw status<\/code><\/pre>\n\n\n\n<p>You should see output indicating that HTTP traffic is allowed:<\/p>\n\n\n\n<p>Status: active<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>To \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Action\u00a0 \u00a0 \u00a0 From\n-- \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ------\u00a0 \u00a0 \u00a0 ----\nOpenSSH\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ALLOW \u00a0 \u00a0 \u00a0 Anywhere\nApache \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ALLOW \u00a0 \u00a0 \u00a0 Anywhere\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\nOpenSSH (v6) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ALLOW \u00a0 \u00a0 \u00a0 Anywhere (v6)\nApache (v6)\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ALLOW \u00a0 \u00a0 \u00a0 Anywhere (v6)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step:3 &#8211; Checking Your Web Server<\/h2>\n\n\n\n<p>Ubuntu 20.04 starts Apache automatically at the end of the installation process. The web server should already be running.<\/p>\n\n\n\n<p>To confirm, use the systemd init system to check the service status:<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status apache2\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<p><li>You should see output indicating that the service is active:<\/li><\/p>\n<\/ul>\n\n\n\n<p>\u25cf apache2.service &#8211; The Apache HTTP Server<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u00a0\u00a0\u00a0\u00a0\u00a0Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\n\u00a0\u00a0\u00a0\u00a0\u00a0Active: active (running) since Thu 2020-04-23 22:36:30 UTC; 20h ago\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\n\u00a0\u00a0\u00a0Main PID: 29435 (apache2)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Tasks: 55 (limit: 1137)\n\u00a0\u00a0\u00a0\u00a0\u00a0Memory: 8.0M\n\u00a0\u00a0\u00a0\u00a0\u00a0CGroup: \/system.slice\/apache2.service\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u251c\u250029435 \/usr\/sbin\/apache2 -k start\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u251c\u250029437 \/usr\/sbin\/apache2 -k start\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2514\u250029438 \/usr\/sbin\/apache2 -k start<\/code><\/pre>\n\n\n\n<p>The best way to test Apache is to request a page from it. Access the default Apache landing page using your server&#8217;s IP address. If you don&#8217;t know your server\u2019s IP address, you can find it by typing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hostname \u2013I<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -4 icanhazip.com<\/code><\/pre>\n\n\n\n<p>Enter your server\u2019s IP address into a web browser:<\/p>\n\n\n\n<p>http:\/\/your_server_ip<\/p>\n\n\n\n<p>You should see the default Ubuntu 20.04 Apache web page, confirming that Apache is running correctly.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"1024\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-738x1024.png\" alt=\"apache 2 default page\" class=\"wp-image-18176\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-738x1024.png 738w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-216x300.png 216w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page.png 745w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step:4 &#8211; Managing the Apache Process<\/h2>\n\n\n\n<p>With your web server up and running, here are some basic management commands using systemctl:<\/p>\n\n\n\n<p>To stop Apache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl stop apache2<\/code><\/pre>\n\n\n\n<p>To start Apache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start apache2<\/code><\/pre>\n\n\n\n<p>To restart Apache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart apache2<\/code><\/pre>\n\n\n\n<p>To reload Apache without dropping connections (useful for configuration changes):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload apache2<\/code><\/pre>\n\n\n\n<p>By default, Apache is configured to start automatically when the server boots. To disable this behavior:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl disable apache2<\/code><\/pre>\n\n\n\n<p>To re-enable the service to start at boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable apache2<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step:5 &#8211; Setting Up Virtual Hosts\u00a0<\/h2>\n\n\n\n<p>Apache allows you to host multiple domains on a single server using virtual hosts. We\u2019ll set up a virtual host for a domain called your_domain. Replace your_domain with your actual domain name.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<p><li>Create the directory for your domain:<\/li><\/p>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/var\/www\/your_domain<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<p><li>Assign ownership of the directory:<\/li><\/p>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown -R $USER:$USER \/var\/www\/your_domain<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<p><li>Set the correct permissions:<\/li><\/p>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod -R 755 \/var\/www\/your_domain<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<p><li>Create a sample index.html page:<\/li><\/p>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/var\/www\/your_domain\/index.html<\/code><\/pre>\n\n\n\n<p>Add the following HTML:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;html>\n\u00a0\u00a0\u00a0\u00a0&lt;head>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;title>Welcome to Your_domain!&lt;\/title>\n\u00a0\u00a0\u00a0\u00a0&lt;\/head>\n\u00a0\u00a0\u00a0\u00a0&lt;body>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;h1>Success! The your_domain virtual host is working!&lt;\/h1>\n\u00a0\u00a0\u00a0\u00a0&lt;\/body>\n&lt;\/html><\/code><\/pre>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<p>Create a virtual host file for your domain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/sites-available\/your_domain.conf<\/code><\/pre>\n\n\n\n<p>Add the following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:80>\n\u00a0\u00a0\u00a0\u00a0ServerAdmin webmaster@localhost\n\u00a0\u00a0\u00a0\u00a0ServerName your_domain\n\u00a0\u00a0\u00a0\u00a0ServerAlias www.your_domain\n\u00a0\u00a0\u00a0\u00a0DocumentRoot \/var\/www\/your_domain\n\u00a0\u00a0\u00a0\u00a0ErrorLog ${APACHE_LOG_DIR}\/error.log\n\u00a0\u00a0\u00a0\u00a0CustomLog ${APACHE_LOG_DIR}\/access.log combined\n&lt;\/VirtualHost><\/code><\/pre>\n\n\n\n<p>Save and close the file.<\/p>\n\n\n\n<p>Enable the new virtual host:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2ensite your_domain.conf<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<p><li>Disable the default site:<\/li><\/p>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2dissite 000-default.conf<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<p><li>Check for configuration errors:<\/li><\/p>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apache2ctl configtest<\/code><\/pre>\n\n\n\n<p>You should see:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Syntax OK<\/code><\/pre>\n\n\n\n<p>Restart Apache to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart apache2<\/code><\/pre>\n\n\n\n<p>You can now navigate to http:\/\/your_domain to see the new site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step:6 &#8211; Familiarizing Yourself with Important Apache Files and Directories<\/h2>\n\n\n\n<p>Now that you know how to manage the Apache service, take a moment to learn about important directories and files:<\/p>\n\n\n\n<p><strong>Content Directory:<\/strong><\/p>\n\n\n\n<p>\/var\/www\/html: The default directory for web content. Can be changed by modifying Apache configuration files.<\/p>\n\n\n\n<p><strong>Server Configuration:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/etc\/apache2: Main Apache configuration directory.<\/li>\n\n\n\n<li>\/etc\/apache2\/apache2.conf: Main Apache configuration file.<\/li>\n\n\n\n<li>\/etc\/apache2\/ports.conf: Specifies the ports Apache listens on.<\/li>\n\n\n\n<li>\/etc\/apache2\/sites-available\/: Stores per-site virtual host configurations.<\/li>\n\n\n\n<li>\/etc\/apache2\/sites-enabled\/: Stores enabled per-site virtual host configurations.<\/li>\n\n\n\n<li>\/etc\/apache2\/conf-available\/ and \/etc\/apache2\/conf-enabled\/: Stores general configuration fragments.<\/li>\n\n\n\n<li>\/etc\/apache2\/mods-available\/ and \/etc\/apache2\/mods-enabled\/: Stores available and enabled modules.<\/li>\n<\/ul>\n\n\n\n<p>Server Logs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/var\/log\/apache2\/access.log: Logs all requests to your web server.<\/li>\n\n\n\n<li>\/var\/log\/apache2\/error.log: Logs all errors.<\/li>\n<\/ul>\n\n\n\n<p>These directories and files are essential for managing your Apache server effectively.<\/p>\n\n\n\n<div class=\"vlt-box \">\n<div class=\"box-title\" style=\"background:#D5EAFF; color:#000\">Conclusion<\/div>\n<div class=\"box-content\" >\n<p>Congratulations! You have successfully installed and configured the Apache web server on your Ubuntu 20.04 system. With Apache up and running, your server is now ready to handle web traffic and serve your websites. You can further customize your Apache configuration to meet your specific needs, ensuring optimal performance and security for your web applications. If you have any further questions or need additional assistance, feel free to reach out.<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Apache is one of the most popular and widely-used web servers in the world. It is open-source, highly customizable, and can run on various operating systems, including Linux. This guide will walk you through the steps to install the Apache web server on Ubuntu 20.04, ensuring that your server is ready to host websites and [&hellip;]<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[1225,3022],"class_list":["post-18154","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-vps-faq","tag-apache-web-server","tag-ubuntu-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?<\/title>\n<meta name=\"description\" content=\"Step-by-step instructions to install and configure Apache on Ubuntu plain server with firewall settings, web server management, virtual host setup, and essential Apache files.\" \/>\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.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?\" \/>\n<meta property=\"og:description\" content=\"Step-by-step instructions to install and configure Apache on Ubuntu plain server with firewall settings, web server management, virtual host setup, and essential Apache files.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-22T06:41:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-22T07:13:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-738x1024.png\" \/>\n<meta name=\"author\" content=\"Sommaya Singh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sommaya Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/\"},\"author\":{\"name\":\"Sommaya Singh\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/eff16f2e5efe7e6abce067954fc4fe0a\"},\"headline\":\"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?\",\"datePublished\":\"2024-07-22T06:41:07+00:00\",\"dateModified\":\"2024-07-22T07:13:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/\"},\"wordCount\":820,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-738x1024.png\",\"keywords\":[\"Apache web server\",\"Ubuntu Server\"],\"articleSection\":[\"VPS FAQ\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/\",\"name\":\"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-738x1024.png\",\"datePublished\":\"2024-07-22T06:41:07+00:00\",\"dateModified\":\"2024-07-22T07:13:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/eff16f2e5efe7e6abce067954fc4fe0a\"},\"description\":\"Step-by-step instructions to install and configure Apache on Ubuntu plain server with firewall settings, web server management, virtual host setup, and essential Apache files.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page.png\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page.png\",\"width\":745,\"height\":1034,\"caption\":\"apache 2 default page\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/eff16f2e5efe7e6abce067954fc4fe0a\",\"name\":\"Sommaya Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2023\/04\/sommaya-singh-150x150.png\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2023\/04\/sommaya-singh-150x150.png\",\"caption\":\"Sommaya Singh\"},\"description\":\"I am a passionate content writer. I write unique, genuine and high-quality content on web hosting and other topics. Being a keen learner I continue to improve my writing skills.\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/sommaya-singh\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?","description":"Step-by-step instructions to install and configure Apache on Ubuntu plain server with firewall settings, web server management, virtual host setup, and essential Apache files.","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.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?","og_description":"Step-by-step instructions to install and configure Apache on Ubuntu plain server with firewall settings, web server management, virtual host setup, and essential Apache files.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2024-07-22T06:41:07+00:00","article_modified_time":"2024-07-22T07:13:56+00:00","og_image":[{"url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-738x1024.png","type":"","width":"","height":""}],"author":"Sommaya Singh","twitter_misc":{"Written by":"Sommaya Singh","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/"},"author":{"name":"Sommaya Singh","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/eff16f2e5efe7e6abce067954fc4fe0a"},"headline":"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?","datePublished":"2024-07-22T06:41:07+00:00","dateModified":"2024-07-22T07:13:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/"},"wordCount":820,"commentCount":0,"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-738x1024.png","keywords":["Apache web server","Ubuntu Server"],"articleSection":["VPS FAQ"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/","name":"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page-738x1024.png","datePublished":"2024-07-22T06:41:07+00:00","dateModified":"2024-07-22T07:13:56+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/eff16f2e5efe7e6abce067954fc4fe0a"},"description":"Step-by-step instructions to install and configure Apache on Ubuntu plain server with firewall settings, web server management, virtual host setup, and essential Apache files.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#primaryimage","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page.png","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2024\/07\/apache-2-default-page.png","width":745,"height":1034,"caption":"apache 2 default page"},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-apache-web-server-and-setup-virtual-host-on-ubuntu-plain-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Install Apache Web Server And Setup Virtual Host On Ubuntu Plain Server?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/eff16f2e5efe7e6abce067954fc4fe0a","name":"Sommaya Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2023\/04\/sommaya-singh-150x150.png","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2023\/04\/sommaya-singh-150x150.png","caption":"Sommaya Singh"},"description":"I am a passionate content writer. I write unique, genuine and high-quality content on web hosting and other topics. Being a keen learner I continue to improve my writing skills.","url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/sommaya-singh\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/18154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=18154"}],"version-history":[{"count":20,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/18154\/revisions"}],"predecessor-version":[{"id":18181,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/18154\/revisions\/18181"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=18154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=18154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=18154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}