- This topic is empty.
May 12, 2014 at 10:35 pm #169971AlexParticipant
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,
Thanks!May 16, 2014 at 5:19 pm #170426crazycuriouscoderParticipant
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:
- Clone the server
- Start up the cloned server
- Tie a different domain it or I think you could use an auto-generated domain from AWS (I think they do that)
- Add this domain as a ServerAlias in your virtual host and restart apache
- 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 -Vor on some installations it’s httpd instead of apachectl. The location will be the value for HTTPD_ROOT. Also run
$ apachectl -Sto see where your VirtualHosts are stored. Also note what modules are being loaded
$ apachectl -M.
- 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”.
- 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.
- 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.
- It’ll start spitting out errors because some config directives have changed.
This should be a guide to those changes.
- 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.
- 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.
- 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.
- Replace the new configs under HTTPD_ROOT from your modified-configs folder
- Now stop apache
$ apachectl -k stop
- Start apache the normal way
$ apachectl -k start
- If it didn’t complain. Double check things again. Re-run
$ apachectl -Sand
$ apachectl -Mand 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.
- Once all of the configs are working copy either copy them back to the modified-configs folder or delete the modified-configs folder.
- 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.
- The forum ‘Back End’ is closed to new topics and replies.