The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress – Upgrading AWS EC2 from Apache 2.2 to 2.4 + PHP + MySQL…

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #169971


    I have a WordPress installation for a client running on an Amazon EC2 Instance, I want to get the server as up-to-date as possible. What should I expect when I upgrade?

    I want to install Apache 2.4 from 2.2, and I guess with that I’ll have to update PHP and MySQL as well. LAMP stack on Ubuntu.

    I know that’s a pretty broad question, but I’m a little stressed out about the time it’ll take to get everything up and running again.

    Does anyone know of any good articles that cover this topic? I’m reading through the Apache documentation now, it looks like a lot needs to be done with the config file.

    Any suggestions or advice would be appreciated,


    Here’s what you can do. Since you’re already on AWS you could do the following. I’m going to talk in general terms since I haven’t played with AWS, but I know at least the general concepts:

    1. Clone the server
    2. Start up the cloned server
    3. Tie a different domain it or I think you could use an auto-generated domain from AWS (I think they do that)
    4. Add this domain as a ServerAlias in your virtual host and restart apache
    5. Now back up all of your apache configs to some other place like /home/YOURUSERNAME. Make two copies of configs. Maybe you could create a folder called orig-configs and modified-configs. All this point, the content in both folders will be completely the same. That probably includes something like /etc/httpd/httpd.conf, /etc/httpd/conf.d/, and maybe even a /etc/httpd/extra. The easiest way to find where these are is running $ apachectl -V or on some installations it’s httpd instead of apachectl. The location will be the value for HTTPD_ROOT. Also run $ apachectl -S to see where your VirtualHosts are stored. Also note what modules are being loaded $ apachectl -M.
    6. Now upgrade I think you should be able to update both apache and php with apt-get. Do a google search for “upgrade apache php ubuntu”.
    7. Your configs will either be overwritten or completely new. I doubt it’ll fix anything in your previous configs so that it works in 2.4.
    8. You should be able to start apache with your previous config files with $ apachectl -f /home/YOURUSERNAME/modified-configs/httpd.conf. Now I’m not sure if you could specify the config AND do a syntax check at the same time, but if you can I’m pretty sure it’ll tell you everything that’s wrong. Try this out $ apachectl -f /home/YOURUSERNAME/modified-configs/httpd.conf -t.
    9. It’ll start spitting out errors because some config directives have changed.

      This should be a guide to those changes.

    10. Keep tweaking your configs in the modified-configs folder go back to step 8 until all the errors are gone. Primarily you’ll be dealing with directives that have changed, paths that have changed like those for loading modules (LoadModule), and possibly some other paths.
    11. Once apache successfully starts, double check that the website works. If everything’s okay copy the completely new configs that came from the upgrade to /home/YOURUSERNAME/new-apache-configs.
    12. Save a restore point (forget the AWS term) of the server, just in case you need to go back, because the next step could get really messy.
    13. Replace the new configs under HTTPD_ROOT from your modified-configs folder
    14. Now stop apache $ apachectl -k stop
    15. Start apache the normal way $ apachectl -k start
    16. If it didn’t complain. Double check things again. Re-run $ apachectl -S and $ apachectl -M and make sure they have the same output before you made any changes.

      If it DID complain run $ apachectl -t. That should give you all of the errors or at least give you a good starting point.

    17. Once all of the configs are working copy either copy them back to the modified-configs folder or delete the modified-configs folder.
    18. Copy over those configs to the live server OR, if nothing changed on the live server (the database didn’t get new data, no new files were updated, etc) , you could opt to use the server you played with and switch over to it as the live server, then stop the original server so that you aren’t paying for two servers. Just-in-case the new cloned server with Apache 2.4 has problems, you could fire up the previous one and use it or quickly try to determine what was different and fix the newest server.

    That’s how I would do it. If anything let me know.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.