Tuesday, April 16, 2013

User data to install Apache and PHP


One of the most basic components on an EC2 instance is Apache and PHP.  Installing Apache and PHP is made easy with a short shell script, yum, and user data.  Here is all that needs to be placed in the user data section of the EC2 instance:

#!/bin/sh
yum -y install httpd php
chkconfig httpd on
/etc/init.d/httpd start

No comments:

Post a Comment