Drupal EC2 / LAMP Quick Install

This is what I run when I want to quickly create an AWS instance running apache, mysql and php:

yum install -y php-mysql php-xml php-mcrypt php-mbstring \
    php-gd yum install -y php-pear yum install -y mysql-server
yum install -y php-devel yum install php-pecl-apc 
yum install -y php-pear php-devel httpd-devel
chkconfig --levels 235 httpd on 
chkconfig --levels 235 mysqld on 
service mysqld start service httpd start 
echo max_allowed_packet=16M>>/etc/my.cnf 
echo delayed_insert_timeout=10000>>/etc/my.cnf 
echo connect_timeout=100000>>/etc/my.cnf

Note: if you need pretty url, make sure that mod_rewrite is enabled (Enabled by default on centos and Ubuntu: a2enmod mod_rewrite).

Then make sure the httpd config /etc/httpd/conf/httpd.conf allows overrides with AllowOverride all)

Then, if I need drush, I install it with the following 2 lines:

pear channel-discover pear.drush.org pear install drush/drush