Installing Apache 2.46 and PHP 7.4 on RHEL/CentOS 7

Overview

For security related reasons you need to first install Apache 2.46 and PHP 7.4 on RHEL/CentOS 7 before upgrading TOS to:

  • R21-3 RC1

  • R21-2 HF1.5

  • R21-2 HF2

  • R21-1 HF3.2

  • R21-1 HF4

After installing these components, you will need to immediately upgrade TOS to one of the above versions. TOS will be unavailable until the upgrade is complete.

Install Apache 2.46 and PHP 7.4 on RHEL/CentOS 7

  1. Login to the server as user root.

  2. Enable optional RPMs.

    subscription-manager repos --enable=rhel-7-server-optional-rpms
  3. Update all RPMs and reboot the server.

    yum update -y
  4. Stop the Apache service.

    systemctl stop httpd.service
  5. Backup the Apache configuration.

    cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_reinstall
    cp /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf_reinstall
  6. Remove the old Apache and PHP RPMs:

    yum remove -y apr15u apr15u-util apr15u-util-ldap httpd24u httpd24u-filesystem httpd24u-mod_ldap httpd24u-mod_ssl httpd24u-tools php56w php56w-cli php56w-common php56w-mysql php56w-opcache php56w-pdo
  7. Remove the old Yum repositories and clean the Yum cache.

    yum remove -y webtatic-release ius-release
    yum clean all
  8. Install Apache 2.4.6 with required packages.

    yum install -y apr-util-ldap httpd httpd-tools mod_ldap mod_ssl
  9. Install the yum-utils package for managing the Yum repositories.

    yum install -y yum-utils
  10. If not installed, install the EPEL release RPM for PHP dependencies.

  11. CentOS 7

    yum install -y epel-release

    RHEL 7

    Follow the directions on the EPEL website to install the epel-release package appropriate to the RHEL version of the system.

    yum install -y yum-utils
  12. Install the Remi release RPMs for PHP 7.4.

    rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
  13. If you don't have internet access to install the RPMs in steps 8 and 9, download the RPMs from a location with internet access, upload the RPMs to the machine and install them.
  14. Enable only PHP 7.4 repository from all Remi repositories.

    yum-config-manager --disable 'remi-php*'
    yum-config-manager --enable remi-php74
  15. Install PHP 7.4 with dependency packages.

    yum --disablerepo="*" --enablerepo=epel --enablerepo=remi-php74 install -y libsodium php php-cli 
    php-common php-json php-sodium
  16. Upgrade TOS. See the Release Notes of the relevant version for installation instructions.