{"id":555,"date":"2021-06-22T00:47:11","date_gmt":"2021-06-22T00:47:11","guid":{"rendered":"https:\/\/serverhub.com\/kb\/?p=555"},"modified":"2021-11-30T00:35:22","modified_gmt":"2021-11-30T00:35:22","slug":"how-to-install-apache-on-ubuntu","status":"publish","type":"post","link":"https:\/\/serverhub.com\/kb\/how-to-install-apache-on-ubuntu\/","title":{"rendered":"How to Install Apache on Ubuntu? The Comprehensive Guide"},"content":{"rendered":"\n<p class=\"has-black-color has-text-color\">According to the Apache software foundation that was established in 1999 based on individual donations and corporate sponsors, Apache is open-source software that runs on 67% of the world\u2019s web servers.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Able to meet the needs of many with reliable security and incredible speed, Apache became the most extensively used web server around the world.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Additionally, Apache is used by the majority of WordPress hosting providers to freely turn computers into HTTP servers so people can request them as websites over the internet.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Also, it can provide other impressive features that include but are not limited to:<\/p>\n\n\n\n<ul class=\"has-black-color has-text-color wp-block-list\"><li>Vigorous media support<\/li><li>Comprehensive integration with popular software<\/li><li>Dynamically loadable modules<\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Side note: a web server is a software that receives your web page request, runs security checks on your HTTP request, and delivers you the web page as quickly as possible.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">That speed depends on the modules your server has to run based on the page you requested. &nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><span class=\"has-inline-color has-vivid-purple-color\">In this article, you\u2019ll learn<\/span><\/strong><\/h2>\n\n\n\n<ol class=\"has-black-color has-text-color wp-block-list\"><li>How to set up Apache<\/li><li>Basic Apache configuration<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><span class=\"has-inline-color has-vivid-purple-color\">Apache installation prerequisites<\/span><\/strong><\/h2>\n\n\n\n<ol class=\"has-black-color has-text-color wp-block-list\"><li>A system running Ubuntu<\/li><li>A user account with sudo privileges<\/li><li>Basic Linux command line knowledge<\/li><li>An internet connection<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><span class=\"has-inline-color has-vivid-purple-color\">Required tools to install Apache<\/span><\/strong><\/h2>\n\n\n\n<ol class=\"has-black-color has-text-color wp-block-list\"><li>A command-line service like Ubuntu\u2019s default terminal (<strong>keyboard shortcut&nbsp;CTRL + ALT + T<\/strong>)<\/li><li>The&nbsp;APT&nbsp;package manager that comes by default with Ubuntu<\/li><li>A firewall like&nbsp;the UFW (Uncomplicated Firewall, which we\u2019ll talk about later)<\/li><\/ol>\n\n\n\n<p class=\"has-black-color has-text-color\">Now that you\u2019ve got everything ready, let\u2019s jump right into it!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><span class=\"has-inline-color has-black-color\">Installing Apache<\/span><\/strong><\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">Updating your local software package database to the latest version is advised before installing additional software.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Not only it will shorten the future updates\u2019 time, but will also protect your outdated software against any manipulations.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">To update your local package index on Ubuntu, open your terminal and type in the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo apt update<\/span><\/strong><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updating-Apache-local-package.png\" alt=\"\" class=\"wp-image-556\"\/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\">Give the package manager some time to finish updating.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">You\u2019ll have no problem installing Apache after the update since it\u2019s already available as a part of Ubuntu\u2019s default software depository, and can be installed using current package management tools.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">This time, type in your terminal:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo apt install apache2<\/span><\/strong><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"803\" height=\"534\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Installing-Apache.png\" alt=\"\" class=\"wp-image-557\" srcset=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Installing-Apache.png 803w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Installing-Apache-300x200.png 300w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Installing-Apache-768x511.png 768w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Installing-Apache-480x319.png 480w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Installing-Apache-508x338.png 508w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Installing-Apache-580x386.png 580w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Installing-Apache-429x285.png 429w\" sizes=\"(max-width: 803px) 100vw, 803px\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\">As seen in the screenshot above, the system will ask for your confirmation.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Just allow it to conclude the Apache installation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Confirm-Apache-installation.png\" alt=\"\" class=\"wp-image-558\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Verify Apache installation<\/strong><\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">Carried these simple steps but still unsure whether it worked? We got you covered!<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Simply, open a web browser and type <strong>localhost <\/strong>in the address bar.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Once you receive (and you will) a page titled \u201cApache2 Ubuntu Default Page\u201d like the one below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Verify-Apache-installation.png\" alt=\"Apache installation verified \" class=\"wp-image-559\" width=\"800\" height=\"573\"\/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\">It means that now Apache has been successfully installed on your server!<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Another option to verify is to open your web browser and type in: <strong>http:\/\/local.server.IP<\/strong> \u201cwhere IP is replaced with your server\u2019s IP address.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Worried about how to figure out your server\u2019s IP address? <\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Use freeware online tools like <strong><a href=\"https:\/\/whatismyipaddress.com\/\">whatismyipaddress.com\/<\/a><\/strong> or type in your terminal: <strong>hostname -I | awk &#8216;{print $1}&#8217;<\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Seriously, localhost should do just fine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Adjust your firewall<\/strong><\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">You should have a UFW firewall ready, given that you followed the above instructions. Therefore, the only steps you need to take are:<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Take a look at the available UFW\u2019s app profiles by typing<strong>: sudo ufw app list<\/strong> using your terminal.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>You\u2019ll receive the following profiles list:<\/strong><\/h3>\n\n\n\n<p class=\"has-black-color has-text-color\">Apache: a profile that opens port 80<br>Apache secure: a profile that opens port 443<br>Apache full: a profile that opens both port 80 and port 44<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">We recommend enabling the port that will allow your configured traffic so far, which\u2019s port 80.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">To do that, type in the following command using your terminal:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo ufw allow &#8216;Apache&#8217;<\/span><\/strong><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"733\" height=\"183\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/UFW-app-list.png\" alt=\"UFW app list displayed \" class=\"wp-image-560\" srcset=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/UFW-app-list.png 733w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/UFW-app-list-300x75.png 300w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/UFW-app-list-480x120.png 480w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/UFW-app-list-730x182.png 730w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/UFW-app-list-580x145.png 580w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/UFW-app-list-665x166.png 665w\" sizes=\"(max-width: 733px) 100vw, 733px\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\">Afterward, you can verify the change by typing:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo ufw status<\/span><\/strong><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The Apache Service process and controls<\/strong><\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">Having control over your service is a must, especially in our case, where you\u2019ll find yourself restarting and\/or reloading Apache often.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">With our up and running server, here are some basic options you can take advantage of when it comes to controlling, using the systemctl command.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">To restart the service:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo systemctl restart apache2<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">To stop your server:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo systemctl stop apache2<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">To start after stopping:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo systemctl start apache2<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Disabling Apache automatic start:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo systemctl disable apache2<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Re-enabling automatic startup:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo systemctl enable apache2<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Reloading Apache to make simple configuration changes:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo systemctl reload apache2<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Your system might ask to reload Apache at any given command, which\u2019s completely fine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Creating your website <\/strong><\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">You can use Apache virtual hosts to host more than one domain from a single server.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">We will set up a domain called&nbsp;<strong>serverhubtest<\/strong>, but feel free to&nbsp;replace it with your own domain name.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Apache on Ubuntu 20.04 has one server block enabled, which\u2019s configured to serve documents from the&nbsp;<code><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">\/var\/www\/html<\/span><\/strong><\/code>&nbsp;directory.<\/p>\n\n\n<span class='bctt-click-to-tweet'><span class='bctt-ctt-text'><a href='https:\/\/x.com\/intent\/tweet?url=https%3A%2F%2Fserverhub.com%2Fkb%2F%3Fp%3D555&#038;text=Learn%20how%20to%20install%20Apache%20from%20scratch%20and%20gain%20the%20configuration%20skills%20to%20create%20your%20website%20in%20this%20comprehensive%20guide%21%20%28Step%20by%20step%20pictures%20included%29&#038;via=benunc&#038;related=benunc' target='_blank'rel=\"noopener noreferrer\">Learn how to install Apache from scratch and gain the configuration skills to create your website in this comprehensive guide! (Step by step pictures included) <\/a><\/span><a href='https:\/\/x.com\/intent\/tweet?url=https%3A%2F%2Fserverhub.com%2Fkb%2F%3Fp%3D555&#038;text=Learn%20how%20to%20install%20Apache%20from%20scratch%20and%20gain%20the%20configuration%20skills%20to%20create%20your%20website%20in%20this%20comprehensive%20guide%21%20%28Step%20by%20step%20pictures%20included%29&#038;via=benunc&#038;related=benunc' target='_blank' class='bctt-ctt-btn'rel=\"noopener noreferrer\">Share on X<\/a><\/span>\n\n\n<p class=\"has-black-color has-text-color\">Indeed, this works well for a single site, but it can become unmanageable if you\u2019re hosting multiple sites.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Let\u2019s create a directory structure within<span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>&nbsp;\/var\/www<\/strong><\/span>&nbsp;for a&nbsp;<strong>serverhubtest<\/strong>&nbsp;site, instead of modifying&nbsp;<strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">\/var\/www\/html<\/span><\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Create the directory for&nbsp;<strong>serverhubtest<\/strong>&nbsp;by inputting:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>sudo mkdir \/var\/www\/serverhubtest&nbsp;&nbsp;<\/strong><\/span><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Then, assign ownership of the directory:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>sudo chown -R $USER:$USER \/var\/www\/serverhubtest&nbsp;<\/strong><\/span><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Next, create a sample&nbsp;index.html&nbsp;page using&nbsp;<strong>the nano&nbsp;editor:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>sudo nano \/var\/www\/serverhubtest\/index.html<\/strong><\/span><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Afterward, add the following sample HTML:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;html&gt;\n    &lt;head&gt;\n        &lt;title&gt;<code>Welcome to <\/code><strong>serverhubtest<\/strong>&lt;\/title&gt;\n    &lt;\/head&gt;\n    &lt;body&gt;\n        &lt;h1&gt;<code>It works! You amazing&nbsp; tech-savvy you!<\/code>&lt;\/h1&gt;\n    &lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n\n\n\n<p class=\"has-black-color has-text-color\">Save with <strong>CTRL + X then Y<\/strong>, and close the file when all is finished.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"803\" height=\"574\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Nano.jpg\" alt=\"Creating index using Nano editor \" class=\"wp-image-561\" srcset=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Nano.jpg 803w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Nano-300x214.jpg 300w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Nano-768x549.jpg 768w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Nano-480x343.jpg 480w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Nano-473x338.jpg 473w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Nano-567x405.jpg 567w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Nano-399x285.jpg 399w\" sizes=\"(max-width: 803px) 100vw, 803px\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\">Now, you\u2019ve to create a virtual host file with the correct directives, instead of modifying the default configuration file located at&nbsp;\/etc\/apache2\/sites-available\/000-default.conf<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">To do that, use your terminal to input:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo nano \/etc\/apache2\/sites-available\/serverhubtest.conf<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Paste in the following configuration block that\u2019s similar to the default, but only updated for the new directory and domain name:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> &lt;VirtualHost *:80&gt;\n<code> &nbsp;&nbsp;&nbsp;ServerAdmin webmaster@localhost<\/code>\n<code> &nbsp;&nbsp;&nbsp;ServerName <\/code>serverhubtest\n<code>&nbsp;&nbsp;&nbsp; ServerAlias <\/code>www.serverhubtest\n<code>&nbsp;&nbsp;&nbsp; DocumentRoot \/var\/www\/<\/code>serverhubtest\n<code>&nbsp;&nbsp;&nbsp; ErrorLog ${APACHE_LOG_DIR}\/error.log<\/code>\n<code>&nbsp;&nbsp;&nbsp; CustomLog ${APACHE_LOG_DIR}\/access.log combined<\/code>\n&lt;\/VirtualHost&gt;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"801\" height=\"535\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updated-domain-name-1.jpg\" alt=\"Updated domain name\" class=\"wp-image-563\" srcset=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updated-domain-name-1.jpg 801w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updated-domain-name-1-300x200.jpg 300w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updated-domain-name-1-768x513.jpg 768w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updated-domain-name-1-480x321.jpg 480w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updated-domain-name-1-506x338.jpg 506w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updated-domain-name-1-580x387.jpg 580w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Updated-domain-name-1-427x285.jpg 427w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\">Save using <strong>Ctrl + x<\/strong> and close the file.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">It\u2019s time to enable the file with the&nbsp;<strong>a2ensite<\/strong>&nbsp;tool:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo a2ensite serverhubtest.conf<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Disable the default site in&nbsp;<code>000-default.conf<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>sudo a2dissite 000-default.conf<\/strong><\/span><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Finally, test for configuration errors using:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>sudo apache2ctl configtest<\/strong><\/span><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">You should receive the following output:<\/p>\n\n\n\n<p>Output<br><code>Syntax OK<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"803\" height=\"577\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Finalizing.jpg\" alt=\"Restarting Apache\" class=\"wp-image-564\" srcset=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Finalizing.jpg 803w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Finalizing-300x216.jpg 300w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Finalizing-768x552.jpg 768w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Finalizing-480x345.jpg 480w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Finalizing-470x338.jpg 470w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Finalizing-564x405.jpg 564w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Finalizing-397x285.jpg 397w\" sizes=\"(max-width: 803px) 100vw, 803px\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\">Last note: restart Apache to implement your changes:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span class=\"has-inline-color has-vivid-cyan-blue-color\">sudo systemctl restart apache2<\/span><\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-black-color has-text-color\">Apache should now be serving your domain name.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">You can test this by visiting&nbsp;http:\/\/serverhubtest, or writing <strong>localhost<\/strong> in your browser address bar.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">When you do see something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"802\" height=\"573\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Server-installed.jpg\" alt=\"Verified server installation\" class=\"wp-image-565\" srcset=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Server-installed.jpg 802w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Server-installed-300x214.jpg 300w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Server-installed-768x549.jpg 768w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Server-installed-480x343.jpg 480w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Server-installed-473x338.jpg 473w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Server-installed-567x405.jpg 567w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Server-installed-399x285.jpg 399w\" sizes=\"(max-width: 802px) 100vw, 802px\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\">It means that you\u2019ve done it, you amazing tech-savvy you!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Important Apache directories<\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">Congrats! You\u2019ve definitely come a long way with managing the Apache service. Still, you need to take extra minutes to get used to a few important directories and files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Configuration Files<\/strong><\/h3>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background\">Log files for generated errors can be found at&nbsp;<code><strong>\/var\/log\/apache2\/error.log<\/strong><\/code><br><br>Access logs for interactions with clients are in the file&nbsp;<code><strong>\/var\/log\/apache2\/access.log<\/strong><\/code><br><br>The website content is stored in the<strong> <code>\/var\/www\/html\/<\/code><\/strong><code> <\/code>directory<br><br>Apache does function through configuration files, which are located in <strong><code>\/etc\/apache2\/<\/code>&nbsp;<\/strong><br><br>The main Apache configuration file that controls everything is located at <strong><code>\/etc\/apache2\/apache2.conf<\/code>&nbsp;<\/strong><br><br>The file that holds ready-to-serve-client websites: <code><strong>\/etc\/apache2\/sites-enabled<\/strong><\/code><br><br>The storage for Apache virtual host files:<code> <\/code><strong><code>\/etc\/apache2\/sites-available<\/code>&nbsp;<\/strong><br><br>You can customize the ports Apache monitors using the file: <code><strong>\/etc\/apache2\/ports.conf<\/strong><\/code>&nbsp;<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Feel free to take a deeper look at all other configurations and directories visiting the <a href=\"https:\/\/ubuntu.com\/server\/docs\"><strong>Ubuntu server guide<\/strong><\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ServerHub and creating your website<\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">You\u2019re probably wondering:&nbsp;How can I create my complete website in the easiest way?<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">That\u2019s where we\u2019ve got you covered.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\"><span class=\"has-inline-color has-vivid-cyan-blue-color\"><a href=\"https:\/\/www.serverhub.com\/\"><strong><u>ServerHub<\/u><\/strong>&nbsp;<\/a><\/span>provides top-of-the-line dedicated servers at affordable prices using only enterprise-grade hardware.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">We constantly add new integrations and features to our products, so no matter what your website is for, ServerHub is here for you.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">If you\u2019re thinking of creating your own website, don\u2019t hesitate to reach out to our support team for information at:&nbsp;<strong><a href=\"https:\/\/serverhub.com\/company\/contact\">support@serverhub.com<\/a><\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Although this article focuses mostly on Ubuntu Linux and how to install Apache, ServerHub can be used with any operating system.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link\" href=\"https:\/\/serverhub.com\/company\/about\"><em><strong><span class=\"has-inline-color has-light-green-cyan-color\">Find out more!<\/span><\/strong><\/em><\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Benefits of using ServerHub<\/strong><\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">Here\u2019s a glimpse of what you\u2019ll get when you deploy your server using ServerHub:<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\"><strong>1. Multiple locations<\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Our Platform spans 9 locations around the globe that it seems like your servers are right next to each other.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">We have multiple single 40GB interface connectivities within our data center to bring you the fastest connections available<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\"><strong>2. A Simplified, Beautiful Interface<\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Elegance meets Simplicity. True brilliance and execution can only be expressed in one word: HubGrid.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Designed from the ground up with beauty, finesse, and pixel-perfect presentation. No other panel can compare.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"755\" height=\"505\" src=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Hubgrid.jpg\" alt=\"Hubgrid\" class=\"wp-image-566\" srcset=\"https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Hubgrid.jpg 755w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Hubgrid-300x201.png 300w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Hubgrid-480x321.jpg 480w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Hubgrid-505x338.jpg 505w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Hubgrid-580x388.jpg 580w, https:\/\/serverhub.com\/kb\/wp-content\/uploads\/2021\/06\/Hubgrid-426x285.jpg 426w\" sizes=\"(max-width: 755px) 100vw, 755px\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-text-color\"><strong>3. 100% Uptime, 24\/7 support, and leading resolution times!<\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">We deliver fast, reliable, and knowledgeable support with every service we provide.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">We focus on meaningful resolution times so you can get the answers you want when you need them. Because what is a great enterprise network and infrastructure without a solid team to support it?<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\"><strong>4. Consider a Custom Quote<\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Need a Custom Quote? Our sales team at <a href=\"https:\/\/serverhub.com\/company\/contact\">sales@serverhub.com<\/a> can Help!<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Get a custom solution backed by 24\/7\/365 support, and built on a solid redundant Tier 1 Network.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Over to you!<\/strong><\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">Naturally, you face these obstacles at first when you\u2019re getting exposed to the web hosting and cloud deployment world.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Still, as you can see, there\u2019re plenty of other options that you can choose from to run your own server.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\"><strong>Now it\u2019s time for you to start running your own website.<\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Take advantage of ServerHub\u2019s unlimited personalization, great customer support, and <a href=\"https:\/\/serverhub.com\/vps\/ssd-vps\"><strong>unprecedented prices starting from $5 a month!<\/strong><\/a><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">What are you waiting for?<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">If you need help with your amazing upcoming website or have questions or suggestions, please reach our support team at:&nbsp;<strong><a href=\"https:\/\/serverhub.com\/company\/contact\">support@serverhub.com<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"has-black-color has-text-color\">I know this has been quite the tutorial, but you made it to the moment of truth!<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">After cheering up with the fact that you now have your web server installed, you still got many ways left to go!<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">If you\u2019re thinking of something that\u2019s right there at your fingertip, ServerHub can spare you all the technical details -plus many more-.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\"><a href=\"https:\/\/serverhub.com\/dedicated-servers\"><strong>Instantly deploy your own server and website<\/strong><\/a> in a matter of no time!<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">What content are you planning to have? What are the best practices you\u2019ll follow to enhance both your site and visitors\u2019 experience?<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Tell us in the comments below how will-you put your newly gained Apache configuration skills into good use!<\/p>\n\n\n\n<p class=\"has-black-color has-vivid-green-cyan-background-color has-text-color has-background\"><strong>This tutorial is a part of the LAMP stack guide series.<\/strong><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Check out the rest of the series:<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/serverhub.com\/kb\/what-is-ubuntu-linux-and-how-to-install-it\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to install the latest Ubuntu Linux? Beginner\u2019s guide<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/serverhub.com\/kb\/howto\/install-apache-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><a href=\"https:\/\/serverhub.com\/kb\/how-to-install-php-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How to Install PHP on Ubuntu 20.04? Step-by-step Easy Guide<\/strong><\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/serverhub.com\/kb\/how-to-install-mysql-on-ubuntu-the-proven-2021-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How To Install MySQL On Ubuntu? The Proven 2021 Guide<\/strong><\/a><\/p>\n\n\n\n<p class=\"has-black-color has-text-color\">Read more<br><br><strong><a href=\"https:\/\/serverhub.com\/kb\/what-are-the-types-of-operating-systems-os\/\" target=\"_blank\" rel=\"noreferrer noopener\">What Are The Types Of Operating Systems (OS)<\/a><\/strong><br><a href=\"https:\/\/serverhub.com\/kb\/whats-the-difference-between-remote-vpn-site-to-site-vpn\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>What\u2019s The Difference Between Remote VPN &amp; Site-To-Site VPN<\/strong><\/a><br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>According to the Apache software foundation that was established in 1999 based on individual donations and corporate sponsors, Apache is open-source software that runs on 67% of the world\u2019s web servers.<\/p>\n<p>Able to meet the needs of many with reliable security and incredible speed, Apache became the most extensively used web server around the world.<\/p>\n<p>Additionally, Apache is used by the majority of WordPress hosting providers to freely turn computers into HTTP servers so people can request them as websites over the internet.<\/p>\n","protected":false},"author":1,"featured_media":569,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[93,60,61,7,59,1],"tags":[94,95,8,63],"class_list":["post-555","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache","category-how-to","category-linux","category-linux-administration","category-ubuntu","category-uncategorized","tag-apache","tag-how-to-2","tag-linux","tag-ubuntu"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/posts\/555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/comments?post=555"}],"version-history":[{"count":3,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/posts\/555\/revisions"}],"predecessor-version":[{"id":1056,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/posts\/555\/revisions\/1056"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/media\/569"}],"wp:attachment":[{"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/media?parent=555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/categories?post=555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/tags?post=555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}