skip to Main Content

I have a legacy system in which Apache 2.2.34 (linux) is installed along with php 5.3.29 (CLI).

I just want to upgrade my apache to 2.4.x so that I will be able to use php 7.

I have tried searching for the same but majority of sites provide solution for CentOS or Ubuntu. I’m new to Linux so I’m a bit confused when applying the same on Amazon EC2 instance.

That would be really helpful if someone can provide me a step by step process to do the upgrade process. I just need to upgrade the server and I can do the configuration accordingly.

2

Answers


  1. Chosen as BEST ANSWER

    After some more googling, I have found the steps I have taken to upgrade. Hope that helps anyone looking for the same:

    Login to your Linux instance and perform the regular system updates first

    $ sudo yum update
    

    Stop the running web server

    $ sudo service httpd stop
    

    Create backup of the existing httpd by using command:

    $ sudo cp -a /etc/httpd /etc/httpd.bak
    

    Remove any existing PHP packages

    $ sudo yum remove php*
    

    Remove old web server installs

    $ sudo yum remove httpd*
    

    Update yum package repository

    $ sudo yum clean all
    $ sudo yum upgrade -y
    

    Install Apache 2.4

    $ sudo yum install httpd24
    

    Install PHP 7 packages

    $ sudo yum install php70 php70-mysqlnd php70-imap php70-pecl-memcache php70-pecl-apcu php70-gd
    

    Install a new version of mod_ssl

    $ sudo yum install mod24_ssl
    

    I also needed to reconfigure /etc/httpd/conf/httpd.conf and /etc/httpd/conf.d/ssl.conf in order to enable SSL and pretty permalinks.

    Finally all I needed to do is start my web server

    $ service httpd start
    

    That's it.


  2. Do retain that the solution by MrGoogle will reset any configuration in existence in the hpptd service.
    You will probably need to reconfigure some settings…
    I had to reconfigure mod_rewrite and .htaccess File for apache:
    https://devops.ionos.com/tutorials/install-and-configure-mod_rewrite-for-apache-on-centos-7/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search