Upgrade Apache

Upgrade Apache to Current Version in Ubuntu 20

Voiced by Amazon Polly

Before you upgrade, please be sure you have a current backup of your site and configuration.

To start, we will check our version of Apache using this command

apache2 -v

you will then see something like this:

ubuntu@servername:~$ apache2 -v
Server version: Apache/2.4.41 (Ubuntu)
Server built:   2021-09-28T16:55:53

Adding Apache PPA

The first thing we need to do to upgrade Ubuntu 20.04 Apache webserver to the latest version is adding the PPA by Ondřej Surý’s. If you don’t know, Ondřej is the maintainer for PHP on Debian and maintains the latest Apache PPA for Ubuntu along with Nginx and PHP.

To add the PPA, use the following command:

sudo add-apt-repository ppa:ondrej/apache2 -y && sudo apt update

Now we are ready to update apt and install the newest version of apache2. To do these tasks, we will use the following commands:

sudo apt install apache2

When prompted, press y to confirm the installation. Once these commands have finished running, we can recheck our version using the apache2 -v command.

ubuntu@serverip:~$ apache2 -v
Server version: Apache/2.4.49 (Ubuntu)
Server built:   2021-09-28T16:55:53

At this point, the only thing we need to do is restart apache2 using the following command:

sudo systemctl restart apache2

We have now upgraded our apache2 server from 2.4.41 to 2.4.49. Enjoy!

Similar Posts

One Comment

Leave a Reply