Prepare a LAMP web development server on Amazon EC2
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):
1 2 3 4 5 6 7 8 9
cd /var/www/html/ wget https://github.com/Codiad/Codiad/archive/v.2.3.0.zip unzip v.2.3.0.zip rm v.2.3.0.zip mv Codiad-v.2.3.0/ edit sudo chgrp -R apache edit cd edit cp config.example.php config.php sudo 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.