Here is a quick checklist for setting up LAMP development server on Amazon EC2. I used a standard Amazon Linux AMI on a T2.micro instance, which costs about $9/month at the time of writing this.
- Edit the DNS zone for your domain to add an A record for a sub-domain to point to the public IP of the instance. I recommend setting the TTL to 60 for fastest updates of IP later if necessary.
- Use putty or ssh to log in to the instance.
- Follow the instructions at https://gist.github.com/aronwoost/1105007
- Test the server by visiting it on your browser using either the public IP or the url.
- Prepare web directory: A useful guide for permissions. The Apache user is “apache”, member of group “apache”.
- Prepare HTTPS: for Amazon Linux, this is already set up … but for more info, see http://wiki.centos.org/HowTos/Https
- Install Codiad (an online code editor/IDE — this enables you to write your code anywhere rather than being bound to your workstation and your desk):
Shell123456789cd /var/www/html/wget https://github.com/Codiad/Codiad/archive/v.2.3.0.zipunzip v.2.3.0.ziprm v.2.3.0.zipmv Codiad-v.2.3.0/ editsudo chgrp -R apache editcd editcp config.example.php config.phpsudo chgrp apache config.php
- Browse to servername/edit to set up Codiad. Once done, it’s now ready to use. from that same location.
Tip: need to set up multiple virtual hosts on the server? Amazon Linux is based on CentOS. Here is a step-by-step guide on setting up virtual hosts on CentOS. A similar guide for SSL virtual hosts.