I have a plan to back up Wheaton’s Learning Management System (LMS) to the cloud on a yearly basis. I talked about the basics of this architecture in my post I <3 Redmine and You Will Too.Essentially each academic year I will rotate a years worth of Moodle into the cloud, only keeping the current year and the previous year. Here’s a picture to give you a little help in understanding.
So now I need to find a way for people that are not me to access the Moodle that lives in the cloud. The problem is that every moodle has a config file, and in that config file, Moodle asks you to specify the URL for where your Moodle is located, this is slightly problematic because:
- Amazon EC2 servers are not given IP addresses, they are given a Public DNS like
- Technically they can be assigned to an IP address but Elastic IPs cost money when they aren’t being used, and frankly I would rather not have to pay extra if I don’t have to.
- The people accessing these Moodles can’t be expected to ssh into a server and change the config file.
So I need to make this happen automagically when the server starts up. I tried using the php variable $_SERVER but I got some weird things. So my idea is to have a start up script call the public-hostname (using the API amazon provides) and then edit the config file. That way when the server starts up, Moodle will automagically be available.