How To Upgrade Apache Version in Ubuntu

Last updated on September 21st, 2021 at 11:00 am

It is important to upgrade Apache version regularly to avail new features and security updates. It is very easy to update your Apache web server to the latest version of Apache. Here’s how to upgrade Apache version in Ubuntu, Debian Linux.

 

How To Upgrade Apache Version in Ubuntu, Debian

Here are the steps to upgrade Apache version in Ubuntu. You can use them to upgrade Apache 2.2 to 2.4 or even update Apache to latest version.

 

1. Backup Apache configuration File

Before you upgrade Apache version in Ubuntu, take a backup of your Apache configuration file. It is located at one of the following locations, depending on your installation

  • /etc/apache2/httpd.conf
  • /etc/apache2/apache2.conf
  • /etc/httpd/httpd.conf
  • /etc/httpd/conf/httpd.conf
$sudo cp /etc/apache2/httpd.conf /etc/apache2/httpd-backup.conf

Bonus Read : How to Enable Keep Alive in Apache

 

2. Install Prerequisites

Next, you need to install the following package.

$ sudo apt-get install software-properties-common

Bonus Read : How to Change Port Number in Apache in Ubuntu

 

3. Add Repository

Add the following Apache2 PPA repository

$ sudo add-apt-repository ppa:ondrej/apache2
$ sudo apt-get update

Bonus Read : How to Remove Server Name from Apache Response Header

 

4. Upgrade Apache Version in Ubuntu

Run the following command to upgrade Apache version

$ sudo apt-get upgrade

If you see any prompts after this step, enter NO or N and proceed further.

Bonus Read : How to Enable GZIP Compression in Apache

 

5. Check Apache Version Number

Run the following command to check Apache version number

$ sudo apache2 -v

That’s it! You have upgraded Apache web server version in Ubuntu, Debian Linux.

By the way, if you want to create charts & dashboards for your business or website, you can try Ubiq. We offer a 14-day free trial.