{"id":254,"date":"2023-01-12T14:55:48","date_gmt":"2023-01-12T10:55:48","guid":{"rendered":"https:\/\/kidds.co.za\/?p=254"},"modified":"2023-01-12T14:55:48","modified_gmt":"2023-01-12T10:55:48","slug":"update-apache2-ubuntu-20-and-22","status":"publish","type":"post","link":"https:\/\/kidds.co.za\/index.php\/2023\/01\/12\/update-apache2-ubuntu-20-and-22\/","title":{"rendered":"Update Apache2 Ubuntu 20 and 22"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Recommended Steps Before Installation<\/h2>\n\n\n\n<p>Before you begin, run an update on your system to ensure all packages are up-to-date to avoid any conflicts during the installation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<p>Proceed to upgrade any outdated packages using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"adding-apache-repository-by-ondrej-sury-repository\">Adding Apache Repository by Ond\u0159ej Sur\u00fd Repository<\/h3>\n\n\n\n<p>The first step is to import the Apache webserver to the latest version is add the repository by\u00a0<strong><a rel=\"noreferrer noopener\" href=\"https:\/\/launchpad.net\/~ondrej\" target=\"_blank\">Ond\u0159ej Sur\u00fd<\/a><\/strong>. <\/p>\n\n\n\n<p>Before you begin, run the following command to ensure these packages are present; most users should be already installed on your system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install dirmngr ca-certificates software-properties-common gnupg gnupg2 apt-transport-https -y<\/code><\/pre>\n\n\n\n<p>Importing GPG keys from Ubuntu\u2019s KeyServer, a common issue is that your command line terminal may not create the necessary directories. Run this to create these directories.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo gpg --list-keys<\/code><\/pre>\n\n\n\n<p><em>What you should see:<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg: directory '\/root\/.gnupg' created\ngpg: keybox '\/root\/.gnupg\/pubring.kbx' created\ngpg: \/root\/.gnupg\/trustdb.gpg: trustdb created<\/code><\/pre>\n\n\n\n<p>The next task is to import the GPG key needed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo gpg --no-default-keyring --keyring \/usr\/share\/keyrings\/ondrej.gpg --keyserver keyserver.ubuntu.com --recv-keys 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C<\/code><\/pre>\n\n\n\n<p><em>Example output:<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg: keybox '\/usr\/share\/keyrings\/ondrej.gpg' created\ngpg: key 4F4EA0AAE5267A6C: public key \"Launchpad PPA for Ond\u0159ej Sur\u00fd\" imported\ngpg: Total number processed: 1\ngpg:               imported: 1\n<\/code><\/pre>\n\n\n\n<p>Ensure success with your installation by choosing the correct command for the version of Ubuntu you\u2019re running! It\u2019s easy \u2013 import your GPG key and select a LaunchPAD PPA that matches.<\/p>\n\n\n\n<p><strong>Below only run the one for your version of Ubuntu 20 or 22 :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsb_release -a<\/code><\/pre>\n\n\n\n<p>What you should see<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>No LSB modules are available.\r\nDistributor ID: Ubuntu\r\nDescription:    Ubuntu 20.04.5 LTS\r\nRelease:        20.04\r\nCodename:       focal<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Import Apache PPA for Ubuntu 22.04 LTS Jammy Jellyfish LTS<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>echo 'deb &#91;signed-by=\/usr\/share\/keyrings\/ondrej.gpg] https:\/\/ppa.launchpadcontent.net\/ondrej\/apache2\/ubuntu jammy main' | sudo tee -a \/etc\/apt\/sources.list.d\/apache2.list<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Import Apache PPA for Ubuntu 20.04 LTS Focal Fossa LTS<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>echo 'deb &#91;signed-by=\/usr\/share\/keyrings\/ondrej.gpg] https:\/\/ppa.launchpadcontent.net\/ondrej\/apache2\/ubuntu focal main' | sudo tee -a \/etc\/apt\/sources.list.d\/apache2.list<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install or Upgrade Apache<\/h3>\n\n\n\n<p>Update your repository to reflect the new change.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<p>With the PPA now added, you can install the latest Apache version from the PPA or upgrade your existing one.  The upgrade option below will update your apache2 to the latest version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install apache2\n<strong>or<\/strong>\nsudo apt upgrade<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service apache2 restart\napache2 -v<\/code><\/pre>\n\n\n\n<p>before you would have seen<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Server version: Apache\/2.4.41 (Ubuntu)\r\nServer built:   2022-06-14T13:30:55<\/code><\/pre>\n\n\n\n<p>now you will see<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Server version: Apache\/2.4.54 (Ubuntu)\r\nServer built:   2022-06-08T15:59:07\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Recommended Steps Before Installation Before you begin, run an update on your system to ensure all packages are up-to-date to avoid any conflicts during the installation. Proceed to upgrade any outdated packages using the following command. Adding Apache Repository by Ond\u0159ej Sur\u00fd Repository The first step is to import the Apache webserver to the latest [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,2],"tags":[],"class_list":["post-254","post","type-post","status-publish","format-standard","hentry","category-apache","category-linux"],"_links":{"self":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":1,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/254\/revisions"}],"predecessor-version":[{"id":255,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/254\/revisions\/255"}],"wp:attachment":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/categories?post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/tags?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}