System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.â„¢   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Updating Apache to the Latest Version in Linux

Last updated on:  2021-12-02

Authored by:  Jorge Garcia


The following instructions detail updating Apache to the latest version in CentOS, Redhat Linux, Ubuntu or Debian distributions.

Prerequisites

  • Dedicated server or virtual machine running Red Hat® Enterprise Linux, CentOS, Ubuntu or Debian.

Backup Apache configuration File

First it is needed to extract the backup configuration file. Bellow are the posibles destinations files were the file could be located: Ubuntu y debian:

  • /etc/apache2/httpd.conf
  • /etc/apache2/apache2.conf

CentOS y Redhat:

  • /etc/httpd/httpd.conf
  • /etc/httpd/conf/httpd.conf

Run the following command to copy the configuration file into a backup file.

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

Install the EPEL repository.

Follow this guide for you to install the EPEL repository. See Install EPEL and IUS repositories on CentOS and Red Hat for follow steps

Note: This step only applies for CentOS and RedHat based distributions.

Update Apache Version

Run the following command in order to update Apache.

RHEL and CentOS based distributions:
# yum update httpd

Ubuntu and Debian based distributions:
# apt-get update && apt-get install apache2
or
# apt update && apt install apache2

Restart Apache Server

In order to restart the apache server, you can run the following command

RHEL and CentOS based distributions:
# systemctl restart httpd

Ubuntu and Debian based distributions:
# systemctl restart apache2

Check Apache version

To check the package version that was instlled, you can run the following commands:

RHEL and CentOS based distributions:
#yum info httpd
or
#httpd -v
Ubuntu and Debian based distributions:
#dpkg -L apache2
or
#apache2 -v

Use the Feedback tab to make any comments or ask questions. You can also start a conversation with us.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.