Showing posts with label boot strap. Show all posts
Showing posts with label boot strap. Show all posts

Tuesday, December 3, 2013

Boot Strap : MySQL

Here is a user data boot strap script for installing and starting Oracle MySQL:

#!/bin/sh 
yum -y install mysql-server 
/etc/init.d/mysqld start 
echo -e '\n\nsudo /etc/init.d/mysqld start' >> /etc/rc.d/rc.local

Boot strap : NAT Instance

This is the user data boot strap script which 'makes' your EC2 instance into a NAT instance:
#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects
/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 0.0.0.0/0 -j MASQUERADE
/sbin/iptables-save > /etc/sysconfig/iptables
mkdir -p /etc/sysctl.d/
cat <<EOF > /etc/sysctl.d/nat.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.eth0.send_redirects = 0
EOF

Boot strap PHP and ELB examples

Here is strap script that can be used to install and start Apache along with PHP.  It will then download and unzip the AWS ELB examples.

yum -y install httpd php
chkconfig httpd on
/etc/init.d/httpd start
cd /var/www/html
wget http://bootstrapping-assets.s3.amazonaws.com/examplefiles-elb.zip

unzip examplefiles-elb.zip

Monday, December 2, 2013